繁体   English   中英

Autodesk-forge两足式身份验证(OAuth):oauth

[英]autodesk-forge, 2-legged Authentication (OAuth): oauth

不知道我做错了什么,两腿认证。 我正在使用cygwin终端进行卷曲。 Cullback URL是http:// localhost:3000 / api / forge / callback / oauth

请查看下面的代码,让我知道出了什么问题。 不知道出什么问题了。 jq版本是1.6,curl 7.64.1 GNU bash,版本4.4.12(3)-发行版(x86_64-unknown-cygwin)

在我看来,HTTP版本是导致错误的原因.forge是我的新手。 因此,请给我一些有关这里出了什么问题的想法。

 $ curl -v 'https://developer.api.autodesk.com/authentication/v1/authenticate' -H 'Content-Type: application/x-www-form-urlencoded' -d 'client_id=qWSjFdCYTfhWsLZCSsLcSZCrDY2GsVSq' -d 'client_secret=PChX1GbaPFG42hQi' -d 'grant_type=client_credentials' -d 'scope=data:all'

输出错误报告如下:

    * STATE: INIT => CONNECT handle 0x8000770d8; line 1356 (connection #-5000)
* Added connection 0. The cache now contains 1 members
* STATE: CONNECT => WAITRESOLVE handle 0x8000770d8; line 1397 (connection #0)
*   Trying 34.212.2.95:443...
* TCP_NODELAY set
* STATE: WAITRESOLVE => WAITCONNECT handle 0x8000770d8; line 1476 (connection #0)
* Connected to developer.api.autodesk.com (34.212.2.95) port 443 (#0)
* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x8000770d8; line 1532 (connection #0)
* Marked for [keep alive]: HTTP default
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x8000770d8; line 1547 (connection #0)
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictionST=Delaware; serialNumber=2401504; C=US; ST=California; L=San Rafael; O=Autodesk, Inc.; OU=MCP-ASRD-CP; CN=developer.api.autodesk.com
*  start date: Mar 22 00:00:00 2019 GMT
*  expire date: Mar 22 12:00:00 2020 GMT
*  subjectAltName: host "developer.api.autodesk.com" matched cert's "developer.api.autodesk.com"
*  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
*  SSL certificate verify ok.
* STATE: PROTOCONNECT => DO handle 0x8000770d8; line 1566 (connection #0)
> POST /authentication/v1/authenticate HTTP/1.1
> Host: developer.api.autodesk.com
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 118
>
* upload completely sent off: 118 out of 118 bytes
* STATE: DO => DO_DONE handle 0x8000770d8; line 1621 (connection #0)
* STATE: DO_DONE => PERFORM handle 0x8000770d8; line 1743 (connection #0)
* Mark bundle as not supporting multiuse
* HTTP 1.1 or later with persistent connection
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Date: Thu, 22 Aug 2019 05:58:08 GMT
< Content-Length: 210
< Connection: keep-alive
<
* STATE: PERFORM => DONE handle 0x8000770d8; line 1933 (connection #0)
* multi_done
* 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"}

如错误消息所显示的data:all不是有效范围...

请参阅要访问的端点的“ 资源信息”部分,以了解需要哪些范围-您可以指定多个范围,只要它们有效地由空格分隔即可:

scope=data:read data:write bucket:read code:all

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM