Provider – Discord

Microsoft Sample

Table of contents

How to enable Discord login in WordPress

1. Create a Discord App

To be able to log in via Discord you must create a Discord App first.

  1. Navigate to https://discord.com/developers/applications
  2. If you are not logged in yet, then log in with your Discord credentials and visit the link above again.
  3. Click the “New Application” button.
  4. Fill the “Name” field and click the “Create” button.
  5. Optional: Select an “App Icon” and add a “Terms of Service URL” and “Privacy Policy URL”.
  6. On the left side, click on the β€œOAuth2” menu point in the Settings.
  7. Add the URL to the “Redirects” field.
  8. Click the “Save Changes” button.
  9. Copy the necessary “Client ID” and “Client Secret” values and fill these fields in the plugin settings!

2. App setup

Once your Discord app is ready you’ll need to copy and paste the Client ID and Client Secret to the Discord provider’s Settings tab. You can find the information at your Discord app’s OAuth2 panel.

3. Verifying

Once your Client ID and Client Secret has been added you need to verify the setup first. This verification helps you identify possible problems with the app.

Settings

Microsoft Provider Configuration

Client ID

The Client ID of your Discord app. You can find it at your App’s OAuth2 panel.

Client Secret

The Client Secret of your Discord app. You can find it at your App’s OAuth2 panel.

Force reauthorization on each login

When enabled, the users will be asked to reauthorize the Discord App each time they login with Discord.

Microsoft other settings

Username prefix on Register

Whenever a new user registers with their Discord account they can get a custom prefix so you can easily identify them.

Fallback username prefix on register

Whenever a new user registers with their Discord account and we can not generate a valid username from the first name or last name, a random username will be generated. With this option they can get a custom prefix so you can easily identify them.

Terms and conditions

This option can only be seen, if Terms and conditions is set to Show in Global Settings β†’ Privacy tab. Here you can set custom Terms and Conditions for users who register with Discord. For more information please read our GDPR documentation.

Sync data

By default Nextend Social Login stores the first name, last name, email, avatar url and access token if it is possible, however some additional information can also be retrieved and stored.
When an option is checked, that field will be stored in a meta key with the specified name.

Sync fields

-Available since: 3.1.8
It determines when the synchronization shall happen.

  • Register: whenever a new user registers with a provider, their data will be retrieved and stored.
  • Login: whenever user logs in with a provider, their data will be retrieved and stored.
  • Link: whenever user links and existing WordPress account with a provider, their data will be retrieved and stored.

Username ( not unique )

Stores the user’s username, which is not unique across the Discord platform!

Avatar hash

Stores the user’s avatar hash, which can be used for building an external Discord profile image url.

4-digit Discord-tag

Stores the 4-digit Discord-tag that appears after the user’s non-unique username.

Public flags

Stores the the public flags of a user’s account.

Flags

Stores the the public flags of a user’s account.

Banner hash

Stores the user’s banner hash, which can be used for building an external Discord banner image url.

Banner color

Stores the user’s banner color.

Accent color

Stores the user’s encoded banner color as an integer representation of hexadecimal color code.

Locale

Stores the users’ chosen language option.

Is 2FA enabled

Stores whether the user has two factor enabled on their account or not.

Nitro subscription type

Stores the type of Nitro subscription on a user’s account.

Email

Stores the email address assigned to the user’s Discord account. ( This email can be different from the WordPress account email address. )

Is email verified

Stores whether the email on the user’s account has been verified or not.

Common error messages returned by Discord during verification

client_id is incorrect

Unknown Application

The Application (client) ID you copied from the Discord app is invalid. Make sure the correct one was copied.

client_secret is incorrect

Error: invalid_client:

The Client secret you copied from the Discord app is invalid. Make sure the correct one was copied.