George Mauer
George Mauer

Reputation: 122112

Linq2Twitter - What is OAuthToken?

I'm trying to use simple single-user in-memory credentials to connect to my twitter app and do a simple timeline search. I have my consumer secret and key but On the instructions page it also lists a need for an oauth token and access token. What are these? Where do I get them.

Upvotes: 2

Views: 647

Answers (2)

Joe Mayo
Joe Mayo

Reputation: 7513

I've updated that page. Here's the recommended way to use SingleUserAuthorizer:

        var auth = new SingleUserAuthorizer
        {
            Credentials = new SingleUserInMemoryCredentials
            {
                ConsumerKey = ConfigurationManager.AppSettings["twitterConsumerKey"],
                ConsumerSecret = ConfigurationManager.AppSettings["twitterConsumerSecret"],
                TwitterAccessToken = ConfigurationManager.AppSettings["twitterAccessToken"],
                TwitterAccessTokenSecret = ConfigurationManager.AppSettings["twitterAccessTokenSecret"]
            }
        };

Here, you can see that the code populates TwitterAccessToken and TwitterAccessTokenSecret from values in your config file. Visit your app at https://dev.twitter.com to find these keys. Then populate the appSettings (twitterAccessToken and twitterAccessTokenSecret) in your config file with the AccessToken and AccessTokenSecret from your Twitter app page.

Upvotes: 1

Related Questions