Skip to Content

Discord Social Login

The Discord social connection (type discord) lets users sign in with their Discord account β€” a natural fit for gaming and community products. Bring your own app β€” there is no shared Faable app for Discord, so you create one in the Discord Developer Portal.

Faable sends users to https://discord.com/oauth2/authorize, exchanges the code at https://discord.com/api/oauth2/token, and reads the profile from https://discord.com/api/users/@me.

Prerequisites

  • A Discord account.
  • Your Faable Auth domain ({YOUR_FAABLEAUTH_NAME}.auth.faable.link or your custom domain).

Find your redirect URI

In the Faable Dashboard, go to Auth β†’ Connections β†’ Create β†’ Social and pick Discord. Copy the Callback URL shown in the form β€” it is https://{YOUR_DOMAIN}/callback. With a custom domain both hosts are listed; register both if your apps start logins on either.

Register the app with Discord

  1. In the Discord Developer PortalΒ , click New Application and give it the name users will see on the consent screen.
  2. Open the OAuth2 page and add the Callback URL under Redirects. Save.
  3. On the same page, copy the Client ID and click Reset Secret to get the Client Secret.

Create the connection in Faable Auth

FieldValue to Provide
NameAn identifier such as discord. Shown in the dashboard and logs.
Client IDThe Discord Client ID.
Client secretThe Discord Client Secret.
ScopesComma-separated. Leave empty for the default identify email.
EnabledOn to offer it on the login screen right away.

The endpoints are preconfigured; you don’t enter them.

Scopes

The default scope is identify email: the user’s profile and email address. Add others (for example guilds to list the user’s servers) only if your app uses them β€” see the Discord OAuth2 scopesΒ .

User profile mapping

Faable user fieldSource on the /users/@me responseNotes
ididDiscord snowflake id.
nameglobal_name, else username
emailemailRequires the email scope.
email_verifiedverified, only when trueAttested β€” Discord says whether it’s verified.
picturehttps://cdn.discordapp.com/avatars/{id}/{avatar}.pngOnly when the user has set an avatar.

Identities are keyed by the Discord id plus the connection, never by email. Because Discord vouches for the address, the user is created with email_verified: true. A Discord login never merges into an existing account that happens to have the same email β€” it is a separate user.

Trigger a login

Pass connection=<connection id or name> on /authorize to skip the login screen:

https://{YOUR_DOMAIN}/authorize?client_id={YOUR_CLIENT_ID}&response_type=code&redirect_uri={YOUR_APP_CALLBACK}&scope=openid%20profile%20email&state={RANDOM_STATE}&connection=discord

Without connection, Discord appears as an option on the hosted login screen.

Troubleshooting

SymptomLikely cause
Invalid OAuth2 redirect_uriThe Callback URL isn’t in the Redirects list on the OAuth2 page.
Cannot fetch accessTokenClient ID / Client Secret mismatch, or the secret was reset in Discord.
User has no emailThe email scope was removed from the connection.

Last updated on