2016-11-15 63 views
0

我試圖讓一個2條腿的令牌喜歡這裏顯示:https://developer.autodesk.com/en/docs/oauth/v2/tutorials/get-2-legged-token/捲曲與Autodesk Forge的2條腿令牌失敗(AUTH-008)

這是我在Cygwin的輸入(即ID和祕密從例子中的那些,但我用我自己的ID和密碼):

curl -v 'https://developer.api.autodesk.com/authentication/v1/authenticate' -X 'POST' -H 'Content-Type: application/x-www-form-urlencoded' -d ' client_id=obQDn8P0GanGFQha4ngKKVWcxwyvFAGE& client_secret=eUruM8HRyc7BAQ1e& grant_type=client_credentials& scope=data:read' 

,但我得到:

< HTTP/1.1 400 Bad Request 
< Content-Type: application/json 
< Date: Tue, 15 Nov 2016 10:06:09 GMT 
* Server Apigee Router is not blacklisted 
< Server: Apigee Router 
< Content-Length: 231 
< Connection: keep-alive 
< 
* STATE: PERFORM => DONE handle 0x600057550; line 1965 (connection #0) 
* multi_done 
* Curl_http_done: called premature == 0 
* Connection #0 to host developer.api.autodesk.com left intact 
{"developerMessage":"The required parameter(s) client_id,client_secret,grant_type not present in the request","userMessage":"","errorCode":"AUTH-008","more info":"http://developer.api.autodesk.com/documentation/v1/errors/AUTH-008"} 

這怎麼可能有一個從我花了一個例子缺少參數從網站?

回答

1

每個有經驗的程序員都知道,對錯誤發生的方式數量沒有任何限制。

在這種情況下,我們在指定範圍之前在數據中看到一個空格。

難道這是原因嗎?

在客戶端ID前面還有另一個領先空間。

也許這被忽視。

這裏的正是你所試圖達到什麼樣的工作示例:

http://thebuildingcoder.typepad.com/blog/2016/10/forge-intro-formats-webinars-and-fusion-360-client-api.html#3

+0

它的工作原理,看起來像我有更多的空間存在。我不知道它對空白區域很敏感。爲什麼他們不用空格修飾或標記化? – shinzou