Microsoft Entra ID OAuth SSO Setup

Last updated on
19 February 2026

This document will help you configure Microsoft Entra ID or Azure AD as an OAuth provider making Drupal as an OAuth client. Following these steps will allow you to configure OAuth SSO between Microsoft Entra ID and your Drupal site such that your users will be able to log in to your Drupal site using their Microsoft Entra ID 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.

 Download  Know more

Prerequisite:

Setup Video: 

 Drupal Oauth Azure AD Youtube Video

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.  (/admin/config/people/mo-oauth-client/mo-client-config)

    Drupal OAuth OIDC SSO Login - Configuration -> Click on miniOrange OAuth Client Configuration

  • In the Manage section, under the Client Configuration tab, click on the + Add New button to configure the desired OAuth Client.

    Drupal-Microsoft-Entra-ID-OAuth-Client-latest-Click-Add-New-button

  • Select Microsoft Entra ID (Azure AD) from the Select Application dropdown.
  • Enter the Application name in the Custom App Name text field. For example, Microsoft Entra ID (Azure AD).
  • Copy the Callback/Redirect URL and keep it handy.

    Drupal OAuth OIDC SSO Login - 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 on the Settings tab.

    Drupal-Microsoft-Entra-ID-OAuth-Client-latest-check-Enforce-HTTPS-Callback-URL

Configure OAuth SSO Application in Microsoft Entra ID:

  • Login into your Microsoft Entra ID portal.
  • Select Microsoft Entra ID from the Azure services section.

    Drupal OAuth Client Select Microsoft Entra ID

  • Click on the +Add link, then select App Registration from the dropdown menu.

    Microsoft Azure as OAuth/OpenID Provider - Click on App Registration

  • On the Register an Application page, enter the required information:
    • Name: Enter the Application Name, for example, Drupal.
    • Supported account types: Select the 1st option - Accounts in this organizational directory only (Test only - Single tenant). If you are not sure what to choose, you can click on the Help me choose link.
    • Under the Redirect URI (optional) from the Select a platform dropdown select Web and paste the previously copied Callback URL under the text field next to the dropdown.

      Microsoft Azure - On the Register an Application, enter the Name and select Supported account types

  • Once done, click on the Register button.

Integrating Drupal with Microsoft Entra ID:

  • From the Microsoft Entra ID portal, copy the Application (client) ID.

    Microsoft Azure OAuth Single Sign-On - Copy the Application (client) ID

  • Navigate to the Drupal site and paste the copied Application(client) ID into the Client ID text field.

    Drupal OAuth & OpenId Connect Login - Paste it into the Client Id text field

  • Again, go back to the Microsoft Entra ID portal.
  • Click on Add a certificate or secret link.

    Microsoft Azure Portal - Click on Add a certificate or secret

  • Then, click on the New client secret button.
  • In the Add a client secret, enter the Description, and select duration of the certificate from the Expires dropdown. Click on the Add button.

    Microsoft Azure OAuth SSO Login - Click on New client secret button

  • Copy the Value from the Client secrets tab, this is your Client Secret key.

    Microsoft Azure OAuth SSO Login, Copy the Value from the Client Secrets tab

  • Then, navigate to the Drupal site and paste the copied Client secret value into the Client Secret text field.

    Drupal OAuth OpenId Connect SSO Login - Paste the copied value into the Client Secret text field

  • Go back to the Microsoft Entra ID portal and navigate to the Overview tab.

    Microsoft Azure Portal - Click on Overview

  • Under the Essentials section, copy the Directory (tenant) ID.

    Microsoft Azure Portal - Copy the Directory (tenant) ID

  • Navigate to the Drupal site and replace the copied Directory (tenant) ID with the {tenant-id} in the Authorization Endpoint and Access Token Endpoint text field. Once done, click on the Save Configuration button.

    You can also refer to the Microsoft Entra ID Endpoints and Scope from the table given below:

    Scope openid email profile
    Authorize Endpoint: https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/authorize
    Access Token Endpoint: https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token
    Get User Info Endpoint: https://graph.microsoft.com/oidc/userinfo

    Drupal OAuth/OIDC SSO Login - Replace it tenant-ID into the Authorize Endpoint and Access Token Endpoint

  • The Send Client ID and Secret in 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.
  • Check the checkbox to Enable Login with OAuth, scroll down, and click the Save Configuration button.

    /Drupal-Microsoft-Entra-ID-OAuth-Client-latest-Save-Configuration

Test Configuration of Drupal with Microsoft Entra ID :

  • After successfully saving the configurations, click on the Perform Test Configuration button to check the connection between Drupal and Microsoft Entra ID (Azure AD).

    Drupal OAuth/OpenID Connect Login - Click on Perform Test Configuration

  • On a Test Configuration pop-up, if you don't have an active session in Microsoft Entra ID on the same browser, you will be asked to sign in to your Azure AD. After successfully logging into Microsoft Entra ID, you will be provided with a list of attributes that are received from the Azure AD.
  • Click the Configure Mappings button..

    Drupal OAuth Client SSO Login - Received Attribute from the Azure AD

  • On the Attribute Mapping tab, please select the Email Attribute and Username Attribute from the dropdown list and click on the Save button.

    Map the Attribute which received from the OAuth Server (Azure) with Drupal Attribute fields

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

Congratulations! You have successfully configured Microsoft Entra ID (Azure AD) as OAuth Provider and Drupal as an 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 Microsoft Entra ID (Azure AD) 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:

    Drupal OAuth SSO Login - Configure OAuth - Scroll down and see the 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: