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.
For "Web app / API" applications, provide the base URL of your app.
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.
Go to API permissions from the left navigaton pane and click on Add permissions.
Click on Office 365 and add permission.
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.
Copy value. This will be your Secret key.
Enter application Home page URL Logout Settings->Properties->Logout URL.
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.
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.
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.
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.
Open your Wordpress page and you can see the login button there. You can test the SSO now.