Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

Commented Unassigned: URL Redirect Authorization returning null [2618]

$
0
0
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 **

Hi,

You need to store the application credentials in a database; session variable or static value.
The reason is that a verifier information are created and you need these in order to continue the processing after the URL redirect.

The reason is that after the redirect the value are lost as the ThreadPool is starting a new thread to handle the redirect webrequest.

In Tweetinvi 0.9.9.x I am going to work on a mechanism to simplify these steps. I am not sure yet how I am going to do this.

Let me know if this makes sense.
Linvi


Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>