我目前正在尝试完成基于Getting a 3-Legged Token with Authorization Code Grant
的分步教程这是我的cURL代码:
curl -v "https://developer.api.autodesk.com/authentication/v1/gettoken"
-X POST
-H "Content-Type:application/x-www-form-urlencoded"
-d "client_id=****&
client_secret=****&
grant_type=authorization_code&
code=1O4F-z9gXRtGlBymcGoD3bV3Ws2cqqjeN78PpgGn&
redirect_uri=http://localhost:3000/api/forge/callback/oauth"
这是我遇到的错误:
{"developerMessage":"The authorization code/refresh token is expired or
invalid/redirect_uri must have the same value as in the authorization
request.","userMessage":"","errorCode":"AUTH-004","more
info":"http://developer.api.autodesk.com/documentation/v1/errors/AUTH-004"}*
Connection #0 to host developer.api.autodesk.com left intact
注意:
答案 0 :(得分:1)
我认为这是在用户登录后得到的 code ,其有效时间非常短。毕竟,array([[ 1.25024870+0.j ],
[ 0.00000000-0.49999962j],
[ 0.00000000+0.j ],
[ 0.00000000+0.49999962j],
[ 1.00000113+0.j ],
[ 0.00000000+0.j ],
[ 0.00000000+0.j ],
[ 0.00000000+0.j ],
[ 47.75025018+0.j ]])
端点是在用户登录后立即调用的。
顺便说一句。我经历了相同的步骤,由于花了我一段时间才使用收到的 code 创建邮递员请求,所以我最终遇到了与您相同的错误。然后,当我请求另一个 code 并立即重新发送Postman请求时,它成功了。