Go to apps.twitter.com and sign in with a Twitter account.
Click the Create New App button.
2a. Enter a name and description for your forum.
http://forum.example.comin the Website field obviously, replacing the domain with your site’s actual domain name and matching the correct protocol, HTTP or HTTPS.
http://forum.example.com/auth/twitter/callbackin the Callback URL field.
2d. Agree to the legal stuff and click the Create your Twitter application button.
In the Settings tab, enter
http://forum.example.com/tosin the Terms of Service URL field,
then check “Allow this application to be used to Sign in with Twitter”
Click Update Settings.
In the Permissions tab, choose “Read Only”, and “Request email addresses from users”, then click Update Settings.
Click on the Keys And Access Tokens tab.
Copy the API key and API secret and paste it in the
twitter_consumer_secretsettings in the Login section of your Discourse site (
Be sure to enable the site setting
enable twitter logins
Twitter Login Troubleshooting
Twitter Log In - Fabric?
Hint for registering app with twitter Twitter should list http://apps.twitter.com (instead of https://dev.twitter.com)
Login with Social Media accounts
Configure oauth callback urls
Twitter Login Redirect Is Incorrect And Uses Port
Twitter Login and signup error
[Paid] Discourse configuration changes
If you are getting the following error:
You must confirm your email address prior to creating an application. Please read https://support.twitter.com/articles/97942-confirming-your-email-address25 for more information
(like me), the solution is to change your e-mail address forth and back again (i.e. confirm it twice).
Has anyone found a way to add several callback URLs to the same Twitter app? This is possible with Google and Facebook but I can’t find a way to do it with Twitter!
I just noticed that twitter now has “Additional Permissions”:
Is ticking this on going to be enough or does something need to change in Discourse?
This works quite nicely now! I’ve added support for emails via Twitter in this commit:
Fantastic, confirmed working 100% here on meta. I’ve also updated the first post to reflect the new setup.
I have successfully set up twitter logins and it works, but I don’t see how to associate a twitter login to an existing account.
I’d like a way in the admin panel of an existing user to associate a twitter/fb login.
At the moment it seems that with Discourse 1.6 I can only setup a new user with the twitter login.
If emails match the association is automatic.
Thanks. I found FB logins match existing user, but twitter wasn’t. Anyways, FB working is enough so thats good.
I followed the steps and have double checked myself. When I click on the “test OAuth” button I get a “page does not exist” error message.
I am entering https in the website URLs…should that be http?
The enable call back locking is NOT checked. Should it be?
This is the call back URL I am using: Roatan Community
Hi. Thanks for this tutorial.
Actually it works when you leave permission to “Read and Write” and uncheck required email.
For me step 9 did not work. But it may work for others.
Write is highly not recommended.
Ok I’ll change that then tks!
Great walkthrough! You might want to add that it is required to check the “enable twitter logins” checkbox. I know it is obvious, but when following the steps one tends to overlook that (at least I did).
Guide updated, images added.
I’m getting this error trying to login with Twitter on a site we host:
Oops The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience. Detailed information about the error was logged, and an automatic notification generated. We'll take a look at it. No further action is necessary. However, if the error condition persists, you can provide additional detail, including steps to reproduce the error, by posting a discussion topic in the site's feedback category.
In the /logs it just says:
OAuth::Unauthorized (401 Authorization Required) /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/oauth-0.5.1/lib/oauth/consumer.rb:217:in `token_request'
I’m not sure what’s wrong with the Twitter app but we could use a better error message than that.
EDIT: the problem was a case mismatch in the site hostname in the Twitter application, but regardless we could give a nicer error.
That seems like a rare case, and probably mishandled by Twitter as well. I’d apply the rule of three here: we need to see this error happen three times on three different sites before we need to do anything about it, otherwise we’re taking action prematurely & speculatively.
Note that the “Callback URL” field is now mandatory. If you omitted it in your setup, Twitter login will fail with a 403 unauthorized error.
Also note that if you have any extra spaces at the beginning or end of your callback urls, auth will fail. You can find other discussions about this change on the Twitter Community.