Oauth endpoint /request_token stopped working all of a sudden



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?



We are having the same problem here.


I’m glad I’m not alone.

Are you using AngularJS as well or something else?


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


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?


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

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

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


OAuth oauth_nonce=“USO3ASAMPLE”,

200 OK.


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


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?


@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!


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


Please see the following highlighted lines in my GitHub repo:




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


Which library are you using?


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.


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