我正试着用twitterizer让twitter oAuth工作,但我做不到。
我收到以下错误:
The remote server returned an error: (401) Unauthorized。
当我的回调url是本地主机时。
如果我的回调url是oob,那么对于管脚流,它可以正常工作。
下面是我的代码:
public ActionResult LogOn(string returnUrl, bool? perm)
{
string consumerKeyTw = @"UF3F72XqfGShQs7juKMApA";
string consumerSecretTW = "secret";
OAuthTokenResponse requestToken = OAuthUtility.GetRequestToken(consumerKeyTw, consumerSecretTW, "http://localhost:58892/Twitterr/OAuth");
// Direct or instruct the user to the following address:
Uri authorizationUri = OAuthUtility.BuildAuthorizationUri(requestToken.Token);
return new RedirectResult(authorizationUri.ToString(), false);
}当我设置回调url时,我从来没有得到过令牌。我在twitter上注册了我的回调url localhost。
我是不是漏掉了什么?
知道这是怎么回事吗?
发布于 2011-06-07 23:30:33
对于那里的回调地址,请确保使用了错误的地址(如应用程序的主页),然后在运行时指定真实地址。
Web应用程序可以使用基于pin的身份验证,但桌面应用程序不能使用web流。
发布于 2012-08-19 02:55:16
我遇到了同样的问题,并通过在Twitter应用程序设置页面中添加“回调URL”来修复它。我还没有我的域名,所以我简单地添加了一个未使用的域名,比如:http://www.website.com。Twitterizer请求调用立即开始为我工作。
费什
https://stackoverflow.com/questions/6267096
复制相似问题