Azure AD Single Sign On SSO WordPress End to End Setup | OAuth / OpenID Connect



WordPress OAuth/OpenID Single Sign-On plugin gives the ability to enable OAuth/OpenID Single Sign-On for WordPress. If you want users to log in to your WordPress site using their Azure AD credentials, you can simply do it using our WP OAuth Client plugin. Once you configure the Azure AD with WordPress plugin, you can allow users to SSO to your WordPress site using Azure AD. 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 Azure Active Directory as OAuth Provider

  • Sign in to Azure portal.
  • Click on App Services and go to Manage Azure Active Directory.
  • OAuth/OpenID/OIDC Single Sign On (SSO), AzureAD SSO Login
  • In the left-hand navigation pane, click the App registrations service, and click New registration.
  • OAuth/OpenID/OIDC Single Sign On (SSO), AzureAD SSO App-Registration
  • When the Create page appears, enter your application's registration information:
  • Name : Name of your application.
    Application type :
    1. Select "Web app / API" for client applications and resource/API applications that are installed on a secure server. This setting is used for OAuth confidential web clients and public user-agent-based clients. The same application can also expose both a client and resource/API.
    Sign-on URL :
    1. For "Web app / API" applications, provide the base URL of your app. eg, https://<domain-name> might be the URL for a web app running on your local machine. Users would use this URL to sign in to a web client application.
  • When finished, click Register. Azure AD assigns a unique Application ID to your application. Copy Application ID and the Directory ID , this will be your Client ID and Tenent ID.
  • OAuth/OpenID/OIDC Single Sign On (SSO), AzureAD SSO Overview
  • Go to Certificates and Secrets from the left navigaton pane and click on New Client Secret. Enter description and expiration time and click on ADD option.
  • OAuth/OpenID/OIDC Single Sign On (SSO), AzureAD SSO secret-Key
  • Copy value. This will be your Secret key.
  • OAuth/OpenID/OIDC Single Sign On (SSO), AzureAD SSO Secret-Key-2
  • Enter application Home page URL Logout Settings->Properties->Logout URL.

  • Azure AD Endpoints and Scope:

    Scope: openid
    Authorize Endpoint: https://login.microsoftonline.com/tenant-id/oauth2/authorize
    Access Token Endpoint: https://login.microsoftonline.com/tenant-id/oauth2/token
    Get User Info Endpoint: https://login.windows.net/common/openid/userinfo

Step 2: Setup WordPress as OAuth Client

  • Go to Configure OAuth tab and configure App Name, Client ID, Client Secret, Tenant ID from provided Endpoints
  • openid is already filled but if it doesn't work then configure scope as User.Read and for fetching group info use scope is Directory.read.all.
  • Click on Save Settings to save the configuration.
  • login with azure ad

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.
    • wordpress sso-14
    • You will see all the values returned by your OAuth Provider to WordPress in a table. If you don't see value for First Name, Last Name, Email or Username, 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.
    • wordpress sso

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 WordPress Left Panel > Appearances > Widgets.
    • Select "miniOrange OAuth". Drag and drop to your favourite location and save.
    • jira sso-16
    • Open your Wordpress page and you can see the login button there. You can test the SSO now.