0

I am using C3 & the latest twitterizer api. I have managed to get the user to authenticate & authorize my twitter application after which I persist only the access_token, access_token_secret and access_token_verifier.

The problem I have now is that when the user returns ( at a later stage, cookies removed / expired ), they identify themselves using our own credentials system, and then I attempt to see if their twitter credentials are still valid. I do this by calling the following method

OAuthTokens t = new OAuthTokens();
t.ConsumerKey = "XXX"; // my applications key
t.ConsumerSecret = "XXX";// my applications secret
t.AccessToken = "XXX";// the users token from the DB
t.AccessTokenSecret = "XXX";//the users secret from the DB

TwitterResponse<TwitterUser> resp = TwitterAccount.VerifyCredentials(tokens);

This is the error I get : "error":"Could not authenticate with OAuth.","request":"/1/account/verify_credentials.json"

I know my tokens are valid because if I call this method :

TwitterResponse<TwitterUser> showUserResponse = TwitterUser.Show(tokens, CORRECT_SCREEN_NAME_HERE);

with my screen name passed in and the same OAuth tokens, it returns correctly.

Any Ideas?

C# -> v4.0.30319
Twitterizer -> 2.4.0.2028

Mark Redfern
  • 357
  • 1
  • 3
  • 24

1 Answers1

0

In your code, you're defining tokens as t, but when you call VerifyCredentials you're passing it tokens. Is that just an error in your sample code?

Ricky Smith
  • 2,379
  • 1
  • 13
  • 29
  • yes sorry about that ( and sorry i only saw your response now, where has the year gone ? ). I have moved away / parked this, but would still be interested to get the solution as I'm gonna get sent back here sooner or later :( – Mark Redfern Dec 07 '12 at 09:27