Last updated January 19, 2013. Created by sirkitree on December 3, 2009.
Edited by Michael-Inet, steinmb. Log in to edit this page.

Twitter contain a sub module - Twitter Signin. This enable users to login to

This simply provides a block with a link for site users to click which authenticates using Twitter's OAuth protocol and upon returning, creates a user account on your Drupal website and signs into it. That being said, the OAuth module is required for this functionality. You will also need to register your application with Twitter.com in order to obtain a Consumer key and Consumer secret.

Step by step guide

  1. Download the following modules: Twitter 3.x and OAuth 6.x-3.
  2. Enable following modules: twitter, twitter signin and oauth.
  3. During registration you will be asked to provide something called a Callback URL, this found at /admin/settings/twitter. Make sure you keep this handy, you will soon need it.
  4. It is now time to registering your drupal site (web application) at https://dev.twitter.com/apps/new. You need to provide Twitter with: Name, Description, Website and the famous Callback URL.
    Twitter-app
  5. Once you have completed the registration Twitter will generate two keys, Consumer key and Consumer secret. Both of these is needed by Drupal so keep them handy.
  6. Go to /admin/settings/twitter and enter your OAuth Consumer and Consumer secret –key, which you received from Twitter.
    twitter keys
  7. In your Twitter Developer's account, under the “Settings” tab, you will need to change the “Application Type > Access:” to “Read, Write and Access direct messages”
  8. Go to a user account and add a Twitter account and authorize you site to access it.
  9. You are now able to sign in by using the Drupal login block, accessing example.com/user or by using Sign in with Twitter provided by twitter signin.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

Make sure you use the oauth 2.x version.

The recommended version wont post your tweets, it give a 404 error, I think because it's not using the OAUTH. Although the maintainer hasn't bothered to tell anyone or make it clear on the module page.

The beta version does use the OAUTH module, but now when I post nodes. It just says posted to twitter successful, but when I go to my twitter account, nothing posted. Is this module working for ANYONE?!?!?!?

When you click on add twitter account, it loads the twitter page then I click accept and redirects me back to the home page of my website and does nothing else. Doesn't seem to work at all.

Did you specify the proper callback URL on your site? If you have no idea what I'm talking about, go into your Twitter developer page, edit your application and enter a callback URL. Hope that fixes it.

Best Regards,
Stephen Punwasi

it's just fiddley as hell. Keep trying, and re-read all the instructions. Then read them again. I spent about an hour getting this running.

I know this is a pain to configure, but with the security of oAuth 2.0, did you expect it to be easy? At least your Drupal site will not be hacked so easily. LOL

  1. In the appropriate Twitter module .INFO file, I changed the dependencies from oauth to oauth_common
  2. Made sure I have oAuth 6.x 2.02 enabled
  3. Went into the oAuth Test module and selected HMAC-SHA1 for the Signature Method

That's it. After playing with it and reading all the comments from the nice people on this thread, I got it working!

Thanks to you guys and I hope my post helps someone. Now, if I can get the pesky LinkedIn module to work, that would make my day.

Bruce C
Hot Web Ideas, Inc.

Hi,

I ran into a problem. Both Oauth and twitter signin modules are enabled. Yet, The Signin module cannot be activated because it says that Oauth module is missing. Any advice I can use here?
Thanks,
T

Visit our Startups group on Drupal

Currently available for freelance if needed

Hi,

I'm in same case. Both Oauth and twitter signin modules are enabled but I'm not able to select Signin module !
OAuth 6.x-3.0-beta3 Provides OAuth functionality
OAuth Consumer UI 6.x-3.0-beta3 Provides a UI for when OAuth is acting as a consumer.
Twitter 6.x-3.0-beta3

Hi, I find the solution.
You must patch site/all/modules/twitter/twitter_post/twitter_post.info line 6 :
replace dependencies[] = oauth
by dependencies[] = oauth_common

Same for site/all/modules/twitter/twitter_post/twitter_signup.info

This is for oauth release 6.x-3.0-beta3

Excellent, I just did this and it worked ok.
Thanks,
T|

Visit our Startups group on Drupal

Currently available for freelance if needed

That is _wrong_ - the OAuth 2.x and 3.x are two entirely different modules and Twitter currently has a dependency on the 2.x version. Changing the name of the dependency doesn't magically port the the Twitter module to the 3.x version of the OAuth.module.

You know, that's what I thought, too. But it seems that it really is almost as simple as updating the dependencies. The most recent beta for the Twitter module is now dependent on the current version of the OAuth module.

As stated on http://drupal.org/project/twitter the Twitter module uses the 2.x-version of the OAuth module and not the 3.x version:

[...] depends on Drupal's OAuth module version 6.x-2.02.

Install the correct version of the OAuth module and try again.

I cant get this to work, ive done it all.

But when my users go to log in through twitter they get riderected to twitter, get asked for permission then get sent back to my site but arent logged in.

is this working currently?

Drupal by Propeople | Versicherungsvergleich by versichern24 -> Austria's top portal on Drupal

I am using Oauth 2.02 and twitter 6x 3 beta 3.
- I have configured Oauth to RSA-SHA1
- I have configured twitter module to http://www.sabrosa-rain.com/twitter/oauth
- I have added consumer Key and secret Key

I have no error messages

When I add an account in user profile, I allow the connection on twitter and then go back to user page without being connected. I still have "add an account" in twitter account.

Is this module working for someone ?

- Guillaume -

According to Twitter's site, they currently support HMAC-SHA1 signatures. Try changing the OAuth configuration to use that instead of RSA-SHA1. That worked for me.

