在获得Forge的初始访问令牌时遇到了困难,看起来我正在按照教程中的T进行操作,但没有运气。
https://developer.autodesk.com/en/docs/oauth/v2/reference/http/authenticate-POST/
我通过Cygwin在windows上运行curl。
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"}不知道是怎么回事。我请求的作用域实际上是错误的吗?
发布于 2017-03-14 07:01:57
随着时间的推移,JQ肯定会让事情变得更愉快。
事实证明,我的问题出在shell脚本的编码上,我要将命令写入到其中的是dos。将其设置为Unix允许正确解释我的args。
发布于 2017-03-13 12:57:51
你可以查看我在这篇文章中设置的步骤,它还通过cURL获得了一个2条腿的身份验证令牌。我已经用OSX终端和Windows Cygwin测试了这两个场景。
https://forge.autodesk.com/blog/tutorial-using-curl-2-legged-authentication-model-translation
https://stackoverflow.com/questions/42756406
复制相似问题