Hello,
trying the code in the documentation for "URL Redirect Authorization", isn't working.
I made a debug and check that when calling:
var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(consumerKey, consumerSecret);
I see that applicationCredentails is null, therefore the rest of the code works with a null value. Can you help me fix this?
I'm using the last version of tweetinvi (9.8.2), working in Visual Studio 2012 with Framework 4.5. The URL of my application is 127.0.0.1 (localhost but in IP form so Twitter accept it).
Here is the code in the documentation, I'm gettng "null" from applicationCredentials.
// Store the application-only credentials into a variable
var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(consumerKey, consumerSecret);
// Get the URL that the user needs to visit to accept your application
var url = CredentialsCreator.GetAuthorizationURLForCallback(applicationCredentials, "https://mywebsite.com/twitter_auth");
/ The callbackURL parameter is the entire URL that your controller received
// The URL will be parsed and used to generate the user credentials.
var newCredentials = CredentialsCreator.GetCredentialsFromCallbackURL(callbackURL, applicationCredentials);
Comments: ** Comment from web user: linvi **
trying the code in the documentation for "URL Redirect Authorization", isn't working.
I made a debug and check that when calling:
var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(consumerKey, consumerSecret);
I see that applicationCredentails is null, therefore the rest of the code works with a null value. Can you help me fix this?
I'm using the last version of tweetinvi (9.8.2), working in Visual Studio 2012 with Framework 4.5. The URL of my application is 127.0.0.1 (localhost but in IP form so Twitter accept it).
Here is the code in the documentation, I'm gettng "null" from applicationCredentials.
// Store the application-only credentials into a variable
var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(consumerKey, consumerSecret);
// Get the URL that the user needs to visit to accept your application
var url = CredentialsCreator.GetAuthorizationURLForCallback(applicationCredentials, "https://mywebsite.com/twitter_auth");
/ The callbackURL parameter is the entire URL that your controller received
// The URL will be parsed and used to generate the user credentials.
var newCredentials = CredentialsCreator.GetCredentialsFromCallbackURL(callbackURL, applicationCredentials);
Comments: ** Comment from web user: linvi **
Good,
Just to let you know I have checked in the new Examplinvi.Web project in Tweetinvi 0.9.9.x.
If you check the HomeController, you will find 2 routes called `TwitterAuth` and `ValidateTwitterAuth`.
I hope you will agree with me that the code is way easier than it was before. I have been working on these improvements for over a week now.
Please check it out and maybe, you will be able to directly reuse the example project for your demo.