我正在尝试在c#中创建一个与Tweeter交互的应用程序......
我做过类似下面的事情。
public void Authorize()
{
TwitterService service = new TwitterService("key","secret");
OAuthRequestToken requestToken = service.GetRequestToken();
var oauthtoken = requestToken.Token;
var oauthsecret = requestToken.TokenSecret;
Uri uri = service.GetAuthorizationUri(requestToken);
AuthorizeCallback(oauthtoken,oauthverifier);
}
public void AuthorizeCallback(string oauth_token, string oauth_verifier)
{
var requestToken = new OAuthRequestToken { Token = oauth_token };
TwitterService service = new TwitterService("key","secret");
OAuthAccessToken accessToken = service.GetAccessToken(requestToken, oauth_verifier);
}
现在我的问题是从哪里可以获得oauth_verifier?
答案 0 :(得分:1)
将这些行放在回调函数的开头。
string OauthToken = Request.QueryString["oauth_token"];
string OauthVerifier = Request.QueryString["oauth_verifier"];