Search Results :

×

Configure Azure AD Single Sign-On (SSO) WordPress OAuth – Azure AD SSO

Configure Azure AD Single Sign-On (SSO) WordPress OAuth – Azure AD SSO


Set up Single Sign-On (SSO) on your WordPress website via the Azure AD WordPress SSO using our WordPress OAuth & OpenID Connect Single Sign-On plugin. Implementing Azure AD SSO allows users to log into your websites and applications with a single set of credentials using the enterprise-level Azure AD OAuth provider.

Azure AD, or Active Directory, acts as the OAuth Provider and WordPress acts as the OAuth Client. WordPress Azure AD SSO provides smooth login between these two, removing the need to remember usernames and passwords.

The Azure AD OAuth WordPress plugin also provides advanced SSO features like user profile attribute mapping, role mapping, and Azure multi-tenant login and providing site access based on organization email domains. You can also protect your complete WordPress site behind Azure AD SSO. Azure Active Directory WordPress OAuth SSO plugin secure’s the user’s login process and improves user authentication authority. Follow the steps in the guide below to install this plugin.


WordPress Azure Integration


WordPress Azure integration provides functionality to manage all the user operations from your WordPress site.[Sync user profile from WordPress to Azure]

Click here

Prerequisites: Download and Installation

  • Log into your WordPress instance as an admin.
  • Go to the WordPress Dashboard -> Plugins and click on Add New.
  • Search for a WordPress OAuth Single Sign-On (SSO) plugin and click on Install Now.
  • Once installed click on Activate.


Steps to configure Azure AD Single Sign-On (SSO) Login into WordPress

1. Setup Azure Active Directory as OAuth Provider

  • Sign in to Azure portal.
  • Select Azure Active Directory.
  • WordPress Azure AD Single Sign-on (SSO) - Login
  • In the left-hand navigation panel, click the App registrations service, and click New registration.
  • WordPress Azure AD Single Sign-on (SSO) - App-Registration
  • Configure the following options to create a new application.
    • Enter a name for your application under the Name text field.
    • In supported account types, select 3rd option ‘Accounts in any organizational directory (for authenticating user with user flows).
    • In the Redirect URI section, select the Web application and enter the Callback URL from the miniOrange OAuth Client plugin (Configure OAuth tab) and save it under the Redirect URL textbox.
    • Click on the Register button to create your application.
    • Azure AD B2C Single Sign-on (SSO) - Create
  • Azure AD assigns a unique Application ID to your application. The Application ID is your Client ID and the Directory ID is your Tenant ID, keep these values handy as you will need them to configure the miniOrange OAuth Client plugin.
  • WordPress Azure AD Single Sign-on (SSO) - Overview
  • Go to Certificates and Secrets from the left navigaton panel and click on New Client Secret. Enter description and expiration time and click on ADD option.
  • WordPress Azure AD Single Sign-on (SSO) - secret-Key
  • Copy the secret key "value" and keep the value handy it will be required later to configure Client Secret under the miniOrange OAuth Client Plugin.
  • WordPress Azure AD Single Sign-on (SSO) - Secret-Key-2

You've successfully configured WordPress SSO using Azure Ad as OAuth Provider on your WordPress site, allowing users to use Azure AD SSO login into the WordPress site with their Azure AD login Credentials.

2. Setup WordPress as OAuth Client


  • Go to Configure OAuth tab and click Add New Application to add a new client application into your website.
  • WordPress Azure AD Single Sign-on (SSO) - Add new application
  • Choose your Application from the list of OAuth / OpenID Connect Providers, Here Azure AD
  • WordPress Azure AD Single Sign-on (SSO) - Select Application
  • Copy the Callback URL to be used in OAuth Provider Configuration. Click Next.
  • WordPress Azure AD Single Sign-on (SSO) - Callback URL
  • If you want to allow SSO from Azure AD single-tenant into your WordPress site then configure App name & Tenant ID found from the Azure Active directory (AAD) SSO application. For the Scopes & Endpoints click here.
  • Looking for setting up Login flow for Multi-tenant Microsoft Azure Application? Please click here.


    WordPress Azure AD Single Sign-on (SSO) - Add App name, TenantID

    OR

  • If you want to allow login into your wordpress site from any Azure AD tenant, then enter the tenant value as 'common' in the plugin configuration and Click Next. For the Scopes & Endpoints click here. (refer to the below image)
  • WordPress Azure AD Single Sign-on (SSO) - Add App name, TenantID
  • Enter the Client Credentials like Client ID & Client Secret as shown in the setup dialogue box, openid is already filled. Click Next.
  • WordPress Azure AD Single Sign-on (SSO) - Client ID & Client Secret
  • Click on Finish to save the configuration.
  • WordPress Azure AD Single Sign-on (SSO) - Finish configuration

