This morning I configured twitter signin module correctly.

If an anonimous user tried to signin with his twitter account, all was work correctly, but his username was "_1".
I have another site where usernames of users who signin with their twitter account are their twitter account name.

It seems the configuration is the same in both sites, but I try to reconfigure my first site. Now, when a user (or an anonimous user) try to signin with his twitter account, site says "Invalid Twitter OAuth request".

In configuration all seems to be ok,

I have tried to reinstall both twitter and twitter signin modules but error persists...what could be done??

Members fund testing for the Drupal project. Drupal Association Learn more


juampynr’s picture

Status: Active » Fixed

This happens when you do not set a callback at your Twitter application at

Check for further details.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

botanic_spark’s picture

Version: 7.x-5.4 » 7.x-5.6
Component: Twitter Signin » Twitter API
Category: bug » support
Status: Closed (fixed) » Active

Hello guys.
My scenario:
I try to connect authenticated twitter account. I approve application, and then i am redirected to my site where i receive message "Invalid Twitter OAuth request".
In dblog i have this error:

exception 'TwitterException' with message 'Unauthorized' in /home/www...

I started receiving this message today. Before today, everything was working fine.
I have set callback url on my twitter application, keys are also set.
Any suggestions?


svabael’s picture

There is a change on the twitter api

botanic_spark’s picture

Hi. I created a patch based on the API change about passing oauth_verifier to to oauth/access_token. Check it out.

tassoman’s picture

Status: Active » Needs review

I had the same issue on a development website. After applied #5 patch worked flawless but patch wasn't automated tested yet.

BrightBold’s picture

Status: Needs review » Active

The patch in #5 solved the problem for me, thanks.

eromba’s picture

Status: Active » Reviewed & tested by the community

I was receiving the same error message, and #5 did the trick. Thanks!

rhoean’s picture

the patch in # 5 really works!, been having this problem since i updated the twitter module yesterday, nice work

Sheldon Rampton’s picture

The patch in #5 worked for me as well.

kappaluppa’s picture

Worked for me. Will the module be updated with these changes, or something that won't require these changes?

elliotttf’s picture

+1 on this working. The module is useless without it, works perfectly with it.

altrugon’s picture

The patch on comment #5 works, please commit it to the repository.


blacklabel_tom’s picture

+1 for the patch in #5

rsaddington’s picture

Another +1 for #5 - please can we get it rolled into an official release.

reallyordinary’s picture

One more +1 on the patch in #5 - worked great for me.

jpamental’s picture

+1 for #5 - invalid oauth request before, worked fine after application of patch.

Rhodungeon’s picture

Same here patch #5 solved everything!

migrad’s picture

+1 for path #5

yanniboi’s picture

+1 for #5. Saved me a lot of head-desking today!

juampynr’s picture

Status: Reviewed & tested by the community » Fixed


Thanks everyone for all the feedback given!

yanniboi’s picture

Status: Fixed » Reviewed & tested by the community

Hey @juampy, thanks for the speedy committing, but this issue is against the 7.x-5.6 branch of Twitter. You committed against 7.x-6.x.
Whilst this will be helpful in the future, version 6 is still in alpha release and it would be helpful if you could also commit against the current recommended release to fix this issue.

Is that doable?

juampynr’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x-5.x. Thanks for spotting that @yanniboi.

ben_chad’s picture

Priority: Major » Normal
Status: Fixed » Active

Thanks for the patch @botanic_spark!

@juampy, the 7.x-5.x download still doesn't seem to have the patch applied to it. In fact, line 77 of twitter.lib.php seems to have diff output in it....

sco_tt’s picture

patch #5 worked perfectly, many thanks!

eamontaylor’s picture

I was having the same problem and patch #5 worked perfect for me cheers!

botanic_spark’s picture

Glad i could help :)

juampynr’s picture

Status: Active » Fixed

@yanniboi, I just downloaded the dev release and looks fine. Could you have another look please?

joestewart’s picture

@juampy, can you also apply the patch to 6.x-5.x branch? thanks.

yanniboi’s picture

I have had another look:

Branch 7.x-5.x
The patch seems to have applied fine. No problem I can find here.

@juampy, the 7.x-5.x download still doesn't seem to have the patch applied to it. In fact, line 77 of twitter.lib.php seems to have diff output in it....

Are you maybe looking at the 7.x-5.6 branch? Line 77 is an issue on 7.x-5.6 but in 7.x-5.x line 77 is the top of the docblock..

Either way, one of the reasons this patch is quite important is because it fixes a typing error in twitter.lib.php since December.
When the twitter.lib.php file was added back into twitter module in #1853794: Please consider restoring twitter.lib.php to the Twitter module the following line snuck in:

- $url = variable_get('twitter_api', TWITTER_API) . '/oauth/access_token';

This is fixed by the patch #5, but the error is still in the current release 7.x-5.6. It might be an idea to publish a new release with the to get rid of it.

ben_chad’s picture

Yes, my bad -- it was a typo and I meant 7.x-5.6. It would be good to get this fixed in the current release.

roesch’s picture

I understood #5 also works for drupal 6.
I am using twitter 6.x-5.0 and OAuth 6.x-3.0-beta4
How to apply this patch? what to do with the code? add it somewhere in the twitter.lib.php?
Where to add and also remove other lines?

thanks for helping.

yanniboi’s picture

Hey @roesch,

The issue queue is not really the best place to give training for patching. There is a lot of Drupal documentation on how to apply patches:

Good luck!

Sheldon Rampton’s picture

@roesch: If you're having trouble figuring out how to do patching, I think you can download a copy of the 7.x-5.x-dev version of the Twitter module and then copy over the twitter.lib.php file into your 6.x module directory, and it should work. It would be better, though, if you learned to apply the patch the correct way, as yanniboi suggested. :-)

roesch’s picture

thanks, i will try the official way .
drupal is new to me, so have to learn a lot.

Sheldon Rampton’s picture

@roesch: Here's the exact command that you should use to apply the patch:

git apply -v twitter_oauth_verifier-1924478-5.patch

Sheldon Rampton’s picture

Version: 7.x-5.6 » 6.x-5.x-dev
Status: Fixed » Reviewed & tested by the community

@juampy: This patch still needs to be applied against the 6.x-5.x-dev version of the module, so I'm updating the ticket accordingly. You can apply the same patch from #5 against the 6.x-5.x branch. It has already been tested and confirmed to work in 6.x-5.x in this separate issue ticket:

I think you can discount the comments posted there by user luisgrisolia. He was probably using an incorrect patch command. I've tried applying the patch twice, and it worked for me both times and has also worked for another user. I'm therefore marking this as "reviewed and tested by the community" so you can go ahead and apply it.

juampynr’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 6.x-5.x and released 6.x-5.1.


roesch’s picture

Thanks for helping.
It works!
I applied the mentioned patch to Twitter 6.x-5.x-dev.
And the Twitter stream at our company page is up to date for the first time in weeks! yeehoo!

vaneet’s picture

Great Job Buddy (#5)...............

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.