UniFi Identity Enterprise - Add Microsoft Office 365 as an SSO App
Add Domain
Note: Microsoft doesn't allow primary or default domains to be set as federated (which is needed to configure it as SAML apps on UniFi Identity Enterprise), you will have to change your default domain to another domain.
- Sign in to the Microsoft Admin Center and enter the Domains page.
- Click Add Domain and then enter the domain name.
- Click Use this domain.
- Select Add a TXT record to the domain’s DNS records.
- Click Continue.
- Use the TXT record provided by Microsoft 365 and add those records to your domain provider.
- Click Verify.
Configurations on UniFi Identity Enterprise
Add Microsoft Office 365
-
Sign in to your Identity Enterprise Manager (https://[your workspace domain].ui.com/cloud).
- Click SSO Apps.
- Click the Add New App icon and you will see all the preconfigured applications.
- Click Add on the Microsoft Office 365 tab.
- Configure SSO Authentication in Microsoft Office 365.
- Scroll down to the Settings section, name the app, and fill in the domain and other required information.
For example:
If your default domain is: example.onmicrosoft.com,
And the added domain is: example-microsoft365.com (where users from this domain need to be assigned at a later stage).
Then:
The Microsoft Tenant Name should be: example.
The Your Office 365 company domain should be: example-microsoft365.com (Default domain is not allowed in this field).
Configurations on Powershell
- Open Powershell as administrator.
- Enter the following command:
Connect-MsolService
- If prompted error says:
- Then enter the following commands in order:
Install-Module MSOnline
Install-Module AzureAD
Import-Module AzureAD
-
After successfully executing the Connect-MsolService command, on the prompted login window enter the Microsoft 365 third-party administrator username and password.
-
Go back to UniFi Identity Enterprise's Add Microsoft Office 365 page to obtain the information needed for the next part.
-
Head back to the Powershell window, and enter the following commands (commands with $ sign need to be executed one at a time):
$dom = " " (replace with the added domain here instead of the default one)
$BrandName = "Sample SAML 2.0 IDP"
$Protocol = "SAMLP"
$LogOnUrl = " " (use the Sign-on URL in the setup instruction)
$LogOffUrl = " " (use your UID domain name with the https:// prefix)
$MyURI = " " (use the Issuer in the setup instruction)
$MySigningCert = " " (use the Public Certificate in the setup instruction, and make sure to copy the public certificate as one continuous line)
- If this is the first time this account is setting up the SAML app on Microsoft 365, and the domain name is not federated. Enter the following command (enter all of the commands in one line):
Set-MsolDomainAuthentication -DomainName $dom -Authentication Federated -FederationBrandName $BrandName -PassiveLogOnUri $LogOnUrl -SigningCertificate $MySigningCert -IssuerUri $MyURI -LogOffUri $LogOffUrl -PreferredAuthenticationProtocol $Protocol
- If this is not the first time that this account has configured the SAML app on Microsoft 365, and the domain name is not federated. Enter this command instead (enter all of the commands in one line):
Set-MsolDomainFederationSettings -DomainName $dom -FederationBrandName $BrandName -PassiveLogOnUri $LogOnUrl -SigningCertificate $MySigningCert -IssuerUri $MyURI -LogOffUri $LogOffUrl -PreferredAuthenticationProtocol $Protocol
- If the domain is already federated, use the below command:
Set-MsolDomainFederationSettings -DomainName $dom -FederationBrandName $BrandName -PassiveLogOnUri $LogOnUrl -SigningCertificate $MySigningCert -IssuerUri $MyURI -LogOffUri $LogOffUrl
- If the user prompted the “Sorry, we are having trouble signing you in” after using the command for the domain that hasn't been federated, use the command for the domain that has been federated instead to try again.
- If the issue persists, you can omit it and continue to configure provisioning on UniFi Identity Enterprise.
Configure Provisioning on UniFi Identity Enterprise
-
Sign in to your Identity Enterprise Manager (https://[your workspace domain].ui.com/cloud).
- Click SSO Apps > Microsoft Office 365.
- Go to the Provisioning > Integration tab and then turn on "Enable API Integration".
- Click on Authenticate to finish setting up the Microsoft 365 SSO app.
- After the authentication, go to Provisioning > Provisioning to App.
- Turn on the "Create Users" toggle and turn off the "Deactivate Users" toggle.
- Unassign and then re-assign existing users access to Microsoft 365 SSO app.