首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >autodesk-forge不接受cURL请求作用域

autodesk-forge不接受cURL请求作用域
EN

Stack Overflow用户
提问于 2017-03-13 11:55:28
回答 2查看 424关注 0票数 1

在获得Forge的初始访问令牌时遇到了困难,看起来我正在按照教程中的T进行操作,但没有运气。

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

我通过Cygwin在windows上运行curl。

代码语言:javascript
复制
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'

我得到的是..。

代码语言:javascript
复制
< 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"}

不知道是怎么回事。我请求的作用域实际上是错误的吗?

EN

回答 2

Stack Overflow用户

发布于 2017-03-14 07:01:57

随着时间的推移,JQ肯定会让事情变得更愉快。

事实证明,我的问题出在shell脚本的编码上,我要将命令写入到其中的是dos。将其设置为Unix允许正确解释我的args。

票数 1
EN

Stack Overflow用户

发布于 2017-03-13 12:57:51

你可以查看我在这篇文章中设置的步骤,它还通过cURL获得了一个2条腿的身份验证令牌。我已经用OSX终端和Windows Cygwin测试了这两个场景。

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42756406

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档