Aug 14, 2013 at 4:42 PM
Edited Aug 14, 2013 at 4:44 PM
I'm writing an app to post on a users' behalf from a windows service. The user authorizes the application on a web-based flow elsewhere, their access token and secret are stored for later use.
I'm using a SingleUserAuthorizer (below), but it seems that it is having trouble either signing the request or associating the request to a user. I get 401 - Could not authenticate you (32) errors every time I call equivalent of /account/verify_credentials.json?skip_status=true
The kicker is that it was working; and now has a 100% failure rate with no code changes.
During debugging I've tried various values for my access token/secret and have regenerated both my client credentials and access token/secret. I've also tried with various previously known-good user tokens as well as generated new ones through other methods.
Any direction would be greatly appreciated. (snippets below).
var auth = new SingleUserAuthorizer()
Credentials = new SingleUserInMemoryCredentials()
ConsumerKey = _consumerKey,
ConsumerSecret = _consumerSecret,
TwitterAccessToken = twitterAccessToken,
OAuthToken = twitterAccessToken, // added during debugging
AccessToken = twitterAccessSecret, // added during debugging
TwitterAccessTokenSecret = twitterAccessSecret,
UserId = userId // added during debugging
var auth = GetAuthorizer(tokens.AccessToken, tokens.AccessTokenSecret, tokens.UserId.ToString());
var context = new TwitterContext(auth);
context.Log = Console.Out;
var account = context.Account
.Where(t => t.Type == AccountType.VerifyCredentials)
.FirstOrDefault(t => t.SkipStatus == true);