【问题标题】:autodesk-forge doesn't accept cURL request scopeAutodesk-forge 不接受 cURL 请求范围
【发布时间】:2017-08-03 01:01:18
【问题描述】:

在获取 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"}

不知道发生了什么。我请求的范围真的错了吗?

【问题讨论】:

    标签: curl oauth autodesk-forge


    【解决方案1】:

    JQ 一定会让事情变得更愉快。

    原来我的问题是我将命令写入的 shell 脚本的编码是 dos。将其设置为 Unix 可以正确解释我的参数。

    【讨论】:

      【解决方案2】:

      您可以查看我在这篇文章中设置的步骤,该步骤还通过 cURL 获取 2legged 身份验证令牌。我已经使用 OSX 终端和 Windows Cygwin 测试了这两种场景。

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

      【讨论】:

        猜你喜欢
        • 2017-07-28
        • 2018-05-10
        • 2020-11-03
        • 1970-01-01
        • 2019-10-02
        • 2019-06-01
        • 1970-01-01
        • 2023-03-12
        • 2019-04-10
        相关资源
        最近更新 更多