Hello Everyone,
I have a workaround to this problem, I am using tweetinvi into my project and also stuck into into this problem as well.
First of all sorry for my english.
1.Using Below code to redirect user to twitter:-
var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(ConsumerKey, ConsumerSecret);
var url = CredentialsCreator.GetAuthorizationURLForCallback(applicationCredentials, HttpContext.Current.Request.Url.AbsoluteUri);
//Saving applicationCredentials into session for using them later.
Session["authkey"] = applicationCredentials.AuthorizationKey;
Session["authSecret"] = applicationCredentials.AuthorizationSecret;
Response.Redirect(url);
Arvind
I have a workaround to this problem, I am using tweetinvi into my project and also stuck into into this problem as well.
First of all sorry for my english.
1.Using Below code to redirect user to twitter:-
var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(ConsumerKey, ConsumerSecret);
var url = CredentialsCreator.GetAuthorizationURLForCallback(applicationCredentials, HttpContext.Current.Request.Url.AbsoluteUri);
//Saving applicationCredentials into session for using them later.
Session["authkey"] = applicationCredentials.AuthorizationKey;
Session["authSecret"] = applicationCredentials.AuthorizationSecret;
Response.Redirect(url);
-
Using Below code for getting newcredentials on page load:-
if (Request.QueryString["oauth_verifier"] != null) { var callbackURL = HttpContext.Current.Request.Url.AbsoluteUri; var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(ConsumerKey, ConsumerSecret); //Setting applicationCredentials to the previous one i saved in sessions. applicationCredentials.AuthorizationKey = Session["authkey"].ToString(); applicationCredentials.AuthorizationSecret = Session["authSecret"].ToString(); // Here we provide the entire URL where the user has been redirected var newCredentials = CredentialsCreator.GetCredentialsFromVerifierCode(Request.QueryString["oauth_verifier"].ToString(), applicationCredentials); if (newCredentials != null) { //use your credentials here newCredentials.AccessToken, newCredentials.AccessTokenSecret } }
Arvind