如何使用带有Google的Socialite从Homestead设置重定向网址?

问题描述 投票:0回答:1

当您尝试使用Homestead(在Ubuntu上)为Laravel设置Socialite时,Google登录所需的“重定向网址”始终标记为“错误”:

Error: invalid_request

Invalid parameter value for redirect_uri: Non-public domains not allowed: https://homestead.test/google/callback

并尝试添加http://homestead.test/google/callbackhttp://192.168.10.10/google/callback最终作为:

"Non top level domain supported"

或者只是

"Non valid URI"

由于谷歌的限制,它是否没有希望,或者有没有办法这样做?

laravel homestead google-login laravel-socialite
1个回答
0
投票

啊找到了!简短回答:

使用您绕过的真实域域编辑/ etc / hosts:

192.168.10.10   example.com

然后告诉Google接受它:

https://console.developers.google.com/apis/credentials/consent?project=xxx https://console.developers.google.com/apis/credentials?project=xxx

© www.soinside.com 2019 - 2024. All rights reserved.