> ## Documentation Index
> Fetch the complete documentation index at: https://help.allthenticate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign in to Microsoft 365 with Allthenticate SAML

> Federate your Microsoft 365 domain to Allthenticate over SAML, sync Entra ID users, and know how it conflicts with Windows certificate sign-in.

Once federated, Microsoft sends your users to Allthenticate to sign in to Microsoft 365 and other Microsoft online services.

> [!WARNING]
>
> **Federating a domain breaks Entra ID certificate sign-in for Windows.** Federation changes the domain's authentication type from **Managed** to **Federated**. Entra ID then sends that domain's users to Allthenticate and never checks their certificate, so [certificate sign-in](https://help.allthenticate.com/windows/entra/certificate-sign-in.md) stops working for them.
>
> * If you use certificate sign-in for Windows, or plan to, don't federate that domain. Certificate sign-in needs only the Microsoft SSO integration, which syncs users and doesn't change how they sign in to Microsoft 365. Follow just [Set up scheduled user syncing](#set-up-scheduled-user-syncing).
> * If you federate the domain, use [passkeys](https://help.allthenticate.com/windows/entra/passkeys.md) for Windows sign-in instead.

## Before you start

* A Microsoft administrator with the **Global Administrator** role.
* PowerShell with the `Microsoft.Graph` module, to federate the domain yourself:

  ```powershell theme={null}
  Install-Module Microsoft.Graph -Scope CurrentUser
  ```

  Allthenticate can configure the domain federation for you instead. Email [help@allthenticate.com](mailto:help@allthenticate.com).
* An **On-premises immutable ID** on every user who will sign in. Microsoft uses it to identify the user. The user sync below assigns missing IDs for you.
* An admin portal account that can manage **SSO** and **Integrations**.

For how Allthenticate works as a SAML identity provider in general, see [SAML single sign-on](https://help.allthenticate.com/help/sso/saml.md).

## Configure in Allthenticate

### Add Microsoft as a service provider

**1. Download Microsoft's metadata**

Download [Microsoft's federation metadata](https://nexus.microsoftonline-p.com/federationmetadata/saml20/federationmetadata.xml) and save it as an `.xml` file.

**2. Add the service provider**

In the admin portal, go to **SSO** > **SAML** and select **Add Service Provider**. Enter a **Provider Name**, check **Use Metadata File**, and upload the `.xml` file.

**3. Apply the Microsoft settings**

Check **Needs Unique IDs** and **Use Office 365 Settings** (see the [Add Service Provider dialog](https://help.allthenticate.com/help/sso/saml.md#register-the-service-provider-in-allthenticate)). The Office 365 settings add the `IDPEmail` attribute (mapped to `user.email`) and the authentication context Microsoft expects for passwordless sign-in.

**4. Save**

Select **Save**. Then open the new service provider from the list and select **Download Public Key** to save `Allthenticate-Public.crt`. You need it to federate the domain.

### Set up scheduled user syncing

The **Microsoft SSO** integration syncs your Entra ID users and groups to Allthenticate on a schedule. When the Microsoft service provider above exists, each sync also assigns an on-premises immutable ID to users who don't have one and records it in Allthenticate, so they can sign in.

**1. Register an app in Entra ID**

In the [Microsoft Entra admin center](https://entra.microsoft.com), open **App registrations**, select **New registration**, give it any name, and select **Register**.

**2. Add the Graph permissions**

On **API permissions**, select **Add a permission** > **Microsoft Graph** > **Application permissions**, and add `User.ReadWrite.All` and `Group.Read.All`. You may need to search for each permission, then open the **User** or **Group** submenu to find it. Select **Grant admin consent for** your organization and confirm.

![Entra ID API permissions page listing Microsoft Graph Group.Read.All and User.ReadWrite.All application permissions, not yet granted, with Add a permission and Grant admin consent buttons](https://mintcdn.com/allthenticate-e69095b0/7yUU7sq9zDstLP_S/images/help/sso/microsoft-online/api-permissions.png?fit=max\&auto=format\&n=7yUU7sq9zDstLP_S\&q=85\&s=3f4da04c7f14afb1004143f4f6fff5e7)

Both permissions added, before admin consent is granted.

Entra ID certificate sign-in needs further read-only permissions on the same app registration. See [certificate sign-in](https://help.allthenticate.com/windows/entra/certificate-sign-in.md).

**3. Create a client secret**

On **Certificates & secrets**, select **New client secret**, enter a description and expiry, and select **Add**. Copy the secret's value now: Entra ID shows it only once. When it expires, create a new one and update the integration.

**4. Copy the app's IDs**

On **Overview**, copy the **Application (client) ID** and the **Directory (tenant) ID**.

**5. Add the integration in Allthenticate**

In the admin portal, go to **Integrations**, select **New Integration**, and choose **Microsoft SSO**. Enter the `tenant_id`, `client_id` and `client_secret`. **Period (Hours)** sets how often the sync runs, every 6 hours by default. Then choose the Entra groups to sync, and whether to sync only users with assigned licenses.

## Configure in Microsoft Entra ID

### Federate the domain

By default your domain's authentication type is **Managed**: Microsoft Entra ID handles sign-in and asks users for their email and password. Federation sets it to **Federated** so Microsoft sends users to Allthenticate instead.

Run these commands in PowerShell as an administrator. To have Allthenticate do this instead, email [help@allthenticate.com](mailto:help@allthenticate.com).

**1. Connect to Microsoft Graph**

```powershell theme={null}
Connect-MgGraph -Scopes "Domain.ReadWrite.All", "Directory.AccessAsUser.All"
```

Sign in with the Global Administrator account when Windows asks. PowerShell prints `Welcome to Microsoft Graph!` when it's connected.

**2. Set the domain and certificate**

Set `$Domain` to the domain in your users' UPNs, and load the certificate you downloaded from the admin portal without its `BEGIN` and `END` lines:

```powershell theme={null}
$Domain = "example.com"
$Cert = (Get-Content .\Allthenticate-Public.crt | Where-Object { $_ -notmatch "CERTIFICATE" }) -join ""
```

**3. Create the federation**

```powershell theme={null}
New-MgDomainFederationConfiguration `
 -DomainID $Domain `
 -IssuerUri "https://saml.allthenticate.com/idpmetadata" `
 -PassiveSignInUri "https://saml.allthenticate.com/ssoentry" `
 -ActiveSignInUri "https://saml.allthenticate.com/ssoentry" `
 -SignOutUri "https://saml.allthenticate.com/logout" `
 -PreferredAuthenticationProtocol "saml" `
 -SigningCertificate $Cert `
 -FederatedIdpMfaBehavior "acceptIfMfaDoneByFederatedIdp" `
 -DisplayName "Allthenticate SAML"
```

If every value is accepted, Microsoft shows a confirmation. Select **Accept**.

![Microsoft Permissions requested dialog for Microsoft Graph Command Line Tools, listing read and write domains and directory access, with Consent on behalf of your organization checked and an Accept button](https://mintcdn.com/allthenticate-e69095b0/7yUU7sq9zDstLP_S/images/help/sso/microsoft-online/graph-permissions.png?fit=max\&auto=format\&n=7yUU7sq9zDstLP_S\&q=85\&s=a433abfe00872af6bc0398308425c16d)

**4. Check the federation**

In the Entra admin center, go to **Entra ID** > **Domain names**. Your domain now shows as **Federated**. To review the settings, run:

![Entra admin center Custom domain names list with a verified custom domain checked as Federated and Primary, and the onmicrosoft.com domain not federated](https://mintcdn.com/allthenticate-e69095b0/7yUU7sq9zDstLP_S/images/help/sso/microsoft-online/domain-federated.png?fit=max\&auto=format\&n=7yUU7sq9zDstLP_S\&q=85\&s=5187c17b5aed484c9f76f2563ba1929b)

A federated domain in Entra ID > Domain names.

```powershell theme={null}
Get-MgDomainFederationConfiguration -DomainId $Domain | fl
```

The output shows the `IssuerUri`, sign-in and sign-out URLs above, and `PreferredAuthenticationProtocol : saml`.

### Check users' immutable IDs

In the Entra admin center, open **Users**, select a user, open **Properties**, and look for **On-premises immutable ID** in the **On premises** section. The user sync fills it in. To set one yourself:

```powershell theme={null}
Update-MgUser -UserId "alex@example.com" -OnPremisesImmutableId "<immutable-id>"
```

No output means it worked. The next sync records the ID in Allthenticate.

## Test sign-in

1. Open `https://myapps.microsoft.com/<your-domain>` in a private browser window.
2. Microsoft sends you to the Allthenticate sign-in page. Approve the request on your phone.
3. When Microsoft asks whether to continue, select **Continue**. The prompt names your own domain.

   ![Microsoft prompt asking whether you trust the federated domain, with Cancel and Continue buttons](https://mintcdn.com/allthenticate-e69095b0/7yUU7sq9zDstLP_S/images/help/sso/microsoft-online/trust-prompt.png?fit=max\&auto=format\&n=7yUU7sq9zDstLP_S\&q=85\&s=9a6a688bb5bfb207fd37aced4d5024fc)

## Related

* [Set up Allthenticate as a SAML identity provider](https://help.allthenticate.com/help/sso/saml.md)
* [Single sign-on overview](https://help.allthenticate.com/help/sso/overview.md)
* [Microsoft federation metadata](https://nexus.microsoftonline-p.com/federationmetadata/saml20/federationmetadata.xml)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.