Search code examples
c#apitwitteroauthtwitterizer

Twitterizer - Exception while GetAccessToken()


my twitterizer version is 2.3.3.21964 (donwloaded from nuget).

I have these simple 2 lines on the first Controller action:

token = OAuthUtility.GetRequestToken("XXX", "YYY",
    "http://test.roadevents.it/account/twitter_token",null);
return Redirect("http://twitter.com/oauth/authorize?oauth_token=" + token.Token);

The second controller action (twitter_token) is this:

OAuthTokenResponse token = OAuthUtility.GetAccessToken("XXX", "YYY", 
    oauth_token, oauth_verifier);
ViewBag.twToken = token.Token;

Where oauth_token and oauth_verifier are valorized variables. My code break while getting access token with this exception:

System.ArgumentNullException: value can't be null

System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +12633595 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +224

Twitterizer.TwitterizerException.ParseRateLimitHeaders(WebResponse response) in

C:\Projects\twitterizer-132\Twitterizer2\Exceptions\TwitterizerException.cs:205

I've googled for this problem, and from what I understand it has been solved since version 2.1, but I still have it.

I'm 100% sure my application is set up as web-app.


Solution

  • i read that this is a bug found before. I do not know if it was fixed during the latest release but the accepted workaround at that time was to put a correct callback url in your twitter application on the dev site of twitter.

    I would advise debugging you application to check if all the variables are filled with the correct data. Maybe you find something else which could help us help you ;)