Authentication error


#1

Token request is invalid for this page. Already been used or is too old may have expired. Back to the site or application you sent us here, and try again, it was probably a mistake.

my code

        TwitterService service = new TwitterService(consumerKey, consumerSecret);
        OAuthRequestToken RequestToken = service.GetRequestToken("http://localhost:1579/AuthorizaCallback.aspx");
        Uri uri = service.GetAuthenticationUrl(RequestToken);
        Response.Redirect(uri.ToString());

when you receive the error, erased and re-key the throughput of the application before, but the result did not change
What is the error ?


#2

I would imagine that your “get request token” step isn’t succeeding and you aren’t checking the response value before you send the user along to the authentication URL. When you arrive there, is there a oauth_token query parameter populated with key part of the value you got from the request token step?


#3

do not link directly sending you get the keys from the web.config
(consumerKey, consumerSecret)

I get this way, but it remains on the data from twitter
if (Request.QueryString[“oauth_token”] != null && Request.QueryString[“oauth_verifier”] != null)
{
OAuthRequestToken RequestToken = new OAuthRequestToken();
RequestToken.Token = Request.QueryString[“oauth_token”];
string a = Request.QueryString[“oauth_verifier”];

                    TwitterService service = new TwitterService(consumerKey, consumerSecret);
                    OAuthAccessToken AccessToken = service.GetAccessToken(RequestToken, a);

                    service.AuthenticateWith(AccessToken.Token, AccessToken.TokenSecret);
                    TwitterUser user = service.VerifyCredentials(new VerifyCredentialsOptions());

#4

TwitterService service = new TwitterService(consumerKey, consumerSecret);
OAuthRequestToken RequestToken = service.GetRequestToken(“http://localhost:1579/AuthorizaCallback.aspx”);
Uri uri = service.GetAuthenticationUrl(RequestToken);
Response.Redirect(uri.ToString());

uri is null value link

{https://api.twitter.com/oauth/authenticate?oauth_token=?}