I am having the same issues not sure why I never get the token back. here is the code i am using. Can someone help please?
public class HomeController : Controller
{
private string consumerKey = System.Configuration.ConfigurationManager.AppSettings.Get(“ConsumerKey”);
private string consumerSecret = System.Configuration.ConfigurationManager.AppSettings.Get(“ConsumerSecret”);
public ActionResult Index()
{
ViewBag.Message = "Welcome";
return View();
}
[HttpPost]
public ActionResult Auth()
{
TwitterService twitterService = new TwitterService(
consumerKey, consumerSecret);
OAuthRequestToken authRequestToken = twitterService.GetRequestToken(http://127.0.0.1:48293/Home/AuthorizeCallback");
Uri uri = twitterService.GetAuthenticationUrl(authRequestToken);
return Redirect(uri.ToString());
}
[HttpPost]
public ActionResult AuthorizeCallback(string authToken, string auth_Verifier)
{
var authRequestToken = new OAuthRequestToken { Token = authToken };
TwitterService twitterService = new TwitterService(consumerKey, consumerSecret);
OAuthAccessToken authAccessToken = twitterService.GetAccessToken(authRequestToken, auth_Verifier);
twitterService.AuthenticateWith(authAccessToken.Token, authAccessToken.TokenSecret);
TwitterUser twitterUser = twitterService.VerifyCredentials();
ViewBag.Message = string.Format("Your username is {0}", twitterUser.ScreenName);
return View();
}