However, I can post, but I don't have anything showing up on the user's profile under the Tweet page...not sure why not?

When I go to /admin/settings/oauth I don't see any cryptography choices. All I see is a settings screen with a checkbox for "enable the oauth provider" and a "request token lifetime (in seconds)" text box.

Edit: Probably because I'm using the 3.0 Oauth.

Yes, you have to use OAuth 2.02, not 3.x - it will not work otherwise. (learned the hard way)

Is there a road map/plan for making Twitter Signin work with OAuth 3.x?
Currently I'm running in to this issue http://drupal.org/node/842990.

Sign in works, but now I can't access a wide range of the admin/user screens because of this error.

] duran goodyear
] alphex information solutions, llc.
] http://alphex.com

As someone else posted - my site seems to be fine (oauth 3.x). I can edit my account and click on the button to add my twitter account. This takes my to the twitter.com/oauth page and i get a PIN. But then nothing. I dont see anywhere to input the PIN. There is no option to publish/post things to twitter on the blog (set as the type for posting).

beginning php

You have to use OAuth 2.02 in order to select the correct hash method (HMAC-SHA1). OAuth 3.0 will not work.

I tried both oauth 2.02 and 3.0 and in both cases I dont have any place to enter the twitter PIN. Where is this supposed to show up? If I knew which page i could check the code.

beginning php

I signed on with oauth at Twitter, filled in my oauth settings, but when I go to my user Twitter settings, it tells me to Add account. It sends me to a screen to click Authorize app and when I click it, I'm sent back to my user screen as if nothing has happened.
I'm using the Twitter 6x-3.0-beta3 with OAuth module 6.x-2.02, using HMAC-SHA1. Any idea what's going on?

Could the maintainer of the Twitter module please update it with the install instructions? This obviously isn't as simple as upload and activate.

We were having the same issue as many of you, being returned to an empty screen with "add account". For us, the problem was actually in our Twitter Applications settings on the Twitter site itself. You MUST make sure that your "callback url" is set correctly in your https://dev.twitter.com/apps/ page (eg. http://yoursite.com/twitter/oauth). As soon as we fixed that, it worked fine. If you don't set this correctly, Twitter never gives a response to Drupal, and the account is not added.

Hope that helps someone out there.

setting up this twitter module has been a real challenge for me too... This is how I finally got it to work, hope it helps:

The settings for your app on twitter.com should have the following set up:
- Application type: Browser
- Callback url: http://your-own-site-url/twitter/oauth
- I also had default access type set to "Read, Write, & Private Message", but for some reason, when I edit the settings now, twitter changed it to "Read only".
- "Yes, use Twitter for login" checked
-> If something was configured wrong in your already existing app, delete the app and start over, could be just my imagination, but they seem to get cached.

The modules I installed on my drupal site:
- OAuth 6.x-2.02 (a more recent version wasn't recognized by depending modules)
- Twitter 6.x-3.0-beta3

-> Enable ALL twitter modules: Twitter + Twitter actions + Twitter Post + Twitter Signin
-> I only had Twitter + Twitter actions + Twitter Signin enabled (since I'm not intrested in posting to twitter) and it didn't work. Magic happened as soon as I enabled Twitter Post as well.

Edit the settings for the OAuth module and set encryption to RSA-SHA1 (although twitter mentions something else)

Edit the twitter settings and fill in your consumer key and secret as provided by twitter.com.... When copy/pasting the key and secret, I noticed Firefox adding a space at the end of each of them... Drupal probably strips these trailing spaces, but I just deleted these myself, better not to take any risks I guess...

That's what worked for me, when I go to /user/n/edit/twitter, I can add a twitter account and it seems to be working.

Good luck!

did everything mentioned and when I add account - nothing adds

>>>>>>>>>>>>>>
Thanks to here
http://fatedtoend.com/content/how-get-drupal-post-updates-twitter-again-...
finally got it working. Had to run my update.php

What nizer wrote worked for me, but I had to run cron before I saw my tweets under my user account. Until I ran cron I didn't see anything at my "user/n/tweets" URL. This may be because I'm using the Drupal Boost module, but if I remember right, I had this problem on another website that doesn't use Boost.

The RSA-SHA1 setting seems weird, because Twitter specifically mentions using HMAC-SHA1, but again, as of June 26, 2011, this works.

FWIW, once this is configured, you also get a "User Tweets" block in your list of blocks.

Oops, I forgot to mention, I didn't have to enable all the Twitter modules, just the basic Twitter module (and not Actions, Post, or Signin).

I follow all the step by step procedure.I used 6.x-3.0-beta3 module and OAuth module 6.x-2.02.but when i logged in with it callback to the http://mysitename.com/twitter/oauth?oauth_token=jjgg767ghhh763278ghg7676... that nothing happen.I am not able to register any user from twitter.can anyone help me to solve this problem?

Instead of going to http://twitter.com/apps/new in step 1, you should register your application at https://dev.twitter.com/apps/new (check http://drupal.org/node/1164568 for an explanation on this).

Hi, folks. Please file issues on the project page rather than discussing them here (in the docs). Thanks!

https://drupal.org/project/twitter

Might I also recommend using the JanRain module so you can sign in with Twitter, Facebook, Google, Yahoo, LinkedIn, MSN, and more. It's tree up to 2500 users and fairly cheap after that.

It only took like 45 minutes to setup all the services.
Seems worth it to get started with all the services. If you get above 5000 users then you can bother with settings up the modules :) and migrate the user ID mapping across. However, my project will stay below a few hundred logged in users so I didn't care.