Discord Single Sign-On to WordPress End to End Setup Guide | OAuth / OpenID Connect


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.
  • Once installed click on Activate.

Step 1: Setup Discord as OAuth Provider

  • Log in to Discord Console & click on New Application
  • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO Login 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 General Information section. Copy Client ID & Client Secret.
  • OAuth/OpenID/OIDC Single Sign On (SSO), Discord 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.
  • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO Login Redirect URL

Step 1.1: Discord Role Mapping [Optional]

  • After creating an OAuth Application,go to the Bot section.
  • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO Login Create Oauth Application
  • Click on the Add Bot button.
  • OAuth/OpenID/OIDC Single Sign On (SSO), Discord SSO Login Add Bot OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO Login Confirm Adding Bot
  • 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.
  • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO Login Role Mapping
  • After successfully authorization, Go to the Bot section and copy the token.
  • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO Login Get 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).
  • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO Login miniOrange Role Mapping

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.
  • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO Login miniOrange build id
  • Go to Appearance and enable Developer Mode under the Advanced section, then close User Settings.
  • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO Login miniOrange build id
  • Open your Discord server, right-click on the server name, then select Copy ID.
  • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO Login miniOrange build 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.
  • Scope: identify email
    Authorize Endpoint: https://discordapp.com/api/oauth2/authorize
    Access Token Endpoint: https://discordapp.com/api/oauth2/token
    Get User Info Endpoint:https://discordapp.com/api/users/@me
  • Click on Save Settings to save the configuration.
  • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO save setting

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.
    • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO 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.
    • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO attribute mapping

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.
    • OAuth/OpenID/OIDC Single Sign On (SSO) Discord SSO login button widget
    • Open your Wordpress page and you can see the login button there. You can test the SSO now.

Need Guidance?

Mail us on oauthsupport@xecurify.com 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.