我正在尝试使用 twitterizer 进行 twitter oAuth,但我做不到。
我收到以下错误:
The remote server returned an error: (401) Unauthorized
.
当我的回调 url 是本地主机时。
如果我的回调 url 是 oob,则对于 pin 流,它可以正常工作。
这是我的代码:
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。
我错过了什么吗?
知道发生了什么吗?