Google+ OAuth API - error 400


Google+ OAuth API - error 400

我在Google+身份验证方面遇到了一些问题,我似乎无法理解。

我正在本地机器上的WAMP服务器上运行一个页面。该网站托管在localhost:80 上

我按如下方式设置OAuth凭据:

REDIRECT URIS  
http://localhost:80/oauth2callback
JAVASCRIPT ORIGINS 
http://localhost:80

因此回调和JS源代码都调整为localhost:80(据我所知)。

然而,当我使用Google+登录按钮时,我会点击我的谷歌帐户,但随后会收到以下错误消息。

400. That’s an error.
Error: origin_mismatch
Request Details
=
from_login=1
e=3100077
scope=https://www.googleapis.com/auth/plus.login
redirect_uri=postmessage
state=886354831|0.2093651692
origin=http://localhost
as=6ab1e337782cd5f6
pli=1
request_visible_actions=http://schema.org/AddAction
hl=en
response_type=code token id_token gsession
cookie_policy=single_host_origin
proxy=oauth2relay1316100299
include_granted_scopes=true
client_id=/blanked this part for security/-jsaproji1sk0u1b8kjlh3m3n4i232m4b.apps.googleusercontent.com
authuser=0
That’s all we know.

它概述了错误是由origin_mismatch引起的。我已经尝试过设置OAuth原点&将凭据分别重定向到localhost和localhost:80,但两者都给出错误400

有经验的人能帮我一把吗?我还是这个的新手

提前感谢,Sam

您是否尝试将javascript原点也设置为:http://localhost而不仅仅是http://localhost:80

原点必须是精确的匹配,并且在查询中,它不包含作为原点一部分的端口号。

可以通过每行添加一个原点来添加多个原点
-Dragonfire