I'm trying to integrate a client's web-site w/ Twitter using twitterizer. I mistakenly started off using an old version of the library and then updated to the new version (2.3.2) and a lot changed.
My first problem is that GetAccessToken takes more parameters now but I can't find any documentation for these parameters: requestToken and Verifier. Can somebody please point me in the right direction?
Here is the code I'm trying to make work:
string ConsumerKey = System.Configuration.ConfigurationManager.AppSettings["ConsumerKey"];
string ConsumerSecret = System.Configuration.ConfigurationManager.AppSettings["ConsumerSecret"];
OAuthTokenResponse responseToken = OAuthUtility.GetAccessToken(ConsumerKey, ConsumerSecret,);
//Cache the UserId
System.Web.HttpContext.Current.Session["GetCachedUserId"] = responseToken.UserId;
OAuthTokens accessToken = new OAuthTokens();
accessToken.AccessToken = responseToken.Token;
accessToken.AccessTokenSecret = responseToken.TokenSecret;
accessToken.ConsumerKey = ConsumerKey;
accessToken.ConsumerSecret = ConsumerSecret;
System.Web.HttpContext.Current.Session["TwitterAccessToken"] = responseToken.Token;
System.Web.HttpContext.Current.Session["TwitterAccessTokenSecret"] = responseToken.TokenSecret;
System.Web.HttpContext.Current.Session["AccessToken"] = accessToken;
TIA
Sorry I don't know how twitterizer works as I'd never used an OAuth library. But written one... Hope this can help you on understanding what requestToken and Verifier is:
Twitter's developer site has a simple tutorial on what needs to be send and received for authorization using OAuth. You might want to check on that first for how the process works http://dev.twitter.com/pages/auth
"Access token" is the second part of OAuth, verifier token comes before this request. Here is the process as simple as it can be:
Get an one time working oauth_token from Twitter (https://api.twitter.com/oauth/request_token)
Use the incoming token for building an url, letting user to accept/deny application. (https://api.twitter.com/oauth/access_token?oauth_token=the_incoming_token)
Twitter gives us two new tokens, one ouath_token and oauth_verifier. With these two, we ask twitter for application authorization. (https://api.twitter.com/oauth/authorize)
If successful twitter gives back two new tokens, oauth_token and oauth_token_secret. These two needs to be saved or stored, as they will be used on every request we make to twitter.