401 Unauthorized even from Test OAuth


I get a 401 even using the test curl string supplied by https://dev.twitter.com/apps/<app_id>/oauth

This was working perfectly up until 2 months ago (this is from callback when user has already clicked ‘Sign In’ in Sign in with Twitter):

$status = $tmhOAuth->request(‘GET’, ‘https://api.twitter.com/’ . ‘oauth/access_token’, array(‘oauth_verifier’=>$_REQUEST[‘oauth_verifier’]));

Now I started getting 401.

I tried switching the url to ‘https://api.twitter.com/1.1/’, but got a 404 instead (go figure!!!).

I also tried changing to POST in both urls. Same result.

I read about creating a new app. Did that. Same result.

I finally used the “Test OAuth” button in https://apps.twitter.com/app/<app_id>/show , used the supplied curl string, and still got 401 !!!

This is the curl string I used for this last test:

curl --get ‘https://api.twitter.com/oauth/access_token/’ --header ‘Authorization: OAuth oauth_consumer_key=“EZv5VabrN8cZQw0iyZwCrQPBx”, oauth_nonce=“a32df7aff124229e15af77cb9cc4bd7b”, oauth_signature=“H%2BPh6Kj1I4hOYd4VfBpnNjwpB5o%3D”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1406140055”, oauth_token="", oauth_version=“1.0”’ --verbose

Result: 401 Unauthorized

Help !!!