Skip to content
rvwoens edited this page Dec 17, 2012 · 2 revisions

simple steps to start using laravel-oneauth

  • install bundle

  • add oneauth to app bundle.php: 'oneauth' => array('auto' => true),

  • migrate the database php artisan migrate

  • fill in id/secret pairs for your platforms in /oneauth/config/api.php, example: 'facebook' => array( 'id' => 'xxxx', 'secret' => 'ssss', 'scope' => 'email,offline_access', ),

  • set your url in /oneauth/config/url.php, example: return array( 'registration' => 'login/social_register', 'login' => 'login/social_login', 'callback' => 'connect/callback',

    'registered' => 'auth/account', 'logged_in' => 'auth/account', );

  • make sure to handle the connect controller of oneauth, add to routes: Route::controller('oneauth::connect');

  • create a link to facebook login on your login/registration page {{ HTML::link('connect/session/facebook','Login with facebook', array('class','btn_2')) }}

  • update your login controller with: public function get_social_register() { $user_data=Session::get('oneauth'); var_dump($user_data); }

That's it.

Clone this wiki locally