Getting access token/secret returns 401 error the first time only


Hi, I have a desktop app that uses oob callback. After getting the PIN verifier, the request for access token/secret always fail the first time, returning with a 401 error. However, if I start over again from getting request token, then access token/secret request will succeed. I’m not using Twitter libraries, and making the calls directly in C++.

Here’s the example header in my request:
Authorization: OAuth oauth_consumer_key=“XXX”,oauth_nonce=“5634050683455406263”,oauth_signature_method=“HMAC-SHA1”,oauth_timestamp=“1311779647”,oauth_token=“XXX”,oauth_verifier=“2559680”,oauth_version=“1.0”,oauth_signature=“CVcCM3nTHK0O8J2yZeEPf7E%2BoAI%3D”

I don’t think this is an error with the signature or the header, since subsequent tries succeed. It’s also hard to replicate for me to test and debug, since subsequent tries succeed. Has anyone encounter a similar issue?


additional info: my OAuth URL all contain the api subdomain, and they are https (eg.


Any luck with this? I’m having similar issues.


nope, i’m trying to see if delaying the access token request for some time (10 seconds?) will help.


Took me some 3 hours to find it out! Phew!


how to i get access token secret? pls any one give me the answer for this.


the access token secret is returned along with the access token in response to a successful request to oauth/access_token. The token is in the oauth_token parameter while the secret is in the oauth_token_secret parameter.


Hi, I am having the similar issue now, how did you get this resolved ?