Skip to content

Discord OAuth Setup

This guide will show you how to setup Discord OAuth for your Calagopus Panel.

Prerequisites

To setup Discord OAuth, you only need 2 things:

  • A Discord account
  • A Calagopus Panel, cause why would you read this guide if you don't have one??

Downloading required files

To setup Discord OAuth, you can use the discord.yml file to import to Calagopus Panel without having to manually copy the values by yourself.

To download this file, right click on the link below, and save it locally on your computer.

Download discord.yml

Import the template config

Once discord.yml has been downloaded, head to your Calagopus Panel's admin page, and click on OAuth Providers on the side. OAuth Providers tab

Then, click on the Import button and import the discord.yml file. Import OAuth Button

Once imported, click on the newly created Discord provider's ID and you should arrive to a page similar to this: Discord OAuth page

Copy the Redirect URL provided by the panel and proceed to the next step.

Setting up Discord OAuth

Creating the application

Go to Discord's Developer Portal, and create an application.

In the popup, type the name of your application, which will be shown on the Discord login page. Select a team if you have one and then click on Create.

In the General Information page (the page you get redirected to once you click Create), set an icon and/or a description if you'll like, for this guide we're not gonna cover this step.

Add your Redirect URL to Discord OAuth

On the left sidebar, click on OAuth2.

On the Redirects section, click on Add Redirect and paste the redirect URL Calagopus Panel has given you.

At the bottom, you should see the warning below: Click on the Save Changes button below.

Issue a OAuth Client ID and Secret

On the same OAuth2 page, look for the Client information section. Reset your Client Secret by clicking on the Reset Secret button.

Once you reset your Client Secret, copy both your Client ID and Client Secret. You will need thoses for the next step.

Configuring the OAuth Provider

Back to the panel, change the Client ID and the Client secret to the ones Discord has given you.

On the switches below, choose if you want to enable Discord OAuth, only allow login, allow the user to view the connection and allow the user to link and unlink their accounts.

It should normally look like this: Discord Config

Finally, save your changes, and you should be done!

Test the configuration

To test your configuration, head into your account settings, click on OAuth Links at the sidebar, and connect to your Discord account. Testing Discord

If everything works correctly, you should now be able to see your Discord account in your list. List

Troubleshooting

Error: "Invalid OAuth2 redirect_uri"

You may have put the wrong redirect URL in Discord than the one Calagopus Panel has provided you.

Solution:

  1. Go back to your Calagopus Panel OAuth provider configuration page
  2. Copy the exact Redirect URL shown
  3. Go to Discord Developer Portal and select your application
  4. Navigate to OAuth2, then Redirects
  5. Ensure the redirect URL matches exactly (including https://, trailing slashes, etc.)
  6. Click Save Changes

Error: "Unknown application"

The Client ID and Client Secret set on the panel is invalid.

Solution:

  1. Go to Discord Developer Portal and select your application
  2. Navigate to OAuth2
  3. Copy your Client ID
  4. Click Reset Secret to generate a new Client Secret and copy it
  5. Update both values in your Calagopus Panel OAuth provider configuration
  6. Save the changes