WHMCS OAuth SSO Setup

Last updated on
24 April 2025
This document will help you configure WHMCS as an OpenID Provider making Drupal as an OAuth Client. Following these steps will allow you to configure OAuth/OpenID SSO between WHMCS and your Drupal site by allowing your users to login to your Drupal site using their WHMCS credentials.

We provide Drupal OAuth & OpenID Connect Login - OAuth2 Client SSO Login module which is compatible with Drupal 7, Drupal 8, Drupal 9, Drupal 10, and Drupal 11.

 Prerequisite:

Steps to configure Drupal as OAuth Client:

  • Once you have installed the module, go to the Configuration tab, and click on the miniOrange OAuth Client Configuration.

    Configuration-Drupal-Click-on-minOrange-OAuth-Client-Configuration

  • Provide the following information into the Configure OAuth tab: 
    • Select Custom OAuth 2.0 Provider as the OpenID Provider from the Select Application drop-down. Also, if you don't see your Application/Provider in the Select Application drop-down, you can select Custom OAuth 2.0 Provider.
    • Copy the Callback/Redirect URL and keep it handy.

      If your provider only supports HTTPS Callback/Redirect URLs and you have an HTTP site, please make sure to enable the 'Enforce HTTPS Callback URL' checkbox at the bottom of the tab.

    • Enter the WHMCS as the Application name in the Display Name text-field.

      Drupal-OAuth-OIDC-Client-Configuration-Provide-the-required-information

Configure OAuth/OpenID SSO Application in WHMCS:

  • Go to your WHMCS domain and log into your WHMCS Administrator account.
  • The following screen will be shown to you. Go to Setup on the navigation bar on top.

    whmcs as openid provider - click on the setup

  • Select the OpenID Connect option from the Setup dropdown menu.

    WHMCS%20OpenID%20Signle%20Sign-On%20-%20Select%20OpenID%20Connect%20option

  • Click on the Generate New Client API Credentials button.

    WHMCS%20OpenID%20Signle%20Sign-On%20-%20Click%20on%20Generate%20New%20Client%20API%20Credentials

  • After clicking the Generate New Client API Credentials button, you will be directed to an app details page and provide the required details in below screen:
    • Enter the Drupal as the Application name in the Name text-field.
    • Provide a Description of your application.
    • Paste the Callback/Redirect URL into the Authorized Redirect URIs text-field.

      WHMCS%20OpenID%20Signle%20Sign-On%20-%20Under%20create%20new%20API%20client%20credentials%2C%20provide%20details

  • Click on the Generate Credentials button.

Drupal integration with WHMCS:

  • WHMCS assigns a unique Application ID to your application. 
  • Copy the Client ID and Client Secret from the Client API Credentials section and keep it handy.

    WHMCS%20OpenID%20Signle%20Sign-On%20-%20Copy%20the%20clientid%20and%20client%20secret

  • In Drupal's Configure OAuth tab, paste the copied Client ID into the Client ID text-field and the Client Secret into the Client Secret text-field.

    Drupal-OAuth-OIDC-Client-Configuration-paste-the-copied-Client-ID-and-Client-Secret-into-the-fields

  • In the screen below, provide the Endpoints and Scope:

    Scope openid profile email
    Authorize Endpoint https://{yourWHMCSdomain}/oauth/authorize.php
    Access Token Endpoint https://{yourWHMCSdomain}/oauth/token.php
    Get User Info Endpoint https://{yourWHMCSdomain}/oauth/userinfo.php?access_token=
  • The Send Client ID and Secret in checkbox allow you to specify whether the Client ID and Secret should be included in the header or the body of the Token Endpoint Request. If you're unsure which option to select, you can stick with the default settings. Click on the Save Configuration button.

    Drupal-Azure-AD-OAuth-Client-Select-Header-or-Body

Test Configuration of Drupal with WHMCS:

  • After successfully saving the configurations, now click on the Perform Test Configuration button to check the Single Sign-On (SSO) connection between Drupal and WHMCS.

    Drupal-OAuth-OIDC-Client-Configuration-Click-on-Perform-Test-configuration-button

  • On a Test Configuration popup, if you don't have an active session in WHMCS on the same browser, you will be asked to sign in to your WHMCS account. After successfully logging into WHMCS account, you will be provided with a list of attributes that are received from the WHMCS.
  • Select the Email Attribute from the dropdown menu in which the user's email is obtained and click the Done button.

    Drupal-OAuth-SSO-Login%20-%20Get%20the%20list%20of%20Attribute%20that%20are%20received%20from%20WHMCS

    Please note: Mapping the Email Attribute is mandatory for your login to work. 

  • After that you will be auto-redirected to Attribute & Role Mapping tab. Under this tab, copy the attribute name that contains the username and paste it into the Username text field.

    Drupal-OAuth-Client-WHMCS-Select-Username-Attribute-Save-Configuration

Congratulations! You have successfully configured WHMCS as OAuth/OpenID Provider and Drupal as OAuth Client.

How to perform the SSO login?

  • Now, open a new browser/private window and go to your Drupal site login page.
  • Click on the Login using WHMCS link to initiate the SSO from Drupal.
  • If you want to add the SSO link to other pages as well, please follow the steps given in the image below:

    Instruction-to-add-login-link-to-different-pages-in-your-drupal-site

Contact our 24*7 support team

Feel free to reach out to our Drupal experts if you need any sort of assistance in setting up OAuth2 Client SSO Login on your Drupal site.

 Get In Touch With Us Join Our Slack Channel

back to top Back to top

Help improve this page

Page status: No known problems

You can: