Search Results :

×

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


WordPress Discord Integration using OAuth2:

Setting up WordPress Discord Integration (Discord SSO) using OAuth2.0 is easy with WordPress Discord Integrator plugin. 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 WP OAuth Single Sign-On ( OAuth & OpenID Connect Client ) plugin, 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 WordPress miniOrange Discord Integration plugin 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.
  • WordPress discord plugin - 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.
  • WordPress discord plugin - 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 WordPress Discord Integration plugin. Then click on save changes button.
  • WordPress discord plugin - 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.
  • WordPress discord plugin - discord sso integrator - copy client credentials

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


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. Click on save & Test Configuration button.
  • WordPress discord plugin - discord sso integrator - test configuration
  • You will see all the values returned by discord to WordPress in a table.
  • WordPress discord plugin - discord sso integrator - test result

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


3. Setup A discord server and discord bot into Discord integrator  WordPress discord plugin - 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.
    • WordPress discord plugin - discord sso integrator -
    • Copy the Token and keep it handy as we will require it later while configuring Bot Token in Discord Integrator plugin.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - 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].


      WordPress discord plugin - 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.
    • WordPress discord plugin - discord sso integrator -
      WordPress discord plugin - 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.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - discord sso integrator -

4. Enable the connect with discord button after the user logged in  WordPress discord plugin - 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.
  • WordPress discord plugin - discord sso integrator -
    WordPress discord plugin - discord sso integrator -

5. Map Discord roles to WordPress  WordPress discord plugin - 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.
  • WordPress discord plugin - 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.
  • WordPress discord plugin - map the roles -

6. Map WordPress roles to Discord  WordPress discord plugin - 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.
  • WordPress discord plugin - 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.
  • WordPress discord plugin - role mapping -

7. Membership/Subscription based Role Mapping WordPress discord plugin - 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.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - 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.
    • WordPress discord plugin - role mapping -

With WordPress Discord Plugin 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
Contact miniOrange Support
success

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com