You have successfully configured WordPress as OAuth Client for achieving user authentication with Azure AD Single Sign-On (SSO) login into your WordPress Site.


miniorange img WordPress User Profile/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 Azure AD Single Sign-on (SSO) - OAuth 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 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 Azure AD Single Sign-on (SSO) - WordPress Attribute Mapping

3. Azure AD Profile/Groups Mapping

  • Go to Application → Select the application where you want to configure the group mapping. Now, Go to the API Permissions tab.
  • WordPress Azure AD Single Sign-on (SSO) - API Permissions
  • Click on the Add permission button, and then Microsoft Graph API -> Delegated Permissions and select openid, Profile scope and click on the Add Permissions button.
  • WordPress Azure AD Single Sign-on (SSO) - Request API Permissions
  • Click on the Grant consent for Demo button.
  • Go to Manifest tab and find groupMembershipClaims and changes it’s value to "All" and click on the save button.
  • WordPress Azure AD Single Sign-on (SSO) - Group Membership Claims
  • Now you would be able to get the group's value in the Test configuration window.
  • WordPress Azure AD Single Sign-on (SSO) - Group Mapping Test Configuration
  • You can follow the role mapping section to map the groups to WordPress users while Azure AD SSO.

WordPress Azure AD Single Sign-on (SSO) WordPress Groups/Profile Mapping [Premium]

  • Go to the Attribute Mapping section in the plugin and map the Attribute Names from the Test Configuration table. Make sure Enable Role Mapping option is enabled and click on the Save Settings button. (Refer to the screenshot)
  • WordPress Azure AD Single Sign-on (SSO) - attribute mapping
  • Scroll down and go to the Role Mapping section, you need to map Group Attribute Name. Select the attribute name from the list of attributes that return the groups from the test configuration table of Azure AD.
    Eg:Groups
  • WordPress Azure AD Single Sign-on (SSO) - role mapping
  • Assign the WordPress role to the Provider Groups: Based on the Azure AD application, you can allocate the WordPress role to Azure AD Groups. Add the Azure AD group's value under Group Attribute Value and assign the required WordPress role in front of it under WordPress Role.
    For example, in the below image. Group value has been assigned the role of Subscriber.
  • WordPress Azure AD Single Sign-on (SSO) - role mapping
  • Once you save the mapping, the Azure AD group will be assigned the WordPress Subscriber role after SSO.
    Example: As per the given example, a User with group value will be added as a administrator .

WordPress Azure AD Single Sign-on (SSO) Azure AD Claim Mapping [Premium]

  • Go to your application in Azure Active Directory (AAD) and select Token configuration from the left menu.
  • Click on Add optional claim and then select ID from the right section.
  • Now choose all the attributes you want to fetch while SSO (e.g family_name, given_name, etc) and click on Add button.
  • You might see a popup to Turn on the Microsoft Graph profile permission (required for claims to appear in token), enable it, and click on Add button.
  • WordPress Azure AD Single Sign-on (SSO) - Custom Attribute Mapping

4. Steps to fetch additional user attributes from Azure

  • Sign into Azure Portal.
  • Select Azure Active Directory.
  • In the left-hand navigation panel, click the Enterprise applications.
  • WordPress Azure AD Single Sign-on (SSO) - Click Enterprise Applications
  • Select your Azure Enterprise Application.
  • Then select the Single sign-on option in the left-hand menu and open the Attributes & Claims section.
  • WordPress Azure AD Single Sign-on (SSO) - Select your App
  • Click on Add new claim.
  • WordPress Azure AD Single Sign-on (SSO) - Select your App
  • Then configure the required fields as below:
  • Name : As per your choice (this will be your Attribute name)
    Source: Attribute
    Source attribute: For eg: search for user.department in the dropdown
    WordPress Azure AD Single Sign-on (SSO) - Select your App
  • Go to your application Manifest, and set "acceptMappedClaims": true
  • WordPress Azure AD Single Sign-on (SSO) - Select your App
  • After following the above steps, you can create multiple claims as per your requirements.
  • Please try to perform the Test Configuration in the WordPress miniOrange plugin. You'll get a new attribute as shown below:
  • WordPress Azure AD Single Sign-on (SSO) - Select your App

