PHPackages                             rocker/google-login - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. rocker/google-login

ActiveLibrary[HTTP &amp; Networking](/categories/http)

rocker/google-login
===================

Package that makes it possible to authenticate against a PHP-Rocker application using google user credentials (https://github.com/victorjonsson/PHP-Rocker)

1.0.3(13y ago)02MITPHPPHP &gt;=5.3.2

Since May 18Pushed 12y ago1 watchersCompare

[ Source](https://github.com/victorjonsson/PHP-Rocker-google-login)[ Packagist](https://packagist.org/packages/rocker/google-login)[ RSS](/packages/rocker-google-login/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

PHP-Rocker - Google login
=========================

[](#php-rocker---google-login)

Install this package in your [Rocker application](https://github.com/victorjonsson/PHP-Rocker) and your users will be able to authenticate with their user credentials at Google.

*This installation walk through takes for granted that you have some prior knowledge about [composer](http://getcomposer.org)*

### 1) Install PHP-Rocker

[](#1-install-php-rocker)

Here you can read more about [how to get started](https://github.com/victorjonsson/PHP-Rocker#installation) with PHP-Rocker

### 2) Add the Google login package

[](#2-add-the-google-login-package)

Add `"rocker/google-login" : "1.0.*"` to the application requirements in *composer.json* and call `composer update` in the console.

### 3) Edit config.php

[](#3-edit-configphp)

In the file config.php you change the authentication class to Rocker\\GoogleLogin\\Authenticator.

```
return array(
    ...

    'application.auth' => array(
        'class' => '\\Rocker\\GoogleLogin\\Authenticator',
        'mechanism' => 'google realm="your.website.com"'
    ),
);
```

### 4) Implementation

[](#4-implementation)

That's it! Now the user can authenticate with e-mail and password registered att Google. The user will be created if he doesn't exist in the database when authenticated.

```
$ curl -H 'Authorization: google shawn1980@gmail.com:google-password' https://www.website.com/api/me

{
    "id" : 10341,
    "email" : "shawn1980@gmail.com",
    "nick" : "Shawn 1980",
    "meta" : {
        "created" : 1368864490
    }
}
```

*Tip! Use persistent caching (APC or file based caching) in PHP-Rocker to speed up the server response when requesting operations that requires authentication*

Optional configuration
----------------------

[](#optional-configuration)

You can add the following configuration to config.php if you want to restrict which authentication mechanisms that should be enabled or which e-mail domains that should be allowed.

```
'google.login' => array(

    # Comma separated string telling PHP-Rocker that the user has to have an e-mail address
    # at one of the declared domains
    'allowed_domains' => 'somewebsite.com,otherwebsite.co.uk',

    # Comma separated string with authentication mechanism that should be disabled
    'disabled_auth_mechanisms' => 'basic,rc4',

    # Whether or not the user credentials should be base64_decoded by the Authentication
    # class. This option should be set to true in case your'e using rocker.js to
    # communicate with your Rocker server
    'base64_encoded' => true
)

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Total

3

Last Release

4767d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/400fc7363b72aabbb4b7d8cbc241a8d7dffb9ca4844ce4403e9511313192e232?d=identicon)[vic](/maintainers/vic)

---

Top Contributors

[![victorjonsson](https://avatars.githubusercontent.com/u/429182?v=4)](https://github.com/victorjonsson "victorjonsson (10 commits)")

---

Tags

httpapirestgooglerestfulwebservicegmail

### Embed Badge

![Health badge](/badges/rocker-google-login/health.svg)

```
[![Health](https://phpackages.com/badges/rocker-google-login/health.svg)](https://phpackages.com/packages/rocker-google-login)
```

###  Alternatives

[nategood/httpful

A Readable, Chainable, REST friendly, PHP HTTP Client

1.8k17.5M274](/packages/nategood-httpful)[cundd/rest

REST API for TYPO3 CMS

77122.1k1](/packages/cundd-rest)[wellrested/wellrested

Simple PHP Library for RESTful APIs

4819.2k4](/packages/wellrested-wellrested)[msankhala/parsehub-php

Php wrapper classes for Parsehub REST api.

1312.4k](/packages/msankhala-parsehub-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
