Autodesk-forge 不接受 cURL 请求范围



在Forge的初始访问令牌上遇到困难,看来我关注了t的教程,但没有运气。

https://developer.autodesk.com/en/docs/oauth/v2/reference/http/authenticate-post/

我正在通过Cygwin在Windows上运行卷发。

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

我得到的是...

< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Date: Mon, 13 Mar 2017 03:50:00 GMT
* Server Apigee Router is not blacklisted
< Server: Apigee Router
< Content-Length: 210
< Connection: keep-alive
<
* STATE: PERFORM => DONE handle 0x600057680; line 1981 (connection #0)
* multi_done
* Curl_http_done: called premature == 0
* Connection #0 to host developer.api.autodesk.com left intact
{"developerMessage":"Requested scopes must be blank or a subset of the provided scopes.","userMessage":"","errorCode":"AUTH-004","more info":"http://developer.api.autodesk.com/documentation/v1/errors/AUTH-004"}

不确定发生了什么。我要求的范围实际上是错误的吗?

JQ肯定会使事情变得更加愉快。

事实证明,我的问题是我写命令的shell脚本的编码是dos。将其设置为UNIX允许正确解释我的ARG。

您可以检查我在这篇文章中设置的步骤,该步骤还可以通过卷发获得2腿的身份验证令牌。我已经用OSX终端和Windows Cygwin测试了这两个方案。

https://forge.autodesk.com/blog/tutorial-using-curl-2-legged-authentication-model-translation

最新更新