I am using Laravel 5.3 with Socialite.
I am getting 400 Bad Request error with message:
Missing required parameter: redirect_uri
The URL it generates is:
http://ift.tt/2hoZGrC
Details below:
service.php
'google' => [
'client_id' => '1234455-u3ifk8tr1qs41487fmevg2h2s1v6ubue.apps.googleusercontent.com',
'client_secret' => 'DxSOS0p1xKNuPger3IS_E4-i',
'redirect' => 'http://localhost:8000/google/callback',
],
Routes
Route::get('/{provider}/redirect', 'Auth\RegisterController@redirectToProvider');
Route::get('/{provider}/callback', 'Auth\RegisterController@handleProviderCallback');
Authorized URI settings in Google Console
http://localhost:8000/google/callback
Controller
public function handleProviderCallback($provider)
{
try {
$social_user = Socialite::driver($provider)->user();
} catch (Exception $e) {
return redirect('/');
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire