Google OAuth 2:令牌请求中的response_type错误

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)

编辑2

response_type如上所述删除和更改URL解决了这个问题.

Jan*_*ger 5

收到授权代码后,您必须向'/ o/oauth2/token'询问访问令牌.此请求不带"范围"且没有"response_type"参数.有关详细信息,请参阅Google文档.