Oauth endpoint /request_token stopped working all of a sudden


#1

Hi,

I recently started receiving reports that a library I made for Twitter oauth had stopped working. I had personally verified that it was working around 20 days ago, but now when I try it (same code) it fails with an error code 32.

Here is the GitHub issue with a lot more detail:

The authorization header produced with the library works fine with Postman for Chrome, but yet it fails with AngularJS. Did anything change in the API over the past few weeks that might prevent AngularJS from working correctly?

Thanks,


#2

We are having the same problem here.


#3

I’m glad I’m not alone.

Are you using AngularJS as well or something else?


#4

We are using Go lang to do that, and it is returning the same error.


#5

I’m glad it isn’t just an AngularJS thing then :smile:

Do we know if anyone from the Twitter development team watches this forum?


#6

If you set ‘oauth_callback’ key first, try to change the order of keys.

OAuth oauth_callback=“http://hogehoge.com/”,
oauth_nonce=“USO3ASAMPLE”,

401 Authorization Required error code=“32” Could not authenticate you.

:

OAuth oauth_nonce=“USO3ASAMPLE”,
oauth_callback=“http://hogehoge.com/”,

200 OK.


#7

We found the problem, try to encode the URL. It works for us!


#8

I updated the code and now every URL is being encoded however the problem still exists. Hard to believe it worked perfectly for months and then all of a sudden it stopped.

Any other ideas?


#9

@andersonarcenio, although your solution wasn’t what I was looking for it did make me think. I was passing the oauth_callback as a query param, not body param. After having made that switch it started working again.

I’m not sure why it was working months ago. Maybe Twitter realized there was a bug and corrected it. I don’t know. It is working now though.

Thanks for everyones input!


#10

Hi @nraboy could you please post the solution in code?


#11

Please see the following highlighted lines in my GitHub repo:

https://github.com/nraboy/ng-cordova-oauth/blob/master/ng-cordova-oauth.js#L533-L541

Regards,


#12

Weird. If updated the library but i’m still getting exact the same error.


#13

Which library are you using?


#14

Me too. It works perfectly last few weeks. But this week, it won’t work anymore. kept giving me code 32 -Could not authenticate you.

Any alternative or it? I’m using ionic framework, ngCordova.


#15

Sorry my mistake. Its working now. I used a wrong api secret key from twitter.