我正在使用 Trello 的 Developer API 的 OAuth 实现来将内容发布到列表中。
我已成功发出请求并从 https://trello.com/1/OAuthGetRequestToken 取回了我的 oauth_token
和 oauth_token_secret
但是当我调用 https://trello.com/1/OAuthAuthorizeToken ,传递我刚刚收到的 oauth_token
,我收到“找不到应用程序”的响应。
有人能帮忙吗?
编辑:这是我从 https://trello.com/1/OAuthGetRequestToken 返回的内容
oauth_token=8d0e43fd0cc67726567d49ae5e818852&oauth_token_secret=[secret]
这是我发送的授权 header (在 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 请求生成时间戳和签名。
最佳答案
看起来可能是 trello 的问题... 这个用户,听错了 key 。 你 100% 确定 key 是正确的吗? Getting "App not found" from Trello Authentication
关于c# - Trello API OAuth 找不到我的应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26594474/