Discord Single Sign-On (SSO) in WordPress | Discord SSO Login
Overview
Set up Single Sign-On (SSO) on your WordPress website via Discord Single Sign On with the WordPress SSO plugin Implementing WordPress Discord Login using OAuth2 which allows users to log into your websites with a single set of credentials. During Discord Single Sign on Discord acts as the OAuth Provider, and WordPress acts as the OAuth Client. WordPress Discord SSO provides smooth integration between WordPress and discord using a single click. WordPress Discord SSO Integration with OAuth SSO plugin also provides advanced Discord SSO features like user profile attribute mapping, role mapping, and providing site access based on organization email domains. You can also protect your complete WordPress site behind Discord Single sign-on Integration. WordPress Discord SSO plugin secures the user’s login process and improves user authentication using Wordpress Discord Single Sign On. Follow the steps in the guide below to set up Discord SSO integration with the WordPress OAuth SSO via installing this plugin.
Integrations with Discord
Discord Role Mapping Add-on allows you to retrieve users' roles from your discord server to WordPress.
Map WordPress subscriptions to Discord server roles, manage user access to Discord from WP, and so much more.
Add Discord attributes such as custom fields in the WooCommerce orders/subscriptions that are sent to the Zapier.
Pre-requisites : Download And Installation
- Log into your WordPress instance as an admin.
- Go to the WordPress Dashboard -> Plugins and click on Add New.
- Search for a WordPress OAuth Single Sign-On (SSO) plugin and click on Install Now.
- Once installed click on Activate.
Steps to configure Discord Single Sign-On (SSO) / Social Login into WordPress
Step 1: Setup Discord as OAuth Provider
- Log in to Discord Console & click on New Application
- 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 OAuth2 section. Copy Client ID & Client Secret.
- Click on the Add Redirect button, Copy the Callback URL from the setup wizard from the WordPress OAuth Client plugin and paste it in the Redirects field. Click on the Save button.
You've effectively set up WordPress Discord Login on your WordPress site, enabling users to log in via Discord and access your site using their Discord credentials.
Step 2: Setup WordPress as OAuth Client
- Free
- Premium
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.
- 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.
Finding user attributes:
Step 4: Role Mapping [Premium]
- Click on “Test Configuration” and you will get the list of Attribute Names and Attribute Values that are sent by your OAuth provider.
- From the Test Configuration window, map the Attribute Names in the Attribute Mapping section of the plugin. Refer to the screenshot for more details.
-
Enable Role Mapping: To enable Role Mapping, you need to map Group
Name Attribute. Select the attribute name from the list of attributes which
returns the roles from your provider application.
Eg: Role -
Assign WordPress role to the Provider role: Based on your provider
application, you can allocate the WordPress role to your provider roles. It
can be a student, teacher, administrator or any other depending on your
application. Add the provider roles under Group Attribute Value and assign
the required WordPress role in front of it under WordPress Role.
For example, in the below image. Teacher has been assigned the role of Administrator & Student is assigned the role of Subscriber. -
Once you save the mapping, the provider role will be assigned the WordPress
administrator role after SSO.
Example: As per the given example, Users with role ‘teacher’ will be added as Administrator in WordPress and ‘student’ will be added as Subscriber.
Step 5: Sign In Settings
- WordPress 5.7 and below
- WordPress 5.8
- WordPress 5.9 and above
Troubleshooting Errors
More Troubleshooting Errors ➔Unknown Application
To fix this issue, please configure the correct Client ID in the plugin. You can refer to this steps to configure correct Client ID in the setup guide.
invalid_client
To fix this issue, please configure the correct Client Secret in the plugin. You can refer to this steps to configure correct Client Secret in the setup guide.
Invalid OAuth2 redirect_uri
To fix this issue, please configure the correct Redirect url in the Discord Developer application from the plugin . You can refer to this steps in the setup guide.
No scope were provide
This error is shown when Scope is not configured in the plugin. Please configure the scope in the plugin using this setup guide.