Getting 401 unauthorized error While Generating request_token request


#1

Hi I am attempting to generate a request token by POSTing to https://api.twitter.com/oauth/request_token, but I cannot seem to get any response
other than an http 401 error

My Authorization: header looks like this:

Authorization : OAuth oauth_callback=“https://www.getpostman.com/oauth2/callback",oauth_consumer_key=“XXX”,oauth_nonce=“XXX”,oauth_signature=“XXX”,oauth_signature_method=“HMAC-SHA1”,oauth_timestamp=“XX”,oauth_version="1.0

Anybody have any idea how to get this to work?


#2

Hi @Ravivarma, I deleted your other two duplicate threads.

What language are you using? Is your computer’s clock accurate? (OAuth has a time component)


#3

yes Clock is Accurate and iam getting status as 401 and error
"code": 32,
“message”: "Could not authenticate you."
can you please help me to generate oauth_token


#4

These are my values, which iam passing in Header

Authorization: OAuth oauth_consumer_key=“xxxxxx”, oauth_nonce=“e99383e40bc62c4afd5527e90f051136”, oauth_signature=“9gK924SlSb0k9%2BsLVB2ZNHSaz%2BI%3D”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1472572224”, oauth_version=“1.0”


#5

What language are you coding in - is there a particular reason for not using one of the existing third party libraries that simplify this process for you?


#6

iam direcly using the values from dev account by using TestOauth and trying to generate oauth_token through postman


#7

iam new to this, iam learning about how to get Oauth_token ,iam direcly using the values from dev account by using TestOauth and trying to generate oauth_token through postman


#8

OAuth can be quite tricky, and I don’t generally use Postman although I know some other folks on my team do so. I’d recommend tracing through the steps in the OAuth documentation and checking all of your request headers etc.


#9

Yes thanq, i fallowed all the requried steps, To get access token we have to generate oauth_token i fallowed all the steps and created Signature base string
and signing key but iam getting same error code 32, could not authenticate you.
iam passing redirect url also as header


#10

Can any one help me in Generating Oauth_token and Oauth_secret iam getting status 401 and error message as
{
“errors”: [
{
“code”: 32,
“message”: “Could not authenticate you.”
}
]
}
can any one help me to resolve this error?


#12

I strongly suspect you’re not signing the request correctly.

One thing you could try is running your request through twurl using the -t option to check how the headers and signature are generated there.


#13

Iam following the proccess Implementing Sign in with Twitter https://dev.twitter.com/web/sign-in/implementing and https://dev.twitter.com/oauth/overview/creating-signatures and i created Signature base string and signing key and ihave checked in OAuth signature checker and its showing everything is currect but iam still getting 401 and “message”: “Could not authenticate you.”


#14

can you send me a sample example or a vidio of generating oauth_token and access token using Sign in with twitter method,because i tried lot of times but getting same error 401


#16

Did you try tracing a twurl authorization request already?


#17

Hi AndyPiper Thanq For your Help Now Ihave Generated AccessToken for Twitter


#18

Iwant To Know Some Information From You Regarding Twitter did Webhook or polling Available for twitter?


#19

No.


#20

No Pooling and No webhooks too?


#21

No PoIling?


#22

Correct