I’m trying to store Twitter access token to my database for a specific user, so he doesn’t need to approve the application every time he wants to post a new tweet.
I can easily get user access token using Twitterizer, and what I get is OAuthTokenResponse object. It consists of several properties, but for each request (eg. posting a tweet) it asks for OAuthTokenResponse object, so it looks like its not enough to store the Token property only?
What’s the best way to store this AccessToken? Thanks!
You should store the 4 properties returned by the
OAuthUtility.GetAccessTokenmethod in your database. All authorized API calls require an OAuthTokens object. All you need to do is instantiate a new object, set the properties to the values you have (consumer token and access token), then pass your instance to the method.For example:
Or, if you’re using VB.NET: