Search Results :

×

Integrate Discord Single Sign-On (SSO) for WordPress | Discord Integrator


Discord Integration using OAuth2 for WordPress:

Setting up Discord Integration (Discord SSO) using OAuth2.0 is easy with Discord Integrator plugin for WordPress. It supports advanced Single Sign-On (SSO) features such as user profile Attribute mapping, Role mapping, etc. Here we will go through a guide to configure SSO between WordPress and Discord. By the end of this guide, users should be able to login to WordPress from Discord. To know more about other features we provide in OAuth Single Sign-On ( OAuth & OpenID Connect Client ) plugin for WP, you can click here.

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 miniOrange Discord Integration plugin for WordPress and click on Install Now.
  • Once installed click on Activate.

Steps to configure Discord Single Sign-On (SSO) into WordPress

1. Setup Discord as Social Login Provider

  • Go to https://discordapp.com/developers/applications & and sign in with your discord app developer account.
  • Click on New Application.
  • discord plugin for WordPress - discord sso integrator - Add 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.
  • discord plugin for WordPress - discord sso integrator - name the application
  • Navigate to the OAuth2 tab from the left section. Click on Add Redirect button and enter the redirect url which you will get from the Discord Integration plugin for WordPress. Then click on save changes button.
  • discord plugin for WordPress - discord sso integrator - add redirect
  • Now, Copy the Client Id and Client Secret and configure them in the miniOrange Discord Plugin on the corresponding fields.
  • discord plugin for WordPress - discord sso integrator - copy client credentials

You have successfully implemented Discord as Social Login Provider for configuring Discord Plugin for WordPress.


2. Setup WordPress as OAuth Client

  • Go to Discord login-> App setting. Enter the Client Credentials like Client ID & Client Secret which you got from step1.
  • Enter the scope as identify+email+guilds+guilds.join. Click on save & Test Configuration button.
  • discord plugin for WordPress - discord sso integrator - test configuration
  • You will see all the values returned by discord to WordPress in a table.
  • discord plugin for WordPress - discord sso integrator - test result

You have successfully implemented WordPress as OAuth Client for configuring Discord Plugin for WordPress.


3. Setup A discord server and discord bot into Discord integrator  discord plugin for WordPress - discord sso integrator

    3.1. Steps to get the Bot Token

    • Go to the developer console of discord and Navigate to the Bot tab from left hand side menu. Click on the Add Bot button.
    • discord plugin for WordPress - discord sso integrator -
    • Copy the Token and keep it handy as we will require it later while configuring Bot Token in Discord Integrator plugin.
    • discord plugin for WordPress - discord sso integrator -

    3.2. Steps to add the created Bot into discord server

    • Go to URL Generator under OAuth2 section and select the following permissions.
    • discord plugin for WordPress - discord sso integrator -
    • Copy the Generated URL and paste it in a new tab. You will be asked to select a discord server to join. Select the server and provide Bot permissions to the server.
    • discord plugin for WordPress - discord sso integrator -

      NOTE : Make sure Bot is added into discord server after that go to roles and make sure that Bot we just added it should be on top.[If not move it on top by left side dots].


      discord plugin for WordPress - discord sso integrator -

    3.3. Steps to get the Guild ID

    • To get Guild ID for your server you first need to enable Developer Mode in the discord server setting. To Enable Go To Setting => Advanced => Enable Developer Mode.
    • discord plugin for WordPress - discord sso integrator -
      discord plugin for WordPress - discord sso integrator -
    • Now, Open your Discord server, right-click on the server name, then select Copy ID and keep it handy as we will require it later while configuring the Guild ID in the Discord Integrator plugin.
    • discord plugin for WordPress - discord sso integrator -

    3.4. Steps to configure the Bot Token and Guild ID in the Discord Integrator Plugin

    • Now go to Discord Integrator plugin => Discord Server Configuration. And paste Guild ID and Bot Token in the Discord Plugin on the corresponding fields.
    • discord plugin for WordPress - discord sso integrator -

4. Enable the connect with discord button after the user logged in  discord plugin for WordPress - discord sso integrator

Enable this feature to show a "Connect with Discord" button to users after they successfully log in with their WordPress credentials. By clicking the button, the user will be added to your Discord server.

  • Go to Discord Integrator plugin => Link Social Account tab. Enable the checkbox for Linked users to loggedin user and copy the shortcode [miniorange_discord_login link_enable="1"] and paste it on any WordPress page where you want to show connect button.
  • discord plugin for WordPress - discord sso integrator -
    discord plugin for WordPress - discord sso integrator -

5. Map Discord roles to WordPress  discord plugin for WordPress - discord sso integrator

Member roles in the discord server will be mapped with WordPress role during Single Sign-On (SSO). Whenever a user logs into the WordPress site using Discord Single Sign-On(SSO), WordPress role will be assigned to the user based on user's role on the discord server.

  • Go to the Discord Integrator plugin => Discord To WordPress Role Mapping tab. Enable the checkbox for Discord To WordPress Role Mapping.
  • discord plugin for WordPress - enable mapping -
  • Please select the Discord Role corresponding to the desired WordPress Role for a user and proceed by clicking the Save button. Multiple Discord roles can be assigned to distinct WordPress roles, as shown in the below image.
  • discord plugin for WordPress - map the roles -

6. Map WordPress roles to Discord  discord plugin for WordPress - discord sso integrator

User roles from your WordPress site will be mapped to member roles in your Discord server. Whenever a user logs into the WordPress site using Discord Single Sign-On(SSO), the user will be assigned the Discord role on the discord server based on user's role on the WordPress website.

  • Go to the Discord Integrator plugin => WordPress To Discord Role Mapping tab. Enable the checkbox for WordPress To Discord Role Mapping.
  • discord plugin for WordPress - enable role mapping -
  • Please select the WordPress Role corresponding to the desired Discord Role for a user and proceed by clicking the 'Save' button. Multiple WordPress roles can be assigned to distinct Discord roles, as shown in the below image.
  • discord plugin for WordPress - role mapping -

7. Membership/Subscription based Role Mapping discord plugin for WordPress - discord sso integrator

    7.1 Woocommerce Membership based role mapping

    Enable this feature, to assign the role to a user on your Discord server based on the membership level purchased on your WooCommerce WordPress website. In the event that a user's membership expires or is cancelled, the current membership-based discord role will be removed and the default discord role will be assigned to that user.

    • Go to the Discord Plugin => Membership/Subscription based Role Mapping tab. Here, navigate to Woocommerce membership tab and enable the Integration by clicking on toggle button.
    • discord plugin for WordPress - role mapping
    • Please select the Discord role corresponding to the desired WordPress membership for a user and proceed by clicking the Save Settings button. It is possible to assign multiple Discord roles to distinct WordPress memberships, as shown in the image below.
    • discord plugin for WordPress - role mapping
    • Scroll down to the Default_Discord_Role section and select the discord role from the dropdown that you want to assign to users as default role. Click on Save Settings below.
    • discord plugin for WordPress - role mapping

    7.2 Woocommerce Subscription based role mapping

    Enable this feature, to assign the role to a user on your Discord server based on the Subscription level purchased on your WooCommerce WordPress website. In the event that a user's subscription expires or is cancelled, the current subscription-based discord role will be removed and the default discord role will be assigned to that user.

    • Go to the Discord Plugin => Membership/Subscription based Role Mapping tab. Here, navigate to Woocommerce Subscription tab and enable the Integration by clicking on toggle button.
    • discord plugin for WordPress - role mapping
    • Please select the Discord role corresponding to the desired WordPress Subscription for a user and proceed by clicking the Save Settings button. It is possible to assign multiple Discord roles to distinct WordPress Subscription, as shown in the image below.
    • discord plugin for WordPress - role mapping
    • Scroll down to the Default_Discord_Role section and select the discord role from the dropdown that you want to assign to users as default role. Click on Save Settings below.
    • discord plugin for WordPress - role mapping

    7.3 Paid Membership Pro based role mapping

    Enable this feature, to assign the role to a user on your Discord server based on the membership level purchased on Paid Membership Pro. In the event that a user's membership expires or is cancelled, the current membership-based discord role will be removed and the default discord role will be assigned to that user.

    • Go to the Discord Plugin => Membership/Subscription based Role Mapping tab. Here, navigate to Paid Membership Pro tab and enable the Integration by clicking on toggle button.
    • discord plugin for WordPress - role mapping -
    • Please select the Discord role corresponding to the desired WordPress membership for a user and proceed by clicking the Save Settings button. It is possible to assign multiple Discord roles to distinct WordPress memberships, as shown in the image below.
    • discord plugin for WordPress - role mapping -
    • Scroll down to the Default_Discord_Role section and select the discord role from the dropdown that you want to assign to users as default role. Click on Save Settings below.
    • discord plugin for WordPress - role mapping -

With Discord Plugin for WordPress you have configured Discord as Social Login Provider and WordPress as OAuth Client to provide User Restriction and Role Mapping for the users who are performing Single Sign-On using Discord user profile on your WordPress site. Discord Integrator will now provide seamless one-click login with Discord social login into your WordPress site.

Additional Resources


Mail us on discordsupport@xecurify for quick guidance(via email/meeting) on your requirement and our team will help you to select the best suitable solution/plan as per your requirement.

Hello there!

Need Help? We are right here!

support