Configuring Twitter login for Discourse

(Jeff Atwood) #1
  1. Go to and sign in with a twitter account.

  2. Click the Create New App button.

  3. Enter a name and description for your forum.

  4. Enter in the Website field.

  5. Enter in the Callback URL field.

  6. Agree to the legal stuff and click the Create button.

  7. In the Settings tab, enter in the Privacy Policy URL field and in the Terms of Service URL field

  8. Check “Allow this application to be used to Sign in with Twitter” and click Update Settings.

  9. In the Permissions tab, choose “Read Only”, and “Request email addresses from users”, then click Update Settings.

  10. Click on the “Keys And Access Tokens” tab. The API key and API secret go in the twitter_consumer_key and twitter_consumer_secretsettings in the Login section (/admin/site_settings/category/login).


Twitter Login Troubleshooting
Twitter Log In - Fabric?
Hint for registering app with twitter Twitter should list (instead of
Login with Social Media accounts
Twitter Login Redirect Is Incorrect And Uses Port
Configure oauth callback urls
Twitter sign-up bug II
[Paid] Discourse configuration changes
(Uwe Keim) #15

If you are getting the following error:

You must confirm your email address prior to creating an application. Please read for more information

(like me), the solution is to change your e-mail address forth and back again (i.e. confirm it twice).

See here for details.

(Wesley) #19

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!

(Brahn) #21

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?

(Jeff Atwood) #22

Oh nice, can we look into this next week @eviltrout? Thanks for letting us know @brahn.

(Robin Ward) #25

This works quite nicely now! I’ve added support for emails via Twitter in this commit:

Note that for emails to work the user must also set up a privacy policy and terms of service when setting up their twitter account. Fortunately Discourse provides both so it’s just a matter of filling in those two fields. Once you’re done that, click the email option, and Discourse will happily make use of that email!

(Jeff Atwood) #26

Fantastic, confirmed working 100% here on meta. I’ve also updated the first post to reflect the new setup.

(khalido) #27

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.

(Rafael dos Santos Silva) #28

If emails match the association is automatic.

(khalido) #29

Thanks. I found FB logins match existing user, but twitter wasn’t. Anyways, FB working is enough so thats good.

(Emilio F Castillo) #30

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

(Carlo) #31

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.

(Jeff Atwood) #32

Write is highly not recommended.

(Carlo) #33


Ok I’ll change that then tks!