Error code 32 error


#1

Hi Everyone,

I am facing a problem form twitter that replies the following error back to me.

“errors”:[{“code”:32,“message”:“Could not authenticate you.”}]

I had done the TLS protocol for my embedded device and send out the following HTTP POST format with authorization header to twitter API.

POST https://api.twitter.com/oauth/request_token HTTP/1.1
Date: Fri,11 Sep 2015 14:18:30 GMT
Host: api.twitter.com
Authorization: OAuth oauth_nonce=“6098fbe23703a9a4640714c740ee9e8e”,oauth_callback=“oob”, ,oauth_consumer_key=“sPkn7WUjR0eZvYWAtkQZgaGm1”,oauth_signature=“QYGszw9SQ9B%2Fmlbamlkmqjumksc%3D”,oauth_signature_method=“HMAC-SHA1”,oauth_timestamp=“1441952214”,oauth_version="1.0"
Content-Length:0
Content-Type: application/x-www-form-urlencoded

Is the problem related to the time that I provided to the server? Or the format that I post to twitter is wrong?

Please help me on this.

Thanks,


#2

Try add oauth_callback to body of POST request.


#3

Hi SalenkoDmitry

Thanks for your suggestion.

However, even I put it on the body. It is still came with the same result. :frowning:

POST https://api.twitter.com/oauth/request_token HTTP/1.1
Date: Fri,11 Sep 2015 16:24:30 GMT
Host: api.twitter.com
Authorization: OAuth oauth_nonce=“edb48f20a8924a3afbb136f3654400d1”,oauth_consumer_key=“sPkn7WUjR0eZvYWAtkQZgaGm1”,oauth_signature=“ahwZTJYJ%2FlQwWI1ZVo32Net79ko%3D”,oauth_signature_method=“HMAC-SHA1”,oauth_timestamp=“1441959773”,oauth_version="1.0"
Content-Length:22
Content-Type: application/x-www-form-urlencoded

{oauth_callback=“oob”}


#4
  1. Maybe its feature of http traffic viewer, but {oauth_callback=“oob”} should not contain {} and “”, e.g. oauth_callback=oob.
  2. Why there is no oauth_callback in authorization header?

#5

Hi SalenkoDmitry,

I tried your method but it still didn’t work.

Actually, the nonce, timestamp & signature was made by the twitter oauth generator. Thus, I think the time difference causes the authorization failed.

Thanks for your help. :smile:


#6

Hi everyone,

I had some further question on this issue.

Currently, I’m still suffering on this “Error 32” problem.

I had followed the methods that Salenko advice me and I had used almost 2 weeks to create my codes for nonce, timestamp & signature to allow the oauth could pass me through to the next stage. (This is because im using Embedded C for my project to communicate with Twitter)

Please anyone could advice me how to solve this issue?

Please refer the following method that I had used to POST to twitter.

POST https://api.twitter.com/oauth/request_token HTTP/1.1
Date: Thu,2015 Sep 24 07:01:51 GMT
Host: api.twitter.com
Authorization: OAuth oauth_nonce=“XXX”,oauth_callback=“oob”,oauth_signature_method=“HMAC-SHA1”,oauth_timestamp=“XX”,oauth_consumer_key=“XX”,oauth_signature=“XX”,oauth_version="1.0"
Content-Length:18
Content-Type: application/x-www-form-urlencoded

oauth_callback=oob

Further information:
Date: Get from NTP server (UTC time) & modify to this standard

nonce: Create a 32 byte characters that only contain Alphabets and numbers then encoded into base64 and removed the “=” sign. The total size is 42 bytes after base64 has been encoded

Consumer Key: Get from the twitter app

timestamp: Subtract the current time with 1970-1-1 0:0:0 time

Signature: HMAC-SHA1 the base string with the consumer secret only.

Please help me on this issue. Thanks,


#7

I recommend taking the values you are using and going through this OAuth testing tool step by step to make sure you are building the signature correctly.


#8

Hi Abraham,

Firstly, thank you for your helped. I followed the Oauth Testing tool as you provided to me and I had checked that the Oauth signature is correct right now.

However, the error 32 is still coming out.

Will there be any other problem from the HTTP post format?

Please help. Thanks,


#9

Hi everyone,

Could anyone provide further support on this issue?

Please check the following information:

POST /oauth/request_token HTTP/1.1
Host: api.twitter.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
Authorization: OAuth oauth_callback=“oob”, oauth_consumer_key=“sPkn7WUjR0eZvYWAtkQZgaGm1”, oauth_nonce=“STJ6aW1lNmZNYk1ZaTJFblRpdVB2NlltSTJQSVhxUWY”, oauth_signature=“I1sR4Y1wZFN5n99grLVHC5HBLmY%3D”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1446792536”, oauth_version=“1.0”

Please help with thanks,