Twitter authorize in asp.net mvc not work using Tweetsharp
public ActionResult Authorize()
{
// Step 1 - Retrieve an OAuth Request Token
TwitterService service = new
TwitterService(Globals.CONSUMER_KEY, Globals.CONSUMER_SECRET);
// This is the registered callback URL
OAuthRequestToken requestToken =
service.GetRequestToken("http://localhost:52707/AuthorizeCallback");
// Step 2 - Redirect to the OAuth Authorization URL
Uri uri =
service.GetAuthorizationUri(requestToken,"http://localhost:52707/AuthorizeCallback");
return new RedirectResult(uri.ToString(), false /*permanent*/);
}
I am using this code to get accesstoken of user which is logged-in in
asp.net mvc 4 app. I don't get it worked.
The code is documented at https://github.com/danielcrenna/tweetsharp.
When I try this code I got seen this
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
I have check that my consumer_key and consumer_secret are same as on
dev.twitter.com Somebody please guide me how to fix this.
No comments:
Post a Comment