Enable Dual Login
Use this guide if you want to change the default Login / Logout experience of WordPress in combination with the WordPress + Office 365 plugin.
Before you start
- You must already have configured the single sign-on capability of the WordPress + Office 365 plugin.
- You are an Administrator for your WordPress website.
"Sign in with Microsoft" button on login form
Starting with v10.6 all versions will be default display the official "Sign in with Microsoft" button on the login form. Perform the following steps to hide this button.
- Navigate to WP Admin > WPO365 > Login / Logout and check the option to Hide "Sign in with Microsoft" button.
- Scroll down click Save configuration to save your changes.
- Log out from your WordPress website and verify that the Sign in with Microsoft button is no longer shown.
Let users choose how they want to sign in
The WPO365 | LOGIN+ extension (and all the bundles) adds a feature that if enabled and if the request is for a
- Private page / post (see https://docs.wpo365.com/article/36-authentication-scenario and https://docs.wpo365.com/article/38-private-pages for details) or
- WordPress admin page
the plugin will redirect the user to the WordPress login page so the user can choose how he / she wants to sign in.
By default the plugin will always immediately try to sign in the user with Microsoft. Perform the following steps if you would like to let the user choose how he / she signs into your website.
- Navigate to WP Admin > WPO365 > Login / Logout and check the option Dual login.
- Scroll down click Save configuration to save your changes.
- Log out from your WordPress website and navigate to any post or page that is either or a WordPress admin page.
Note When you activate Dual login an additional message is shown just above the login form.
Perform the following steps to hide or customize this message.
- Navigate to WP Admin > WPO365 > Login / Logout and check the option Hide SSO link to hide this message.
- Alternatively navigate to Navigate to WP Admin > WPO365 > ... > Translations and update the text for Dual login.
- On either page, scroll down click Save configuration to save your changes.
- Log out from your WordPress website and navigate to any post or page that is either or a WordPress admin page and verify the outcome.
Note When customizing the Dual Login message you must add (for example) an onclick event handler to a button that invokes the JavaScript method window.wpo365.pintraRedirect.toMsOnline().
Alternatively, you can click the following link to sign into this website with your corporate <span style="cursor: pointer; text-decoration: underline; color: #000CD" onclick="window.wpo365.pintraRedirect.toMsOnline()">network login (Office 365)</span>
When you activate the Dual login option the plugin will try and remember the initial URL the user navigated to before that user is sent to the login page that will show the dual login message. The final page flow for a user in case of dual login therefore is as follows:
- User intends to go to https://www.example.com/my-account/
- Plugin sends user to https://www.example.com/wp-login.php?redirect_to=https://www.example.com/my-account/
- User clicks the Microsoft authentication URL
- User is redirect to https://login.onmicrosoft.com/…
- User is redirected back (by Microsoft) to https://www.example.com/
- Plugin now signs the user in to your website
- User is redirected to https://www.example.com/my-account/