Discord Authentication
The discord provider uses Discord's support for OAuth 2.0 authorization. You can use this provider in both development and production environments. You should note that this provider will open an external browser for the user to authenticate and authorize your Discord application.
info
There currently is no support to view Discord guild/server membership data or roles. This integration is simply just the basis for verifying authentication via Discord.
Configuration
| Variable | Description |
|---|---|
auth.discord.client.id | The Client ID on the OAuth2 page of your Discord app. |
auth.discord.client.secret | The Client Secret on the OAuth2 page of your Discord app. This can be used with the secrets system. |
Setup
- Create a Discord Application at https://discord.com/developers/applications
- Go to the OAuth2 page at
https://discord.com/developers/applications/YOUR_APP_ID/oauth2 - Click Reset Secret under the Client Secret to regenerate a secret; put this and the Client ID both in the corresponding Redwood configuration
- Still on the OAuth2 page, under Redirects add the below URLs:
http://director.localhost:3001/oauth2/callback/discord(used for the Dev Initiator)http://director.localhost:80/oauth2/callback/discord(used for local Kubernetes deployments)- Whatever you use for the production Director Frontend external connection config. For example,
https://demos-director-frontend.redwoodmmo.com:443/oauth2/callback/discord
- Update your project to use the
URedwoodClientGameSubsystem::LoginWithDiscordfunction instead of the normalLoginfunction. ThebRememberMeargument works the same way as theLoginfunction works by storing a one time authentication token in a SaveGame locally.