![](/img/trans.png)
[英]Get a 3-Legged Token with Authorization Code Grant gives an Error AUTH-004
[英]Getting a 3-Legged Token with Authorization Code Grant
我目前正在嘗試完成此分步教程,該教程基於使用授權代碼授予獲取 3 腿令牌
這是我的卷曲代碼:
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
筆記:
我認為正在發生的事情是用戶登錄后獲得的代碼具有極短的到期時間。 畢竟, POST /authentication/v1/gettoken
端點意味着在用戶登錄后立即調用。
順便提一句。 我經歷了相同的步驟,因為我花了一段時間用我收到的代碼創建一個 Postman 請求,所以我最終遇到了和你一樣的錯誤。 然后,當我請求另一個代碼並立即重新發送 Postman 請求時,它成功了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.