2016-05-03 62 views
0

我试图按照例如 OAuth 2.0 Flow: Client-side web apps的OAuth 2.0流程:服务器端Web apps-错误:缺少:grant_type

curl -X POST -H 'Content-Type:application/x-www-form-urlencoded' -F 'client_id=739532980462-7ra1v7rqn798u4j0dcgvh45joo5dma9e.apps.googleusercontent.com' -F 'redirect_uri=http://localhost:18080/examples' -F 'response_type=token' https://accounts.google.com//o/oauth2/token     { 
    "error" : "invalid_request", 
    "error_description" : "Required parameter is missing: grant_type" 
} 

我都跟着例子,但我收到错误消息时得到了以下errr:

ERROR_DESCRIPTION”: “缺少必需的参数:grant_type”

有什么可以不对我的查询Ø r设置?

问候, 奥利弗

+0

确定的URI的后缀为'的oauth2/token'而不是'oauth2/auth'他们在他们的文档中提到? –

回答

0

如上的评论者提到你应该使用:而不是

curl ... https://accounts.google.com/o/oauth2/auth 

curl ... https://accounts.google.com/o/oauth2/token 
相关问题