Authentication via Discord
This guide explains how to set up authentication via Discord for your application.
Prerequisites
- A valid Discord account.
- Access to the Discord Developer Portal.
- Your application's domain or URL where the authentication system will be integrated.
Environment Variables
dotenv
DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
Variable | Description |
---|---|
DISCORD_CLIENT_ID | Your application's Client ID |
DISCORD_CLIENT_SECRET | Your application's Client Secret |
Hidden Variables
dotenv
DISCORD_DISCOVERY_URI=https://discord.com/.well-known/openid-configuration
DISCORD_SCOPES="openid profile email"
Variable | Description |
---|---|
DISCORD_DISCOVERY_URI | Url to discord's OpenID configuration file |
DISCORD_SCOPES | Space-separated list of scopes requested during login |
Setup Instructions
Step 1: Register an application
- Head over to the Discord Developer Portal
- Click on New application
- Provide a name for your application and agree to the terms of service
Step 2: Retrieve OAuth credentials
- In the sidebar under Settings click on OAuth2
- Locate the following credentials:
- Client ID: Copy this value
- Client Secret: Click on "Reset secret", confirm, and copy the generated value
Step 3: Configure Redirect URLs
- Scroll to the Redirect section under OAuth2
- Click Add Redirect and provide your callback URL in the following format:
https://<YOUR DOMAIN>/api/auth/discord/callback
Replace<YOUR_DOMAIN>
with your application's actual domain name.
Step 4: Apply changes and restart Notivae
After updating your environment variables with the Discord credentials and settings, restart Notivae to apply the changes:
shell
docker compose up -d --force-recreate