# Configure Discord Login for Discourse

**URL:** https://meta.discourse.org/t/configure-discord-login-for-discourse/127129
**Category:** Integrations
**Tags:** sso, how-to
**Created:** [August 30, 2019, 9:54am UTC](https://meta.discourse.org/t/configure-discord-login-for-discourse/127129 "2019-08-30T09:54:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [August 30, 2019, 9:54am UTC](https://meta.discourse.org/t/configure-discord-login-for-discourse/127129/1 "2019-08-30T09:54:29Z")

</div>

> 🔖 This guide explains how to set up and configure Discord as a login option for your Discourse forum, including how to restrict access to specific Discord guilds.
> 
> 🙋 Required user level: Administrator

Once configured, Discord will appear as a login option alongside other authentication methods on your forum:

 ![Discord login button](https://global.discourse-cdn.com/meta/original/3X/c/7/c742e90b2fdc30b7ac631a922084246e67688e4a.png)

## Setting up Discord OAuth2

### Creating a Discord application

1. Visit the [Discord developer portal](https://discord.com/developers/applications)
2. Click “New Application”
3. Enter a name, upload an icon, and add a description for your application
  - These details will be shown to users during the login process

 ![Discord application creation](https://global.discourse-cdn.com/meta/original/4X/4/6/4/46461e461f71115854973a916c8b3d5c0540b17e.png)

### Configuring OAuth2 settings

1. Navigate to the “OAuth2” tab in the left sidebar

 ![OAuth2 settings tab](https://global.discourse-cdn.com/meta/original/4X/5/e/e/5eec41e7460b374a6b3e8bdcb4d1181280cfc256.png)

1. Copy the “Client ID” and “Client Secret”
  - If the secret isn’t visible, click “Reset Secret” to generate a new one

2. Add your redirect URL:
  - Format: `https://your-discourse-site.com/auth/discord/callback`
  - ⚠ Do not include a trailing slash

3. Click “Save Changes”

 ![Redirect URL configuration](https://global.discourse-cdn.com/meta/original/3X/c/8/c88c02b31d9a1fa57f983325b305129b501c8873.png)

### Enabling Discord login in Discourse

1. In your Discourse admin settings, enter the Client ID in the `discord_client_id` setting
2. Enter the Client Secret in the `discord_secret` setting
3. Enable the `enable_discord_logins` setting

## Restricting access to specific Discord guilds

You can limit Discord login to members of specific Discord guilds (servers).

### Finding your guild ID

1. Open Discord in your browser
2. Navigate to any channel in your guild
3. Look at the URL: `https://discord.com/channels/{guild_id}/{channel_id}`
4. Copy the first number (guild\_id) from the URL
  - Example: In `https://discord.com/channels/123/456`, the guild ID is `123`

### Configuring guild restrictions

1. In your Discourse admin settings, locate the `discord_trusted_guilds` setting
2. Add your guild ID(s)
  - You can add multiple guild IDs if needed

When guild restriction is enabled:

- Members of trusted guilds will log in normally
- Other users will see an error message
- You can customize this message under **Customize → Text** , search for `discord.not_in_allowed_guild`

 ![Guild restriction error](https://global.discourse-cdn.com/meta/original/3X/f/8/f85749b81c07fd4851cf10d483766d2155a1ae42.png)

⚠ If you’re using guild restrictions for security, disable all other login methods in your Discourse settings.

## Next steps

Consider setting up the [chat-integration plugin](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522) to push important Discourse topics to your Discord channels.

> Last edited by @jessii 2024-12-11T19:59:00Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [January 17, 2025, 5:42pm UTC](https://meta.discourse.org/t/configure-discord-login-for-discourse/127129/61 "2025-01-17T17:42:52Z")

</div>

A post was split to a new topic: [Add more scopes to discord login](https://meta.discourse.org/t/add-more-scopes-to-discord-login/347719)

---

<div class="post-metadata">

### Author: ![twofoursixeight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/twofoursixeight/32/574822_2.png) [@twofoursixeight](https://meta.discourse.org/u/twofoursixeight)
#### Post date: [March 3, 2025, 8:32pm UTC](https://meta.discourse.org/t/configure-discord-login-for-discourse/127129/62 "2025-03-03T20:32:28Z")

</div>

Aren’t the channel IDs on discord now starting with [discord.com](http://discord.com) ? When I use discord on the web it’s always been `discord.com/channels/[guild_id]/[channel_id]` for the last couple years or so.

---

<div class="post-metadata">

### Author: ![nicks](https://avatars.discourse-cdn.com/v4/letter/n/4af34b/32.png) [@nicks](https://meta.discourse.org/u/nicks)
#### Post date: [July 14, 2025, 7:19pm UTC](https://meta.discourse.org/t/configure-discord-login-for-discourse/127129/64 "2025-07-14T19:19:58Z")

</div>

It appears that this guide is quite out of date. In Discourse admin interface one can specify:

- Enable Discord logins
- Discord client ID
- Discord secret
- Discord trusted guilds (optional)

Meanwhile in the Discord developers interface, we have:

- Name
- Description (optional)
- Application ID
- Public Key
- Interactions Endpoint URL (optional)
- Linked Roles Verification URL (optional)

Assuming that

- _Discord client ID_ is the _Application ID_, and
- _Discord secret_ is the same as _Public Key_, and
- leaving optionals blank,

this results in Discord error while trying to authenticate:

 ![Screenshot_2025-07-14_15-11-05](https://global.discourse-cdn.com/meta/original/4X/b/7/3/b7305b0b1cd5994f81e7adec0339d979913aeb50.png)

If I try setting _Interactions Endpoint URL_ to  
`https://forum.example.com/auth/discord/callback`, I get

```plaintext
Validation errors:
    interactions_endpoint_url: The specified interactions endpoint url could not be verified.

```

in Discord dev interface.

What is the correct procedure for setting this up?

---

<div class="post-metadata">

### Author: ![gilles](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gilles/32/549022_2.png) [@gilles](https://meta.discourse.org/u/gilles)
#### Post date: [February 24, 2026, 4:57pm UTC](https://meta.discourse.org/t/configure-discord-login-for-discourse/127129/65 "2026-02-24T16:57:43Z")

</div>

Hello,

I’m getting the same error “Invalid OAuth2 redirect\_uri”

Has anyone succeeded with the integration?

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [February 24, 2026, 6:10pm UTC](https://meta.discourse.org/t/configure-discord-login-for-discourse/127129/66 "2026-02-24T18:10:21Z")

</div>

I just tested this and the steps in the OP worked for me. I added my site’s URL as instructed:

`https://test.mydomain.com/auth/discord/callback`

And it was accepted with no error. You need to add this in the Oauth2 \> Redirects section

 ![CleanShot 2026-02-24 at 13.09.25@2x](https://global.discourse-cdn.com/meta/original/4X/a/c/7/ac727e5cd1d8c8276bf0c3a51c930c2bb474f1a5.png)

---

<div class="post-metadata">

### Author: ![gilles](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gilles/32/549022_2.png) [@gilles](https://meta.discourse.org/u/gilles)
#### Post date: [February 24, 2026, 6:57pm UTC](https://meta.discourse.org/t/configure-discord-login-for-discourse/127129/67 "2026-02-24T18:57:59Z")

</div>

super thanks pmusaraj

I had read the tutorial on that page and not the Discourse documentation  
I won’t make the same mistake next time sorry for the trouble 😅
