Well i'm trying to implement in laravel 5.1 the login with google using socialite and i don´t have problems with the scopes but i need to implement the access_type as offline, somebody know, how can i configure this in socialite for laravel?
this is my connection line
$scopes = [
'https://www.googleapis.com/auth/plus.me',
'https://www.googleapis.com/auth/plus.profile.emails.read',
'https://www.googleapis.com/auth/gmail.readonly'
];
return Socialize::driver('google')->scopes($scopes)->setAccessType('offline')->redirect();
thanks for your help
Maybe an update since this question was last answered; looks like Taylor added functionality to pass optional parameters. Call the with
method with an associative array:
$scopes = [
'https://www.googleapis.com/auth/plus.me',
'https://www.googleapis.com/auth/plus.profile.emails.read',
'https://www.googleapis.com/auth/gmail.readonly'
];
$parameters = ['access_type' => 'offline'];
return Socialite::driver('google')->scopes($scopes)->with($parameters)->redirect();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With