New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught exception with message 'Invalid request token' #314

Closed
PHPism opened this Issue Feb 17, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@PHPism

PHPism commented Feb 17, 2015

Hello sir;
Everything was working absolutely fine with the script until some of the users reported this issue while authorization:

Fatal error: Uncaught exception 'Abraham\TwitterOAuth\TwitterOAuthException' with message 'Invalid request token' in \twitteroauth\src\TwitterOAuth.php:141 Stack trace: #0 \twitter_callback.php(41): Abraham\TwitterOAuth\TwitterOAuth->oauth('oauth/access_to...', Array) #1 {main} thrown in \twitteroauth\src\TwitterOAuth.php on line 141
In twitter_callback.php line 41:
$access_token = $connection->oauth("oauth/access_token", array("oauth_verifier" => $_REQUEST['oauth_verifier']));

I noticed that you have updated some files, so I downloaded them and applied them to the website and still the same issue, only "TwitterOAuth.php on line 141" changed it was "TwitterOAuth.php on line 221".
The issue happened to all my working websites at the same time, and no application configuration edits were made.
Thanks for your time.

@abraham

This comment has been minimized.

Owner

abraham commented Feb 17, 2015

So it just started happening recently and only to some users? Is it consistently the same users? Do the users consistently get the error? Do you have multiple servers that could have different characteristics? Is it a timing thing where if you wait 5 seconds from when the user returns from authorizing until actually requesting the access token it starts working?

@PHPism

This comment has been minimized.

PHPism commented Feb 17, 2015

I'm selling my script to many users. I was using it without issues on my script demo and localhost and some of the customers has upgraded to the latest version. All was working fine a few days ago then suddenly all of that stopped working (Demo, localhost, and many customers reported it me). The reports started today and all of these are in different servers.
Demo in Germany, localhost in Egypt, customers mostly hosted in USA.
I wait more than 5 seconds before each try and I tried it with a couple of Twitter users.
Thanks for your time.

@abraham

This comment has been minimized.

Owner

abraham commented Feb 17, 2015

I can't replicate it and I would guess that something changed on Twitter's side. Try posting to https://twittercommunity.com/c/oauth

@abraham abraham closed this Feb 17, 2015

@PHPism

This comment has been minimized.

PHPism commented Feb 19, 2015

I reviewed your documents and hoping that rebuilding the callback.php file will help and it did. :)
I found the issue:
I was using:
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
It should be:
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $request_token['oauth_token'], $request_token['oauth_token_secret']);
Thanks for your time and support. :)

@izotx

This comment has been minimized.

izotx commented Apr 8, 2016

That just started happening to me...
Fatal error: Uncaught exception 'Abraham\TwitterOAuth\TwitterOAuthException' with message 'Request timed out.' in twitteroauth-master/src/TwitterOAuth.php:311

@abraham

This comment has been minimized.

Owner

abraham commented Apr 8, 2016

@izotx please don't post unrelated comments to old issues. Create new issues if you are having issues.

Repository owner locked and limited conversation to collaborators Dec 30, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.