Discord Oauth2 Plugin

:tada: Discord support is now included in Discourse core, this plugin is no longer required

Original Plugin Description

By popular demand, I’ve created a plugin to allow users to log in via Discord.

You can find the plugin here: https://github.com/discourse/discourse-plugin-discord-auth

After installing the plugin,

  • Generate the application here, and copy the Client ID and Client Secret.
  • Add the your website to the REDIRECT URI(S) using
    https://example.com/auth/discord/callback
    (replacing the https with http and example.com with your full qualified domain/subdomain)
  • Update the plugin settings in the Admin > Settings area with the Client ID and Client Secret.

Special thanks to @cpradio for providing a great starting point for this via the LinkedIn Oauth2 plugin.


Allowing logins only from a certain guild

The site setting discord trusted guilds allows you to restrict login to members of specific Discord guilds. To use, simply type the guild ID into the Discourse site setting.

To find your guild ID, log into your desired discord guild, and view a channel. The URL format is https://discordapp.com/channels/{guild}/{channel}. For example, given a URL as https://discordapp.com/channels/123/456, your guild ID would be 123.

Users who are not part of an allowed guild will be shown this message upon login:

If you are relying on this guild restriction for security, make sure to disable all other Discourse login methods.

To support this functionality, the plugin pulls in the “view guilds” scope permission in addition to email and identity.

30 Likes