Xeo*_*oss 10 google-api oauth-2.0
我正在尝试为OAuth响应令牌返回OAuth 2响应代码.但是,我的请求返回以下错误,谷歌的结果为零.我尝试更改response_type
为"令牌"而不是"代码",但这也不起作用.
OAuth 2参数只能有一个值:response_type
请求详情:
scope=https://www.googleapis.com/auth/userinfo.email
client_secret=_____
response_type=code
grant_type=authorization_code
redirect_uri=http://localhost/folder/
client_id=____.apps.googleusercontent.com
code=_____
Run Code Online (Sandbox Code Playgroud)
我正在发送这个第二步有效载荷 POST https://accounts.google.com/o/oauth2/auth
我的要求有什么问题?
我刚刚意识到https://accounts.google.com/o/oauth2/token
应该使用此请求的URL.但是,更改为该URL现在提供:
HTTP/1.0 400 Bad Request
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Date: Fri, 27 Jul 2012 22:44:35 GMT
Content-Type: application/json
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
{
"error" : "invalid_request"
}
Run Code Online (Sandbox Code Playgroud)
response_type
如上所述删除和更改URL解决了这个问题.
归档时间: |
|
查看次数: |
31078 次 |
最近记录: |