Appearance
Discord authentication
Discord authentication lets your users sign in with the Discord account they already use for communities and chats. Once connected, you can add a “Continue with Discord” button to your app.
Setup in the Discord dashboard
- Go to the Discord Developer Portal.
- Create a new application (or open an existing one).
- Open the OAuth2 settings for your application.
- Add a redirect URL (the URL Discord sends users back to after login).
- Use the WeWeb callback URL: the address of your app followed by
/api/auth/callback/discord. The table below lists the URLs to add.
- Use the WeWeb callback URL: the address of your app followed by
- Copy the credentials you’ll need (usually a
Client IDandClient Secret).
Add one callback URL for each place where users sign in:
| Where users sign in | Callback URL to add in Discord |
|---|---|
| Editor | https://<your-project>-editor.weweb.io/api/auth/callback/discord |
| Staging app | https://<your-project>-staging.weweb.io/api/auth/callback/discord |
| Published app | https://<your-project>-production.weweb.io/api/auth/callback/discord |
| Custom domain | https://your-domain.com/api/auth/callback/discord |
Replace <your-project> with your project's WeWeb subdomain. You can see it in your browser's address bar when the editor is open, for example bright-harbor in https://bright-harbor-editor.weweb.io.
CALLBACK URL VS SUCCESS PAGE
Discord always sends users back to the callback URL, never to a page of your app. WeWeb then completes sign in and takes users to the Success Page, Error Page, or New User Page you choose in the Sign in with social provider action. Do not add the URL of these pages in Discord.
Connect Discord in WeWeb
- In the WeWeb editor, open the
Data & APItab, then open theAuthenticationsubtab and go toSSO Providers. - Select
Discordand turn on theEnabletoggle. - Paste your Discord credentials into the fields shown in WeWeb.
- Click
Save.
Test sign in
- Add a “Continue with Discord” button in
Interface. - Create a workflow on click and add
Sign in with social provider. - Set:
Provider:discordSuccess Page,Error Page, and (optional)New User Page
- Preview and run the sign-in flow.
Common pitfalls
Redirect URL mismatch
- Make sure the redirect URL in Discord exactly matches the WeWeb callback URL ending with
/api/auth/callback/discord(no trailing slash), not theSuccess PageURL. - Check you’re using the correct environment (editor, staging app, published app, or custom domain).
Wrong credentials
If Discord returns an “invalid client” error, re-copy the Client ID and Client Secret from the Discord portal and paste them again in WeWeb.
Reference
| Setting in WeWeb | Description | Where to find it in Discord |
|---|---|---|
Client ID | Identifies your Discord application. | Your app page in the Developer Portal. |
Client Secret | Used to complete the sign-in flow securely. | OAuth2 settings in the Developer Portal. |
FAQs
Which redirect URL should I add in Discord?
Add the address of your app followed by /api/auth/callback/discord, for example https://your-domain.com/api/auth/callback/discord. Add one for each place where users sign in (editor, staging app, published app, custom domain). The URL of your Success Page is not the redirect URL.

