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

# Microsoft Entra ID

> Set up enterprise login (SAML) and automatic sync (SCIM) with Entra ID (formerly Azure AD)

Register Arlet as an enterprise application in Microsoft Entra ID. You need Application Administrator or a higher role in Entra ID.

Verify your email domain first ([step 1 of the setup](https://docs.arlet.dev/sso/overview.md#setup-steps)) so you can activate right away.

## 1. Create an enterprise application

1. In the [Microsoft Entra admin center](https://entra.microsoft.com), open **Enterprise applications** → **New application** → **Create your own application**.
2. Enter `Arlet` as the name, choose **Integrate any other application you don't find in the gallery (Non-gallery)** and create it.

## 2. Configure SAML

1. Open **Single sign-on** → **SAML** in the new application.
2. Press **Edit** on **Basic SAML Configuration** and enter the values from "Values to enter in your identity provider" in Arlet's organization settings:

| Entra ID field | Arlet value |
| - | - |
| Identifier (Entity ID) | Identifier (Entity ID) |
| Reply URL (Assertion Consumer Service URL) | Reply URL (ACS URL) |
| Sign on URL | Sign-on URL (app tile) |
| Logout URL | Logout URL (if you use single logout) |

3. Under **Attributes & Claims**, change **Unique User Identifier (Name ID)** to `user.objectid` with the **Persistent** format. Email addresses can change, so don't use them as the identifier. Keep the `emailaddress` and `name` claims as they are.
4. Copy the **App Federation Metadata Url** under **SAML Certificates**.

## 3. Assign users

Under **Users and groups**, assign the people or groups who use Arlet. Unassigned people can't sign in.

## 4. Register it in Arlet

1. Under "Identity provider connection" in Arlet's organization settings, choose **SAML**.
2. Paste the App Federation Metadata Url from step 2 into **Metadata URL**.
3. If you entered the logout URL in Entra ID, turn on **Use single logout**.
4. Press **Register**, then **Activate connection**.
5. Sign out once and confirm you can sign in with your work email.

## Notes

* When Entra ID rotates its signing certificate, nothing needs to change in Arlet as long as you registered the metadata URL.

## Automatic sync (SCIM)

In addition to sign-in, you can keep Entra ID users and groups in sync with Arlet. People disabled or deleted in Entra ID can no longer use Arlet, and people who have not signed in yet already hold a seat. Groups can be used for [sharing movies](https://docs.arlet.dev/sso/overview.md#sharing-movies-with-groups) and [choosing admins](https://docs.arlet.dev/sso/overview.md#choosing-admins-with-groups). Set this up after the sign-in connection is active.

### 1. Issue a token in Arlet

1. In the organization settings, under "Directory sync", press **Enable sync and issue a token**.
2. Copy the **SCIM tenant URL** and the **secret token**. The token is shown only on this screen.

### 2. Set up provisioning in Entra ID

1. Open **Provisioning** in the enterprise application you created for sign-in and set the provisioning mode to **Automatic**.
2. Under **Admin credentials**, enter the SCIM tenant URL as **Tenant URL** and the secret token as **Secret token**, press **Test connection**, and save.
3. Open **Mappings** → **Provision Microsoft Entra ID Users**, change the source attribute of `externalId` to `objectId`, and save (the default is `mailNickname`).

> [!WARNING]
>
> `externalId` must match the SAML name ID (`user.objectid`). Otherwise synced people are not linked to their account when they sign in, and they cannot sign in.

4. Under **Settings**, set **Scope** to **Sync only assigned users and groups**.
5. Press **Start provisioning**.

### How sync works

* Only the people and groups assigned under the app's **Users and groups** are synced. Assigning a group syncs its members and the group itself.
* Members of nested groups are not synced. Put people directly into the groups you use in Arlet.
* Entra ID runs provisioning every few tens of minutes. To apply a change right away, use **Provision on demand**.
* Synced people hold a seat even before they sign in. If there are not enough seats, the person is not synced (the Entra ID provisioning logs show an error).
* Once sync is on, people not synced from Entra ID cannot join through sign-in. People who joined before sync was turned on keep working.
* Up to two tokens can be active at once for rotation. Put the new token into Entra ID first, then **Revoke** the old one.
* To stop syncing, stop provisioning in Entra ID first, then press **Turn off sync** in Arlet. Synced people keep their membership.


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