Step 1: Prerequisites
1.1: Sync On-Premise Active Directory with Azure Active Directory
NOTE: If you want to use your On-Premise Active Directory as a user store to Single Sign-On into SharePoint then follow the below steps to sync your AD and Azure AD.
- Download the Azure AD Connect
- Run the Azure AD installer on your domain machine and follow the setup.
1.2: Verify your UPN Domain in Azure Portal
- In the Azure portal navigate to Azure Active Directory >> Custom domain names and click on Add custom domain.
- Enter the full domain name in the right pane that pops up and click on Add domain.

- A new window will open up with TXT/MX records for the domain. You will have to add the resented entry in your domain name registrar.

- Click on verify once you have added the entry
Step 2: Setup a Custom Branded URL in miniOrange Admin Console
Single Sign-On into SharePoint requires a custom branded URL to be set. Access to miniOrange and connected resources will need to be through the custom branded URL in the format: https://<custom_domain>.xecurify.com/moas.
- Login to miniOrange Admin Console.
- Navigate to Customization >> Branding Configuration
- Under Basic Settings, set the Organization Name as the custom domain name. Once that is set, the branded login URL would be of the format https://<custom_domain>.miniorange.com/moas.

- Click on Save.
Step 3: Choose Your User Directory
3.1: Setup AD as User Directory
- Log in to miniOrange dashboard from the Admin Console.
- From the Side Menu, Click on User Stores >> Add User Store

- Select User Store type as AD/LDAP.

- STORE LDAP CONFIGURATION IN MINIORANGE: Choose this option if you want to keep your configuration in miniOrange. If active directory is behind a firewall, you will need to open the firewall to allow incoming requests to your AD.
- STORE LDAP CONFIGURATION ON PREMISE: Choose this option if you want to keep your configuration in your premise and only allow access to AD inside premises. You will have to download and install miniOrange gateway in your premise.

- Enter LDAP Display Name and LDAP Identifier of your choice. Select Directory Type as Active Directory.
- Enter the LDAP Server URL or IP Address against LDAP Server URL field.
- Go to AD FS-> Domain-> respective Users -> Properties-> Attribute Editor. Now copy the value of distinguishedName and paste it against Bind Account DN.

- Enter the valid password for the user from above step.
- Search Base is the location in the directory where the search for a user begins.

- If you want to add extra conditions on user search you can add it in Search Filter. Select a suitable Search Filter from the Drop-Down. To use custom Search Filter select "Custom Search Filter" option and provide the search filter in the input field that shows up.

- You can also configure following options while setting up AD.

Here's the list of the attributes and what it does when we enable it. You can enable/disable accordingly.
Attribute |
Description |
Activate LDAP |
All user authentications will be done with LDAP credentials if you Activate it |
Sync users in miniOrange |
Users will be created in miniOrange after authentication with LDAP |
Backup Authentication |
If LDAP credentials fail then user will be authenticated through miniOrange |
Allow users to change password |
This allows your users to change their password. It updates the new credentials in your LDAP server |
Enable administrator login |
On enabling this, your miniOrange Administrator login authenticates using your LDAP server |
Show IdP to users |
If you enable this option, this IdP will be visible to users |
Send Configured Attributes |
If you enable this option, then only the attributes configured below will be sent in attributes at the time of login |
- Enable Send Configured Attributes and configure "objectguid" in both the text boxes that appear

- Click on Save. After this, it will show you the list of User stores. Click on Test Configuration to check whether you have enter valid details. For that, it will ask for username and password.

- On Successful connection with LDAP Server, a success message is shown.

- Click on Test Attribute Mapping.

- Enter a valid Username. Then, click on Test. Mapped Attributes corresponding to the user are fetched.

- After successful Attribute Mapping Configuration, go back to the ldap configuration and enable Activate LDAP in order to authenticate users from AD/LDAP.
Refer our guide to setup LDAPS on windows server.
3.2: Setup miniOrange as a User Store
- Log in to miniOrange dashboard from the Admin Console.
- There are 3 ways to setup miniOrange as an Identity Source
Step 4: Setup Office 365 - SharePoint in miniOrange
- Login into miniOrange Admin Console.
- Go to Apps >> Manage Apps.

- Click on Add Applicaton button.

- In Choose Application Type click on Create App button in SAML/WS-FED application type.

- In the next step, search for Office 365. Click on Office 365 app.

- Make sure the SP Entity ID or Issuer is: urn:federation:MicrosoftOnline.
- Make sure the ACS URL is: https://login.microsoftonline.com/login.srf.
- Select External IDP Attribute from the dropdown and add objectguid in the text-box that appears.
- Add an attribute with attribute name as IDPEmail and select attribute value as E-mail Address.
- Set the authentication policy. You can choose to enable 2FA for login or have users login using a standard username-password.
- Click on Save to configure Office 365.
- Click on Metadata link to see the Identity Provider information required to configure SharePoint.
In the Window that opens up, click on the metadata link under "INFORMATION REQUIRED TO AUTHENTICATE VIA EXTERNAL IDPS".
Note down the following information.
- IdP Entity ID/Issuer
- Logout URL
- Login URL
- X.509 Certificate

Step 5: Configure Microsoft Online Services
- Open Powershell in Administrator Mode. The Microsoft Online Services module needs to be installed for the below commands to run.
- Install-Module -Name AzureAD
- If prompted about installing a module from an untrusted repository, type Y and press ENTER.
- Install the 64-bit version of the Microsoft Online Services Sign-in Assistant. Download it from here.
- Run the Following command in Powershell to install MSOnline Module : Install-Module MSOnline
- If prompted to install the NuGet provider, type Y and press ENTER.
- If prompted to install the module from PSGallery, type Y and press ENTER.
- Execute the following Powershell commands:
- $cred = Get-Credential. Enter SharePoint Administrator credentials.
- Connect-MsolService -Credential $cred.
- Replace the following information with the one noted in above step:
- Replace ##DOMAIN NAME## by your Active Directory Domain Name. Ensure that the domain is not the default domain name as the default one cannot be set as the federated domain
- Replace ##IDP ENTITY ID## with the IdP Entity ID/Issuer Noted above.
- Replace ##LOGOUT URL## with the Logout URL Noted above.
- Replace ##CERTIFCATE## with the X.509 Certificate Noted above.
Set-MsolDomainAuthentication -Authentication Federated -DomainName ##DOMAIN NAME## -IssuerUri ##IDP ENTITY ID## -LogOffUri "##LOGOUT URL##" -PassiveLogOnUri "##LOGIN URL##" -SigningCertificate "##CERTIFICATE##" -PreferredAuthenticationProtocol SAMLP
You cannot federate your default "onmicrosoft.com" domain. To federate your SharePoint tenant, you must add a custom domain to SharePoint.
Step 6: Now sign in to your Office 365 account with miniOrange IdP by either of the two steps:
1. Using SP initiated login :-
- Go to Office 365-SharePoint Login and click on sign-in
- You will be redirected to Microsoft Online portal. Here you have to enter the UPN of the user.(It should contain the domain that is federated with miniOrange)
- Now you will be redirected to miniOrange IdP Sign On Page.

- Enter your login credential and click on Login. You will be automatically logged in to your SharePoint account.

2. Using IdP initiated login :-
- Login to your miniOrange Self Service Console as an End User and click on the Office 365 icon on your Dashboard.
- Once you click on Office 365 you don't need to enter credentials again you will be redirected to SharePoint account.
For further details refer following Documents :
- Office 365 SSO integration with on-premises environments