If you want users to login to your WordPress site using their Discord credentials, you can simply do it using our WP OAuth Client plugin. Once you configure the Discord with WordPress plugin, you can allow users to SSO to your WordPress site using Discord.
Similarly, you can map your WordPress roles based on your Discord attributes/groups. To know more about other features we provide in WP OAuth Client plugin, you can click here.
You can download OAuth Client plugin using the following link.
Download And Installation
Log into your WordPress instance as an admin.
Go to the WordPress Dashboard -> Plugins and click on Add New.
Seach for a WordPress OAuth Single Sign On plugin and click on Install Now.
After clicking on the New Application button it will show you the popup for providing a name to the application. Click on the Create button after providing the application name.
Navigate to the General Information section. Copy Client ID & Client Secret.
Navigate to the OAuth2 section & Add Redirect button for adding the callback URL from the plugin and click on the Save button.
Step 1.1: Discord Role Mapping [Optional]
After creating an OAuth Application,go to the Bot section.
Click on the Add Bot button.
Now we need to add Bot to our server with the permission to access roles. You need to check Bot and select the permission and it will generate the URL. You need to copy that URL and paste it into the new tab. After that, you need to select the server where you need to add the Bot.
After successfully authorization, Go to the Bot section and copy the token.
Now copy and paste the token into the configuration and also enter the guild or server ID (where you have added the Bot).
Step 1.2: Find your Guild ID (Server ID)
You will need the full Server ID (not the name) to continue. Follow these steps to find your Server ID:
In Discord, open your User Settings by clicking the Settings Cog next to your user name on the bottom.
Go to Appearance and enable Developer Mode under the Advanced section, then close User Settings.
Open your Discord server, right-click on the server name, then select Copy ID.
Paste the Server ID on your text editor for later.
If desired, you can disable Developer Mode now.
Step 2: Setup WordPress as OAuth Client
Go to Configure OAuth tab and configure App Name, Client ID, Client Secret provided by Discord in Step 1. You can use the below Scope and Endpoints.
Access Token Endpoint:
Get User Info Endpoint:
Click on Save Settings to save the configuration.
Step 3: User Attribute Mapping
User Attribute Mapping is mandatory for enabling users to successfully login into WordPress. We will be setting up user profile attributes for WordPress using below settings.
Finding user attributes
Go to Configure OAuth tab. Scroll down and click on Test Configuration.
You will see all the values returned by your OAuth Provider to WordPress in a table. If you don't see value for Email or Username, etc. make the required settings in your OAuth Provider to return this information.
Once you see all the values in Test Configuration, go to Attribute / Role Mapping tab, you will get the list of attributes in a Username dropdown.
Step 4: Login Settings / Sign In Settings
The settings in SSO Settings tab define the user experience for Single Sign On. To add a login widget on your WordPress page, you need to follow below steps.
Sign In Settings
Go to Appearances > Widgets.
Select miniOrange OAuth. Drag and drop to your favourite location and save.
Open your Wordpress page and you can see the login button there. You can test the SSO now.