重复的grant_type参数Uber API

时间:2017-10-28 11:14:05

标签: oauth-2.0 uber-api cortana cortana-skills-kit

我正在尝试使用Cortana的Connected帐户让OAuth访问Uber。

身份验证数据,a.k.a.auth url,令牌网址,客户端密码等所有必需的内容都来自Uber API描述并传递给Cortana,因此她必须为我做所有低级别的工作。

但是当我尝试登录优步时,我接受了这样的回答:

"error": "The token response status code was not 200.",
"serviceRequest": {
    "Host": "login.uber.com",
    "Headers": {
        "Content-Type": "application/x-www-form-urlencoded",
        "Authorization": "Basic VXF6cGVzeWVwYXFPZDBrc0FsUTh3U0dTHFvb2k6TFg0TWFhVDRwU0NFNlM3ZDJVMGJSdlU0VnJhTnRncFJPVlo4UkNqQg=="
    },
    "Method": "POST",
    "Path": "/oauth/v2/token",
    "UrlParameters": {
        "redirect_uri": "https://www.bing.com/agents/oauth",
        "grant_type": "authorization_code",
        "code": "some code private here :)"
    },
    "PostData": "redirect_uri=https%3a%2f%2fwww.bing.com%2fagents%2foauth&grant_type=authorization_code&code=SOME_AUTHORIZATION_CODE"
},
"serviceResponse": {
    "Headers": {
        "Connection": "keep-alive",
        "Pragma": "no-cache",
        "X-Uber-App": "login",
        "Strict-Transport-Security": "max-age=604800",
        "X-Content-Type-Options": "nosniff",
        "X-XSS-Protection": "1; mode=block",
        "Cache-Control": "no-store",
        "Date": "Sat, 28 Oct 2017 10:30:57 GMT",
        "Set-Cookie": "session=421370309da06baf_59f45c61.RKb0a7144yyiV9HlZgssA5ZvSqE; Domain=login.uber.com; Secure; HttpOnly; Path=/",
        "Server": "nginx",
        "Content-Length": "84",
        "Content-Type": "application/json"
    },
    "StatusCode": 400,
    "ResponseData": "{\"error_description\": \"Duplicate grant_type parameter.\", \"error\": \"invalid_request\"}"
},

如您所见,在属性ResponseData中,我出错:Duplicate grant_type parameter.

它可能是什么?

1 个答案:

答案 0 :(得分:0)

当它们包含在POST数据中时,您是否需要将令牌请求的auth参数重复为URL参数。我假设"某些代码在这里私有:)"和SOME_AUTHORIZATION_CODE是一样的。