2017 © Pedro Peláez
 

library google-login

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

image

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)

  • Tuesday, November 5, 2013
  • by vic
  • Repository
  • 2 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

PHP-Rocker - Google login

Install this package in your Rocker application and your users will be able to authenticate with their user credentials at Google., (*1)

This installation walk through takes for granted that you have some prior knowledge about composer, (*2)

1) Install PHP-Rocker

Here you can read more about how to get started with PHP-Rocker, (*3)

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., (*4)

3) Edit config.php

In the file config.php you change the authentication class to Rocker\GoogleLogin\Authenticator., (*5)

return array(
    ...

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

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., (*6)

$ 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, (*7)

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., (*8)

'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
)

The Versions

05/11 2013

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

api rest http google restful gmail webservice

11/06 2013

1.0.3

1.0.3.0

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

  Sources   Download

MIT

The Requires

 

api rest http google restful gmail webservice

18/05 2013

1.0.2

1.0.2.0

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

  Sources   Download

MIT

The Requires

 

api rest http google restful gmail webservice

18/05 2013

1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

api rest http google restful gmail webservice