我正在使用Trello的開發人員API的OAuth實現將內容發佈到列表。Trello API OAuth找不到我的應用
我已經成功地做了一個請求,並得到了我的oauth_token
和oauth_token_secret
回從https://trello.com/1/OAuthGetRequestToken
但是,當我打電話https://trello.com/1/OAuthAuthorizeToken,路過我剛剛收到oauth_token
,我得到的迴應「找不到應用程式」 。
任何人都可以幫忙嗎?
編輯:這裏就是我從https://trello.com/1/OAuthGetRequestToken
oauth_token=8d0e43fd0cc67726567d49ae5e818852&oauth_token_secret=[secret]
取回而這裏的Authorization頭我送(逃脫在C#)
"OAuth oauth_version=\"1.0\", oauth_signature_method=\"HMAC-SHA1\", oauth_nonce=\"8335006\", oauth_timestamp=\"1414663625\", oauth_consumer_key=\"9612eaca23c7bdd3eca60dc8c2a8159c\", oauth_signature=\"M6sLyyfHGYXOtQnLJexDx96kbFo=\", oauth_token=\"8d0e43fd0cc67726567d49ae5e818852\""
上午我做錯了什麼或者這是Trello的錯誤?
編輯:我使用RestSharp調用Trello API,如下:
var client = new RestSharp.RestClient("https://trello.com/");
var request = new RestSharp.RestRequest("1/OAuthAuthorizeToken", Method.GET);
編輯:下面是完整的RestSharp代碼:
var client = new RestSharp.RestClient("https://trello.com/");
var request = new RestSharp.RestRequest("1/OAuthAuthorizeToken", Method.GET);
Uri uri = new Uri(string.Format("{0}/{1}", client.BaseUrl, request.Resource));
string authHeader = GenerateAuthorizationHeader(uri);
//This is the output of GenerateAuthorizationHeader()
//string authHeader = "OAuth oauth_version=\"1.0\", oauth_signature_method=\"HMAC-SHA1\", oauth_nonce=\"8335006\", oauth_timestamp=\"1414663625\", oauth_consumer_key=\"9612eaca23c7bdd3eca60dc8c2a8159c\", oauth_signature=\"M6sLyyfHGYXOtQnLJexDx96kbFo=\", oauth_token=\"8d0e43fd0cc67726567d49ae5e818852\"";
request.AddHeader("Authorization", authHeader);
GenerateAuthorizationHeader方法使用OAuth.OAuthBase
爲OAuth請求生成時間戳和簽名。
您可以分享您使用哪種C#組件與Trello API進行通信。 – 2014-11-04 06:45:10
@LouisLewis我剛剛更新了問題以表明我正在使用RestSharp,並給出了我正在使用的代碼。 – martinthebeardy 2014-11-04 10:09:33
嗨馬丁,謝謝你補充說,圖片現在變得更清晰一點。您的代碼中有一部分我沒有看到,您如何試圖在RestSharp上使用授權標頭?你能不能分享一下你把這段代碼拉出來的「代碼塊」。我正在問這個問題的原因是,因爲有了RestSharp,它可以幫助驗證令牌。看到「代碼塊」將允許用戶看到「整個」圖片並相應地爲您提供幫助。 – 2014-11-04 19:39:43