Discord
This guide explains how to set up Discord as an authentication provider with Stack Auth. Discord OAuth2 allows users to sign in to your application using their Discord account.
Integration Steps
Create a Discord Developer App
- Navigate to the Discord Developer Portal.
- Click the New Application button in the top-right corner.
- Enter a name for your application and click Create. You will be redirected to the General Information page.
- Select OAuth2 in the left sidebar.
- Under Redirects add
https://api.stack-auth.com/api/v1/auth/oauth/callback/discord
- In the OAuth2 section, enable the required scopes: 'identify' and 'email'
- Click Save Changes
- Save the Client ID and Client Secret. You may need to select Reset Secret to generate a new one.
Enable Discord OAuth2 in Stack Auth
- On the Stack Auth dashboard, select Auth Methods in the left sidebar.
- Click Add SSO Providers and select Discord as the provider.
- Set the Client ID and Client Secret you obtained from the Discord Developer Portal earlier.
User Profile Data
When a user signs in with Discord, Stack Auth will create a user profile with the following data:
- User ID: Discord's unique user ID
- Username: The user's Discord username
- Avatar: The user's Discord avatar (if available)
- Email: The user's email if the 'email' scope is requested
Need More Help?
- Check the Discord OAuth2 Documentation
- Visit our Discord Support Channel