2017-03-31 49 views
0

我收到了一个奇怪的问题。谷歌唱歌按钮在我的本地系统上正常工作(使用url:localhost),但它在服务器上不起作用。 它不断给我的错误400错误:INVALID_REQUEST see error page hereGoogle登录按钮无法在服务器上工作

我已经加入我的服务器的URL谷歌控制台上,甚至从here

验证了我的URL

我使用的示例代码见我的演示here

回答

0

For use with requests from a web server. This is the path in your application that users are redirected to after they have authenticated with Google. The path will be appended with the authorization code for access. Must have a protocol. Cannot contain URL fragments or relative paths. Cannot be a public IP address.

您的重定向URI应该看起来更像这样。

http://ec2-54-175-82-188.compute-1.amazonaws.com/user/auth 

当你的代码运行时,它已经建立了以下要求(将这个在任何Web浏览器。)

https://accounts.google.com/o/oauth2/auth?redirect_uri=storagerelay%3A%2F%2Fhttp%2Fec2-54-175-82-188.compute-1.amazonaws.com%3Fid%3Dauth315255&response_type=permission%20id_token&scope=email%20profile%20openid&openid.realm=&client_id=651551554260-60j7jq0i2gjsfm1mm0rh74ie4m80md5i.apps.googleusercontent.com&ss_domain=http%3A%2F%2Fec2-54-175-82-188.compute-1.amazonaws.com&fetch_basic_profile=true&gsiwebsdk=2

如果你看重定向URI。

storagerelay%3A%2F%2Fhttp%2Fec2-54-175-82-188.compute-1.amazonaws.com%3Fid%3Dauth315255 

它不正确。它应该是您网站上用于处理认证的页面。

+0

我已经添加了这个路径是Google控制台,但它仍然没有工作 –

+0

看到我的控制台设置:https://i.stack.imgur.com/zmGq4.png 和域验证:https://i.stack .imgur.com/7TqwZ.png –

+0

是的,但看看错误消息。您没有从那里发送请求。重定向URI必须完全匹配您发送它的位置。 – DaImTo

相关问题