This project has moved. For the latest updates, please go here.

How to work with cached credentials

May 25, 2010 at 3:00 AM

I am using the xmltokenmanager to store/retrieve credentials I have already received.  How do I use the credentials I already have.  I see not method where I can set the tokensecret or even the username.  Help, I am pretty clueless, this is for a web mvc app.

May 25, 2010 at 6:02 PM

Is this for username/password authorization or OAuth? (Hopefully OAuth since username/password will be dead next month)

I can't find an XmlTokenManager anywhere in the source code for LinqToTwitter, so I don't know where you're getting that either.

Assuming however that you have a correct implementation of ITokenManager that you're using, your responsibility as an app is to store the relationship between a user account that you keep track of and the AccessToken itself.  Then you just pass the access token in with your Twitter calls and LinqToTwitter will automatically use your ITokenManager to fetch the token secret and the other details it needs to authorize your request.  In short, reusing an existing token is exactly the same as using the token when you originally get it.  But it's your app's responsibility to remember which access token to use for a given user.