Autodesk Forge卷曲双腿令牌失败(AUTH-008)

时间:2016-11-15 10:15:14

标签: curl autodesk autodesk-forge

我试图获得一条两条腿的令牌,如下所示:https://developer.autodesk.com/en/docs/oauth/v2/tutorials/get-2-legged-token/

这是我在cygwin中输入的内容(id和secret是示例中的内容,但我使用自己的id和秘密):

curl -v 'https://developer.api.autodesk.com/authentication/v1/authenticate' -X 'POST' -H 'Content-Type: application/x-www-form-urlencoded' -d ' client_id=obQDn8P0GanGFQha4ngKKVWcxwyvFAGE& client_secret=eUruM8HRyc7BAQ1e& grant_type=client_credentials& scope=data:read'

但我明白了:

< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Date: Tue, 15 Nov 2016 10:06:09 GMT
* Server Apigee Router is not blacklisted
< Server: Apigee Router
< Content-Length: 231
< Connection: keep-alive
<
* STATE: PERFORM => DONE handle 0x600057550; line 1965 (connection #0)
* multi_done
* Curl_http_done: called premature == 0
* Connection #0 to host developer.api.autodesk.com left intact
{"developerMessage":"The required parameter(s) client_id,client_secret,grant_type not present in the request","userMessage":"","errorCode":"AUTH-008","more info":"http://developer.api.autodesk.com/documentation/v1/errors/AUTH-008"}

我从网站上获取的示例中是否有可能缺少参数?

1 个答案:

答案 0 :(得分:1)

每位经验丰富的程序员都非常清楚,对错误发生的方式没有任何限制。

在这种情况下,在指定范围之前,我会在数据中看到一个空格。

这可能是原因吗?

客户端ID前面还有另一个领先空间。

也许忽略了一个。

以下是您正在尝试实现的工作样本:

http://thebuildingcoder.typepad.com/blog/2016/10/forge-intro-formats-webinars-and-fusion-360-client-api.html#3