2

I am using TweetSharp Api and I have some problems concerning the service.GetRequestToken().

here's my code:-

TwitterService service = new TwitterService("######", "######");
OAuthRequestToken requestToken = service.GetRequestToken();
 Uri uri = service.GetAuthorizationUri(requestToken);
        Process.Start(uri.ToString());

The problem is that when I'm redirected to the Twitter authorization window this message is come :-

Whoa there!
The request token for this page is invalid. It may have already been used, or expired because it is too old. Please go back to the site or application that sent you here and try again; it was probably just a mistake.

the uri is like :

https://api.twitter.com/oauth/authorize?oauth_token=?

any help ?

thanks in advance.

user2728312
  • 39
  • 1
  • 7

3 Answers3

2

I faced the same issue and I resolved the issue just unchecking the following line in twitter application settings

Enable Callback Locking (It is recommended to enable callback locking to ensure apps cannot overwrite the callback url)

This checkbox is under the Callback URL text box in the application setting tab

I don't know why Twitter team recommended it , if it's making trouble for some people . If any one know the reason of recommendation kindly let us know . Thanks

Mani
  • 2,391
  • 5
  • 37
  • 81
0

Did you correctly register your application in apps.twitter.com ? Your code work fine with my consumer secret/key and TweetSharp 2.3.1.

mmetesreau
  • 46
  • 5
  • Yes , I'm sure I did . – user2728312 Mar 04 '14 at 17:26
  • Ok. Did you provide a callback url in the application settings? I was able to reproduct your problem when I don't provide this information. There is a possible duplicate with this [thread](http://stackoverflow.com/questions/6333864/tweetsharp-authorization-renders-no-oauth-token?rq=1) – mmetesreau Mar 05 '14 at 15:34
  • I checked my callback url and I wrote correct callback url then fixed my problem. Thanks @MiKaDo_O – daylight Dec 12 '17 at 08:59
0

An other thing you can try is to regenerate the API-keys and use them instead. They give that as an option too

'It may have already been used, or expired because it is too old.'

Yosoyke
  • 485
  • 3
  • 12