5. SSO Login button Configuration

  • The settings in Single Sign-On (SSO) Settings tab define the user experience for Single Sign-On (SSO). To add a Azure AD login widget on your WordPress page, you need to follow the below steps.
    • Go to WordPress Left Panel > Appearances > Widgets.
    • Select miniOrange OAuth. Drag and drop to your favourite location and save.
    • WordPress Azure AD Single Sign-on (SSO) - WordPress create-newclient login button setting
    • Go to WordPress Left Panel > Appearances > Widgets.
    • Select miniOrange OAuth. Drag and drop to your favourite location and save.
    • WordPress Azure AD Single Sign-on (SSO) - WordPress create-newclient login button setting
    • Open your WordPress page and you can see the Azure AD SSO login button there. You can test the Azure AD Single Sign-On (SSO) now.
    • Make sure the "Show on login page" option is enabled for your application. (Refer to the below image)
    • WordPress Azure AD Single Sign-on (SSO) - WordPress create-newclient login button setting
    • Now, go to your WordPress Login page. (Eg. https://< your-wordpress-domain >/wp-login.php)
    • You will see an Azure AD SSO login button there. Once you click the login button, you will be able to test the Azure AD Single Sign-On (SSO).
    • WordPress Azure AD Single Sign-on (SSO) - WordPress create-newclient login button setting

6. Scope & Endpoints

  • Please refer the below scope & endpoints table to allow SSO from Azure AD single-tenant into your WordPress site.
  • 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/<tenant-id>/openid/userinfo
    Custom redirect URL after logout:[optional] https://login.microsoftonline.com/<tenant-id>/oauth2/logout?post_logout_redirect_uri=<your URL>
  • Please refer the below scope & endpoints table to allow SSO from any Azure AD tenant into your WordPress site.
  • Scope: openid
    Authorize Endpoint: https://login.microsoftonline.com/common/oauth2/authorize
    Access Token Endpoint: https://login.microsoftonline.com/common/oauth2/token
    Get User Info Endpoint: https://login.windows.net/common/openid/userinfo
    Custom redirect URL after logout:[optional] https://login.microsoftonline.com/common/oauth2/logout?post_logout_redirect_uri=<your URL>

Azure AD Single Sign-On (SSO) should now be successfully configured with Azure AD as the OAuth Provider and WordPress as the OAuth Client. Azure AD SSO should fulfill all your needs with features like multi-factor authentication, multiple grant type support, attribute mapping, role mapping, etc. You can also protect your complete WordPress site behind Azure AD SSO.. Otherwise, you can also configure other IDPs like Azure B2C, Office 365 (Microsoft 365), WindowsLive, custom providers, and more with this plugin just like Azure AD SSO.


Troubleshooting

invalid_request

To fix this issue, please configure the correct Authorization Endpoint in the plugin. You can confirm the correct format of the endponit from here.

invalid_client

To fix this issue, please configure the correct Client Secret in the plugin. You can refer to this step to configure correct client secret in the setup guide.

invalid_resource

To fix this issue, please configure the 'common' endpoints in the plugin or add user in the tenant . You can refer to this setup guide to configure the common endpoints.

AADSTS50011

To fix this issue, please configure the correct Redirect URL in the Azure AD Developer application from the plugin. You can refer to this steps in the setup guide.

If your error is not listed here, click here to see others.

Frequently Asked Questions (FAQs)


How to achieve Azure AD SSO with guest users outside of your Azure directory?

In WordPress OAuth Client SSO plugin, Select your Configured Azure Ad application and in the field of Azure AD Tenant, replace the current tenant id with ‘common’ as shown in the below screenshot. Now users from any Azure directory will be able to perform Azure AD SSO and also users with personal Microsoft accounts can login. Read more

Azure AD SSO isn’t working due to admin permission issues from the Azure AD end.

Sign in to your Azure portal and select your Azure Active Directory where you have Azure AD SSO. Select Enterprise applications. Read more

How to configure Azure AD password grant with WordPress OAuth Client SSO plugin?

Azure AD recently released OAuth 2.0 endpoints. You need to replace the token endpoint with the one below. You also need to change the grant type to password grant in the dropdown and replace the tenant ID with your Azure AD tenant ID. (Refer to the below image) Read more

Additional Resources


Need Help?

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.



Hello there!

Need Help? We are right here!

support
Contact miniOrange Support
success

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com