Skip to main content

Authentication for Public Clients

This method requires enabling Public Client for your app. Most games will not want to ship with this enabled. Learn more
Use Public Client Integration only if you donโ€™t have a server-authoritative backend and therefore require a Public Client for authentication.
If you have Public Client enabled on your Discord app, you can use the following code to authenticate your players with the external provider directly from the client โ€” no backend required. Before using this method, you must configure your identity provider in the Developer Portal.

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

Managing Provisional Accounts

Refresh access tokens and set display names.

Merging Accounts

Merge a provisional account into a full Discord account.

Unmerging Accounts

Sever the link between a Discord account and a provisional account.
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