Google+ OAuth API - 错误400
问题描述:
我在使用Google+身份验证时遇到了一些问题,我似乎无法解决这个问题。Google+ OAuth API - 错误400
我在本地机器上的WAMP服务器上运行一个页面。该网站被托管在localhost:80
我设置了OAuth认证,如下:
REDIRECT URIS
http://localhost:80/oauth2callback
JAVASCRIPT ORIGINS
http://localhost:80
所以回调和JS的起源都调整为localhost:80(据我所知) 。
但是,当我使用Google+登录按钮时,我点击了我的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原点&重定向凭证分别为本地主机和本地主机:80,但都出现错误400
有人多一点经验给我一只手?我仍然很新的这
由于提前, 山姆
答
你尝试还设置了JavaScript的起源:http://localhost
不仅仅是http://localhost:80
?
来源必须是确切匹配,并且在您的查询中,它不包含端口号作为原点的一部分。
您可以通过每行添加一个来添加多个来源。
- Dragonfire