我正在尝试根据Google文档实现Google API的OpenID身份验证:
我在第二步向 Google 发送身份验证请求时遇到了问题。在响应中,我没有收到 Google 应该发送给我的代码。这是我的代码:
def client = new RESTClient("https://accounts.google.com/o/oauth2/auth")
def p = [
scope: scope,
state: "security_token="+state,
redirect_uri: redirecturi,
response_type: responsetype,
client_id: clientID,
ignoreSSLIssues: true,
]
def response = client.post ( body : p,
contentType : URLENC)
我确保所有参数都正确,但在响应中我得到
Status 302
并且我没有收到代码。
我只是对
redirect_uri
有疑问,我正在使用这个:
https://developers.google.com/oauthplayground
提前致谢!
您的服务器无法向该 URL 发出 HTTP 请求,需要由将进行身份验证的用户在浏览器中打开它。请务必阅读身份验证文档。