Vau*_*unt 5 google-authentication laravel laravel-socialite
我在生产环境中使用 Laravel Socialite 的 Google 身份验证时遇到问题。错误与此帖子中的错误相同:
Laravel Socialite 无法在实时服务器上运行,只能在本地计算机上运行
但我有一个 Apache 服务器,经过多次尝试,我还没有找到解决方案。
编辑:
客户端错误:POST“ https://www.googleapis.com/oauth2/v4/token ”导致“400 Bad Request”响应:
{
"error": "invalid_request",
"error_description": "Missing required parameter: code"
}
Run Code Online (Sandbox Code Playgroud)
小智 -2
此问题是由于vendor\laravel\socialite\src\Two\GoogleProvider.php中的配置文件范围而发生的。
您可以通过以下两种方法克服此错误:
protected $scopes = [
'openid',
'email',
];
Run Code Online (Sandbox Code Playgroud)
return Socialite::driver('google')->stateless()->redirect();
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4889 次 |
最近记录: |