-
Notifications
You must be signed in to change notification settings - Fork 2
Discord Auth Setup
cclloyd edited this page Aug 7, 2025
·
2 revisions
- Go to the Discord developer portal.
- Click on
Applicationson the left side, then theNew Applicationbutton. - Name the application whatever you wish,
PlaneShiftwill suffice, anything will do. This is the name that will show up when users try to authenticate using discord.
- Click on your newly created application
- Click on
OAuth2on the left side - Add a redirect URL. This is in the format of
${EXTERNAL_URL}/api/auth/discord/callback - Be sure to save any changes.
BEFORE YOU LEAVE: Take note of your Client ID and Client Secret, you will need them later
Modify your docker compose file to include the following env vars
Fill in DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET with the values you got from step 2.
There are other optional settings you can fill in for security, which are highly recommended if your API is accessible from the internet.
services:
planeshift:
# ...rest of your settings
environment:
# ...rest of your environment
AUTH_PROVIDERS: 'discord'
# Note: This can include other providers as wel as a comma separated list.
# Discord auth settings
DISCORD_CLIENT_ID: 'CHANGEME'
DISCORD_CLIENT_SECRET: 'CHANGEME'
# DISCORD_GUILD_ID: '' # (If omitted, any discord user can authenticate)
# DISCORD_ROLE_ID: '' # (If omitted, any user in the specified discord server can authenticate)
# DISCORD_GM_ROLE_ID: '' # (If omitted, all users will be considered GMs)
# DISCORD_ADMIN_ROLE_ID: 'ADMIN_ROLE_ID (If omitted, all users will be considered admins in the API, bypassing all permission restrictions.)'Once you set this up, run docker compose up -d again to apply the changes.