Skip to main content

Server Authentication with External Credentials Exchange

Use the Bot Token Endpoint if your game has an account system that uniquely identifies users. It is simpler, requires no identity provider configuration, and is the recommended approach for most integrations.Use External Credentials Exchange only if you have a hard requirement for a server-side custom OIDC integration. If you don’t have a server-authoritative backend, use Public Client Integration instead.
Before using this method, you must configure your identity provider in the Developer Portal. Exchange the external provider’s token for a Discord access token from your game server:
See the External Auth Types table for the full list of supported external_auth_type values.

External Credentials Exchange Response

If you are using OIDC, you may see a refresh_token in this response. Using it via the OAuth2 refresh_token grant is deprecated — re-authenticate using a fresh provider token instead. See Refreshing Access Tokens for details.

How the Flow Works

Once authentication is complete, you can use the access token as you would a full Discord user’s access token. See Managing Provisional Accounts for token refresh, storage, and display names.

Error Handling

Common error codes and solutions when creating a provisional account: If you are using OIDC, you may encounter more specific errors:

Next Steps

Configuring Identity Providers

Set up OIDC, Steam, EOS, and other providers, and review the OIDC requirements.

Managing Provisional Accounts

Refresh access tokens and set display names.
Need help? Join the Discord Developers Server and share questions in the #social-sdk-dev-help channel for support from the community. If you encounter a bug while working with the Social SDK, please report it here: https://dis.gd/social-sdk-bug-report

Change Log