Purpose
Federating Microsoft 365 with Practice Protect delivers a seamless and secure single sign-on (SSO) experience. Once federation and provisioning are configured, all Microsoft 365 identities are managed through Practice Protect, and direct login via the Microsoft 365 portal is disabled.
Similar to pass-through authentication, login attempts are validated against your Practice Protect policies. Modern authentication is used for Outlook and Skype for Business 2013 or later, while browser access is redirected to Practice Protect. This enables the use of SmartLinks, allowing users to access Microsoft 365 apps like SharePoint without re-entering credentials.
Federation also unlocks additional security features such as IP-based client access filtering, ideal for limiting access to specific user groups—and built-in multi-factor authentication.
Important: Federation is a domain-wide change. Every active user (excluding shared mailboxes) must have an account in Practice Protect to sign in to Microsoft 365.
Prerequisites
- Administrator Access to your Microsoft 365 Account (Needed to Create Service Account – i.e. [email protected]) You can follow the following guide Create Practice Protect Service Account.
-
Register Microsoft Entra ID application (Token-Authentication)
- Microsoft 365 Cloud Users (Non-Active Directory Sync with Microsoft 365)
- Active Practice Protect User Account. (Once federated, Microsoft 365 users should use Practice Protect Account as their login)
- User login in Practice Protect must matched with their Microsoft 365 User Principal Name.
Instructions
-
-
- Under Core Services Click on Roles –> Click on Add Role –> Type Microsoft 365 Email Integration Users on the Name field, then Click Save.
- With the created role, click on Members > Add. Add each member. Then Save.
- Log in to the Microsoft 365 Portal using the Service Account (Global Admin). Enter the Username and Password then Click Sign in. If you have not set up the Service Account follow this guide.
- Click on Admin to go to the Admin Center.
- In the Microsoft 365 Admin Center, go to Setup > Domains, select the domain ending in .onmicrosoft.com, and click Set as default.
- Under Core Services Click on Roles –> Click on Add Role –> Type Microsoft 365 Email Integration Users on the Name field, then Click Save.
- Return to the Practice Protect Admin Portal, go to Apps & Widgets > Web Apps > Click Add Web Apps, search for Office 365, select Office 365 (WS-Fed + Provisioning), and click Add.
- On the Add Web App page, click Yes.
- In Application Settings, select Token-Based Authentication. Then, enter the Directory ID, Client ID, and Client Secret.
If you do not have these details, refer this guide on how to register an application in Microsoft Entra ID to obtain them. - Click Verify. The domain that we will federated should be on the domain list.
- Under the Advanced settings, paste the script below after line 76. Then Save. This configuration sets the Issuer URI/URN for the SAML token response and identifies the domain that the token is associated with.
var UserMail = LoginUser.Get('userprincipalname');
var URN = UserMail.split("@")[1];
setAttribute('IssuerName', 'URN:' + URN); - Click on Provisioning. Then, tick the box on the side of Enable provisioning for this application.
- On the Warning page tick the box Do not show again then click Close.
- Leave Live Mode selected and tick Enable Hybrid Exchange Support. This means that any changes (on the user details) will be reflected in Microsoft 365.
- Scroll down and go to Sync Options: select the radio button Sync (overwrite) users to target application when existing users are found with the same principal name. Leave the option Do not de-provision (deactivate or delete) users in the target application when the users are removed from the mapped role.
- Under Deprovisioning Rules, Click Add Rule and make sure to add and set the following rules (Event & Deprovisioning Action)
- User Disabled in Active Directory – Leave User Unmodified
- User Deleted in Active Directory – Leave User Unmodified
- User Removed from Role or Provisioning – Leave User Unmodified
NOTE: It is important to set the above rules as any user deleted from Practice Protect will be de-licensed to the user in Microsoft 365.
- Scroll down and go to Role Mappings, Select the radio button User is assigned licenses mapped to each role they are a member of (role order has no effect). Click Add.
- On the License and Attributes page, Select Microsoft 365 Email Integration Users for the Role created in Step 2. Don’t assign any licenses and click Done.
Optional – If you would like to sync licensing you can follow the following guide.
- Click Save.
- Scroll down to Provisioning Script and expand. Replace the existing script with the below Script.
if (isPerson()) {
//country based location e.g. "US" or "AU"
destination.UsageLocation = "AU";
destination.Mail = source.CanonicalizeName;
} -
Then click Save to apply the script.
- Run a manual synchronization. Under Settings go to Users > Outbound Provisioning > Provisioning Enabled Application –> Select Office 365 or Microsoft 365 (depending on the name of the app added), then click on Start Sync.
- View the real-time status of synchronization by clicking on View Synchronization Job Status and Reports. Once the Synchronization is successful and completed for all users, any changes in Practice Protect will be reflected in Microsoft 365.
- Enable ADAL/Modern Authentication in Microsoft 365 through this page – This is to apply the Practice Protect security mechanism in terms of signing in (Geolock, MFA, and other policies) as Basic Authentication doesn’t prompt for Multi-Factor Authentication
- This completes the backend configuration of Microsof 365 Federation with provisioning in Practice Protect.
-
-
Enabling Microsoft 365 Email Integration/Federation
1. Return to the Microsoft tile in the Admin Portal.
-
2. On Permissions, Add the role that contains the user for email integration (i.e. Microsoft 365 Email Integration Users) and click Save to apply. This should display the app on their user portal and can be used once federated.
3. Return to the Application Settings and then on Microsoft 365 Domains section, tick the box beside the Domain(s) Name (i.e. youremaildomain.com) –> Click Actions –> Select Download Powershell Script and save the downloaded file as it will be used in the following steps to federate.
4. Go to the downloaded file from Step 3 and right-click –> click Run with PowerShell. This will prompt you to log in and authenticate. Use the Microsoft 365 Admin Account.
5. With the prompt “What Action Would You Like To Do?” press F. The script will run and federate your domain.
6. Once the script is completed, Go back to Microsoft 365 web app settings in Practice Protect. On the Office 365 Domains section check the Type of the domain (i.e. cbpaccountant.com), It should now be Federated. (Optional) Refresh the page to show the latest state and type.
7. (Optional) Repeat steps 3 to 6 to complete the federation for the other active domains.
8. Test federation if it is working by signing in to a user account in Microsoft 365 Once you type the user name/email address the page will redirect to Practice Protect.
9. To authenticate and access, log in using active Practice Protect account credentials.
10. If you have your Microsoft 365 Email configured on Outlook Desktop or Mobile, you will be prompted to log in with your Practice Protect Account. Most likely it is not synced.
11. Post Federation, Practice Protect recommends disabling legacy protocols/basic authentication (i.e. POP. IMAP, AUTH SMTP) in Microsoft 365. Please see the following guide.