Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Socialite - google login failed “Missing required parameter: code”

I have this strange issue with using Laravel Socialite to log users in via Google API.

Everything configurations seem normal and ordinary, but I keep getting

error Missing required parameter: code

But in localhost works fine

Localhost: enter image description here

Server: enter image description here

URI de redirection autorisés http://example.com/subdir/auth/google/callback http://localhost:8000/auth/google/callback

like image 491
Amine99 Avatar asked Oct 16 '25 18:10

Amine99


1 Answers

After a long search, the solution is to remove the profile from scopes in vendor\laravel\socialite\src\Two\GoogleProvider.php

protected $scopes = [
    'openid',
    'email',
];
like image 186
Amine99 Avatar answered Oct 18 '25 08:10

Amine99