2017-10-28 73 views
1

我试图使用Cortana的连接帐户获得优优访问OAuth。复制grant_type参数优步API

认证数据所需的所有必要信息,诸如auth url,令牌url,客户机密码等都是从Uber API描述中提取出来的,并传递给Cortana,所以她必须为我做所有低级别的工作。

但是,当我试图登录到尤伯杯,我receving这样的答案:

"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.

什么可能它是?

回答

0

您是否需要在标记请求的auth参数中包含POST数据时将其作为URL参数重复使用?我假设“一些代码在这里私有:)”和SOME_AUTHORIZATION_CODE是相同的。

+0

是的,你说得对,这是相同的代码。但这不是我重复他们。 Cortana提出的要求,据我所知,我不能影响其内容。 因此,一般来说,看起来就像Cortana的工作原理 - 这项服务重复请求中的参数。 – Ivan