Auto Tournament
Sign-in

Discord

Turn on Sign in with Discord.

Users sign in with their Discord account. Auto Tournament asks Discord for the identify and email scopes. See Sign-in providers for how accounts and admin access work.

Create a Discord application

  1. Open the Discord Developer Portal and sign in.
  2. Click New Application.
  3. Enter a name, for example Auto Tournament. Users see this name when they sign in.
  4. Tick the box to agree to the Developer Terms of Service and Developer Policy, then click Create.
  5. In the left menu, click OAuth2.
  6. Under Client information, copy the Client ID.
  7. Click Reset Secret, confirm, and copy the Client Secret. Discord shows it only once.

Add the redirect URL

On the same OAuth2 page, under Redirects, click Add Redirect and enter:

FRONTEND_BASE_URL/api/auth/discord/callback

For example https://tournament.example.com/api/auth/discord/callback. Click Save Changes.

Turn it on in Auto Tournament

In Settings → Sign-in → Discord, paste the Client ID and Client Secret, turn it on and save. The callback URL to register is shown there with a copy button. The Sign in with Discord button appears on the login page right away.

Prefer environment variables? Set AUTH_DISCORD_ENABLED=true, DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET and restart. They are imported once.

Test the button

  1. Open FRONTEND_BASE_URL/login in a private browser window.
  2. Click Sign in with Discord and approve the request in Discord.
  3. You are signed in. Someone new gets an account of their own when registration is open (Settings → Players & Access). Steam can be linked later on /me/connections.

If Discord shows "Invalid OAuth2 redirect_uri", the redirect URL in step 2 does not match FRONTEND_BASE_URL exactly.

On this page