401 Unauthorized, Code 32, verify_credentials.json


#1

Hi,

Our company just started integrating our Enquiry Services with Twitter. Our goal is simple: Get data from our user’s social network site to auto-fill up our enquiry form. I’m having trouble with verify_credentials. It always returns {“errors”:[{“message”:“Could not authenticate you”,“code”:32}]}

Here is a sample of my request:

https://api.twitter.com/1.1/account/verify_credentials.json?oauth_consumer_key=[consumer_key]&oauth_nonce=9362502&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1370510455&oauth_token=[user_access_token]&oauth_version=1.0&oauth_signature=4mtkE5Hc6KeVlrn0+XHo4NnM3rY=

signature format is:

GET&https%3A%2F%2Fapi.twitter.com%2F1.1%2Faccount%2Fverify_credentials.json&oauth_consumer_key%3D[consumer_key]%26oauth_nonce%3D9362502%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1370510455%26oauth_token%3D[user_access_token]%26oauth_version%3D1.0

hmacsha1 key format is:

[consumer_secret]&[user_access_token_secret]

I’m currently using ASP.NET 2.0 using the approach from this blog (with modifications):
http://www.dotnetbull.com/2013/05/login-with-twitter-using-oauth.html

Calls to request_token, authorize and access_token url are working fine.

Please help me out with this problem ASAP. Thank you very much

JAN


#2

At least one issue is that you’re not URL encoding your signature: “4mtkE5Hc6KeVlrn0+XHo4NnM3rY=” contains a ‘+’ and a ‘=’ which have special meaning when used in URL querystrings.


#3

Thanks for solution. I did not notice that. It’s working now. The reason the previous requests work because when I did POST requests, the signature was encoded. Thank you very much.


#4

i’m sorry, i’m getting the same error. I use this guide to fix this problem but nothing. http://www.nextscripts.com/setup-installation-twitter-social-networks-auto-poster-wordpress/.

I receive always the same error:
Testing …

Array
(
[pgID] =>
[isPosted] => 0
[pDate] => 2013-09-13 21:04:49
[Error] => Resp: {“errors”:[{“message”:“Could not authenticate you”,“code”:32}]}| Error: | MSG: Test Post from professioneseo.it - 93
)
Array ( [pgID] => [isPosted] => 0 [pDate] => 2013-09-13 21:04:49 [Error] => Resp: {“errors”:[{“message”:“Could not authenticate you”,“code”:32}]}| Error: | MSG: Test Post from professioneseo.it - 93 )