Could not authenticate with OAuth



I am using themattharris’ OAuth PHP library (which works perfectly by the way), but I stumbled upon a problem during the OAuth authentication.
When I try to tweet something, I get the following error message;

stdClass Object
[error] => Could not authenticate with OAuth.
[request] => /1/statuses/update.json

I am using the following code to tweet;


require 'tmh/tmhOAuth.php';
require 'tmh/tmhUtilities.php';
$tmhOAuth = new tmhOAuth(array(
'consumer_key' => 'XXXXXXXXXXX',
'consumer_secret' => 'XXXXXXXXXXXXXXXXXXXXXX',
'user_secret' => 'XXXXXXXXXXXXXXXXXXXXXX'));

$code = $tmhOAuth->request('POST', $tmhOAuth->url('1/statuses/update'), array('status' => 'My Twitter Message'));



I copied all tokens, keys & secrets from the My Applications page into the file, but it does not seem to work.

What’s going wrong here? I am almost 100% certain it has nothing to do with the library.

Any help is much appreciated!



… Also facing this. All requests work except status posting.

Signature strings, authentication look exactly as docs specify.

Thanks for the response


The “Could not authenticate with OAuth” error means the oauth_token and oauth_secret are no longer valid. Earlier today we had some similar reports saying the values copied directly from the “Your access token” section of this site were not working.

We’re investigating this at the moment.


I’ve got the same problem. Sending tweet works fine immediately after authenticating. But after a few hours, same error ‘could not authenticate with oauth’ comes up.


Hi, Same problem here, just changed the permission, regenerated the key and it still dosen’t work


Im having the same issue but when using the friendship/create.


Sample problem here too. status/update always fails right after authentication. But it succeeds after the app (iOS) restarted. Please note when this issue fixed.


Having the issue today with a web app that I am working on - is this problem still present?


Since i use Abraham’s twitteroauth, i have no problems. try


I am also having this problem - all other API calls work. Please email me for example of the code


Could you please share with us more details?

  • Which API calls are working, and which are not?
  • What is your access_token scope (R, R&W or R&W+DM)? What about your Application?
  • Ideally, could you share the full HTTP Request & Result (Headers + Body)?


I have got it working - I was not putting the status param in the extra_params in the auth header.

Sorry for wasting anyone’s time.


I’m still having the same problem…here is the query generated from my code


the only weird thing I can notice in the url is the “)” in your “status” GET parameter. everything else seems fine.


It seems, that I have the very same problem.

I’m using Twitterizer .NET library for posting tweets within a web-site into my twitter account. It works just fine on site, running on my local server (authenticates with OAuth through twitter app and posts a tweet). But when I’m trying to post a tweet on production server, Twitterizer says: “Result = Unauthorized. ErrorMessage = Could not authenticate with OAuth.”

I double checked consumer keys, also tried to reset the keys, create another app and try again - same result.

Twitter application has read/write access to my twitter account and is not blocked. This problem appeared suddenly on 08/12 after a period of successful working for about a month, when tweets were posted every hour or so.


2 days ago, my app works fine, but today, I have same error : “Could not authenticate you” :frowning:


Why the application does a redirect to my site without any options?


Have you changed something in your app?


Make sure that you haven’t accidentally invalidated your access tokens. You can invalidate an access token by:

  • Hitting the “No Thanks” button on the oauth/authorize or oauth/authenticate pages
  • Revoking access from
  • Regenerating your access token on
  • Upgrading the permission level of an already authorized user and application combo. All previous strings/access tokens are then invalidated.


Bump. Get the same error.