Socialite Google redirect_uri_mismatch

I am trying to login with google using socialite , my facebook login works fine so the problem in my google app, any help!!!

 'google' => [
    'client_id' =>      'app-key',
    'client_secret' =>  'app-secret',
    'redirect' =>       'http://www.shoptizer.com/callback/google',
],

google login Credentials


Also one more point to remember that Socialite also gives uri_mismatch_error even when your redirects are correctly defined in google console but you dynamically changed the redirectUrl through

return Socialite::with('google')->redirectUrl($redirect_url)->redirect();

So plz take care that you should also need to define while receiving the response

Socialite::driver('google')->redirectUrl($redirect_url)->stateless()->user();

where $redirect_url is your custom redirect url. After google redirects you to correct place, but even then Socialite checks it at its end.


I found this link https://blog.damirmiladinov.com/laravel/laravel-5.2-socialite-google-login.html

From this tutorial:

Occasionally it happens that google require some time to apply client configuration If you get an error message redirect_uri_missmatch wait couple of minutes and it should work normally.

Also change the redirect uri by:

'google' => [
   'client_id' =>      'app-key',
   'client_secret' =>  'app-secret',
   'redirect' =>       'https://www.shoptizer.com/callback/google',
],

If your app is provided by https you must match your http scheme on google api and on your redirect callback.