PHP code example of boolw / renrensocialite

1. Go to this page and download the library: Download boolw/renrensocialite library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

boolw / renrensocialite example snippets


//Laravel\Socialite\SocialiteServiceProvider::class,
SocialiteProviders\Manager\ServiceProvider::class,

'Socialite' => Laravel\Socialite\Facades\Socialite::class,

protected $listen = [
    'SocialiteProviders\Manager\SocialiteWasCalled' => [
        'Boolw\RenrenSocialite\RenrenExtendSocialite@handle',
    ],
];

'renren' => [
    'client_id' => 'your renren app App Key',
    'client_secret' => 'your renren app App Secret',
    'redirect' => 'http://laravel.app:8000/auth/renren/callback'
]

public function redirectToProvider(Request $request,$service)
{
    return Socialite::driver($service)->redirect();
}

public function handleProviderCallback(Request $request,$service)
{
    $user = Socialite::driver($service)->user();
    dd($user);
}

Route::get('auth/{service}', 'Auth\AuthController@redirectToProvider');
Route::get('auth/{service}/callback', 'Auth\AuthController@handleProviderCallback');