Step by Step Guide to Configure Azure AD B2C as an OAuth/OIDC Server for Drupal

miniOrange OAuth/OpenID module for Drupal gives the ability to enable OAuth/OpenID Single Sign On for your Drupal site. The Drupal OAuth Client module is compatible with all the OAuth/OpenID Providers. Here we will go through a guide to configure SSO between Drupal and Azure AD B2C. By the end of this guide, Azure AD B2C users should be able to login and register to your Drupal site.
If you have any doubts or queries you can contact us at We will help you to configure the module.

Step 1: Steps to configure Azure B2C as oauth provider

  • Go to and sign up/login in your Azure portal.
  • Create a new tenant: You can do so by following the below given steps:

    1. Click on Create a resource.
    2. Search for Azure Active Directory B2C.
    3. Select and scroll down unti you find an option to Create a new B2C Tenant without Subscription.
    4. Click on it to create a new tenant.
  • Drupal OAuth OpenID OIDC Single Sign On (SSO) Azure AD B2C SSO Login Everything Search Azure Active Directory B2C
  • Select Create a new Azure AD B2C Tenant and enter the following data in their respective text fields:

    1. Organization name
    2. Initial Domain name
    3. Select your Country or Region
  • Click on the Save button to create a new tenant.
  • Drupal OAuth OpenID OIDC Single Sign On (SSO) Azure AD B2C SSO Create A New Azure AD B2C Tenant
  • Click on the following message to manage your directory: “Click here to manage your new directory”
  • Drupal OAuth OpenID OIDC Single Sign On (SSO) Azure AD B2C SSO Click here to Manage Your New Directory
  • Click on Applications and then on Add option to add a new application.
  • Drupal OAuth OpenID OIDC Single Sign On (SSO) Azure AD B2C SSO Click On Application Select Add Option
  • Enter a name for your application under the Name text field.
  • Select Yes from the options in front of Web APP/Web API and Yes from options in front of Allow Implicit Flow. Also, copy the Redirect/Callback URL from the miniOrange OAuth Client plugin and save it under the Reply URL textbox.
  • Click on the Create button to create your application. (Refer to the image below)
  •   Please Note: Your Callback/ Redirect URl should be https only and not http .

    Drupal OAuth OpenID OIDC Single Sign On (SSO) Azure AD B2C SSO New Application Enter Callback Redirect URL Only Https
  • Click on the Applications option under the Manage Menu in the left navigation bar and you will find your application listed there. Click on your application
  • Drupal OAuth OpenID OIDC Single Sign On (SSO) Azure AD B2C SSO Click On Application Under Manage Menu Find Your Application
  • Copy your Application ID and save it under your Client ID textbox in your miniOrange OAuth Client plugin. Then, click on the Keys option to generate a key
  • Drupal OAuth OpenID OIDC Single Sign On (SSO) Azure AD B2C SSO Application ID Save to Client ID In miniOrange OAuth Client Plugin
  • Click on the Generate Key option and save it with a name. Click on the Save option and it will generate a random string which you will store as Client secret in your miniOrange OAuth Client plugin.
  • Drupal OAuth OpenID OIDC Single Sign On (SSO) Azure AD B2C SSO Click On Generate Key Option And Save
  • Now, go to your dashboard and go to Azure Active Directory Properties. Copy the Directory ID and substitute this value whenever you need to enter Tenant ID in endpoint URLs in the miniOrange OAuth Client(given below).
  • Drupal OAuth OpenID OIDC Single Sign On (SSO) Azure AD B2C SSO Azure Active Directory Properties Copy Directory ID
    Authorize Endpoint :[tenant-id]/oauth2/v2.0/authorize
    Access Token Endpoint :[tenant-id]/oauth2/token
    Get User Info Endpoint :
  • You have successfully completed your Azure AD B2C OAuth Server side configurations.

Step 2: Configure miniOrange Drupal OAuth Client module.

  • Login in your Drupal site’s admin console and click on Extend from the top navigation bar.
  • Select the Install new module option to install a new module on your Drupal site.
  • Drupal OAuth Client module - Install
  • Upload the downloaded zip file of the Module and click on the Install button to continue.
  • Drupal OAuth Client module - Upload
  • Select Enable newly added modules.
  • Drupal OAuth Client module - Update manager
  • Scroll down till you find miniOrange OAuth Client. Click on the checkbox next to it and click on the Install button to enable the module.
  • Drupal OAuth Client module - Enable module
  • Click on Configuration from the top navigation bar and Select Drupal OAuth client Configuration.
  • Drupal OAuth Client - Configuration
  • Click on the Configure OAuth Client tab and select your OAuth Provider from the Select Application dropdown. In case you do not find your OAuth Provider listed in the dropdown, please select Custom OAuth Provider and continue.
  • Drupal OAuth Client - Configure module
  • Enter your OAuth Provider information in their respective fields and click on the Save button to continue. Also, copy the Callback/Redirect URL and save it on your OAuth Provider.
  • Drupal OAuth Client - Configure OAuth tab
  • Now click on the Test Configuration option. This Test Configuration link will give you the list of the attributes that are coming from your OAuth Provider.
  • Copy the email and the name attributes and save them under the Attribute & Role Mapping tab in the Email Attribute and Name Attribute text field respectively.
  • Please note: This step is mandatory for your login to work. Click on the Save button on the bottom of the page to save your attribute configurations.

    Drupal OAuth Client Attribute Mapping
  • If your OAuth Provider supports only HTTPS Root URL or Base URL (for eg. Azure, Azure B2C) you can change it under Sign In Settings tab.
  • Drupal OAuth Client Redirect URL
  • Now logout and go to your Drupal site’s login page, you will automatically find a Login withYour OAuth Provider link there. If you want to add your login link to other pages as well, please follow the steps given in the below image:
  • Drupal OAuth Client login link
  • If you want to check out our complete list of features and our various licensing plans, you can go to the Upgrade Plan tab in the module.
  • If you want to purchase any of the paid version of the module, you have to register/login with us in Register/Login tab.
  • Still, if you are facing any difficulty or if you have any questions in mind, you can reach out to us by submitting a query in the Support tab of a module or by sending us a mail at
  • Congratulations, you have successfully configured the miniOrange Drupal OAuth Client module.