2017 © Pedro Peláez
 

library ezoauth2

Oauth2 for Lavarel 4. Just some lines of code.

image

khoimk/ezoauth2

Oauth2 for Lavarel 4. Just some lines of code.

  • Thursday, June 20, 2013
  • by khoimk
  • Repository
  • 2 Watchers
  • 6 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ezoauth2

Oauth2 for Laravel 4, (*1)

This is very easy to use., (*2)

Step 1: Create config file, (*3)

Add a config file to app/config/ezoauth2.php with content:, (*4)

return array(, (*5)

    'google'=>array(
            'name'=>'google',               
            'key'=>array(               
                'id'=>'client_id',                  
                'secret'=>'client_secret'                   
                ),                  
            'returnUrl'=>'http://localhost:8080/laravel/public/social/google'               
            ),
        'facebook'=>array(
            'name'=>'facebook',
            'key'=>array(
                'id'=>'client_id',
                'secret'=>'client_secret'
                ),
            'returnUrl'=>'http://localhost:8080/laravel/public/social/facebook'
            )
    );

Step 2: Add the last value to providers array in app/config/app.php, (*6)

'Khoimk\Ezoauth2\Ezoauth2ServiceProvider', (*7)

Step 3: Add this route to route.php, (*8)

if($provider!=''){
    $o = App::make('ezoauth2');
    $o->setConfig($provider);
    $url = $o->authenticate();
    if($url){
        return Redirect::to($url);
    }
    if(isset($_GET['logout'])){
        $o->logout();
    }
    else{
        if($user = $o->getUserInfo()){
            var_dump($user);
        }
    }
}

Step 4: Add this line to composer.json file in the root of laravel, (*9)

"khoimk/ezoauth2": "*"

This version just support Google and Facebook authentication. I will include Twitter and MS in next version. Happy coding :), (*10)

The Versions

20/06 2013

dev-master

9999999-dev

Oauth2 for Lavarel 4. Just some lines of code.

  Sources   Download

The Requires

 

by Avatar khoimk