> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up SSO for the MCP gateway with Microsoft Entra ID
URL: https://metorial.com/docs/platform/guides/sso-entra-id

Create an Entra enterprise application, paste Metorial’s Entity ID and Reply URL, add a group claim, upload the Federation Metadata XML, then add SCIM.

---

To set up SSO with Microsoft Entra ID, create an enterprise application in Entra, choose **SAML**, and set the fields Identifier (Entity ID) and Reply URL (Assertion Consumer Service URL) to the two values Metorial shows under **Enterprise Admin**, **Security**, **Authentication**, **Add SAML Connection**. Map four claims, add a group claim, download **Federation Metadata XML**, and upload it to Metorial. Then add a SCIM directory so Entra provisions and deprovisions users and groups.

**What you'll learn**

* How to create the SAML connection between Entra ID and Metorial
* How to send group membership so groups can decide tool access
* How to turn on SCIM provisioning

**Before you start**

* Admin access to Metorial's **Enterprise Admin**
* At least the Application Administrator role in Microsoft Entra
* Access to your company domain's DNS settings
* A plan that includes SSO, see [pricing](https://metorial.com/pricing)

## 1. Verify your domain and start the connection

### 1. Add your domain

In **Enterprise Admin**, open **Security**, **Authentication**. Under **SSO Domains**, select **Add Domain**, enter your domain, and add the DNS TXT record Metorial shows. The domain cannot be used for SSO until DNS verification passes.

### 2. Start the SAML connection

Under **SSO Connections**, select **Add SAML Connection** and choose **Microsoft Entra ID**. Keep the panel open. It shows **Entity ID** and **Reply URL (ACS URL)**.

## 2. Configure Entra ID

### 1. Create the enterprise application

In the Microsoft Entra admin center, open **Enterprise applications**, select **New application**, then **Create your own application**. Enter a name and select **Create**.

### 2. Enter the SAML values

Under **Manage**, select **Single sign-on**, then **SAML**. Select **Edit** on **Basic SAML Configuration** and enter:

| Entra field                                    | Value                                     |
| ---------------------------------------------- | ----------------------------------------- |
| **Identifier (Entity ID)**                     | The **Entity ID** from Metorial           |
| **Reply URL (Assertion Consumer Service URL)** | The **Reply URL (ACS URL)** from Metorial |

Select **Save**. Use the exact values with no trailing slash.

### 3. Map attributes

Select **Edit** on **Attributes & Claims** and set:

| Claim name                                                           | Value                    |
| -------------------------------------------------------------------- | ------------------------ |
| `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress` | `user.mail`              |
| `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname`    | `user.givenname`         |
| `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name`         | `user.userprincipalname` |
| `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname`      | `user.surname`           |

### 4. Add a group claim

In **Attributes & Claims**, select **Add a group claim**. Choose **Groups assigned to the application**, which Microsoft recommends for large organizations because a SAML assertion carries at most 150 groups. By default Entra sends each group's object ID. To send display names for cloud-only groups, set **Source attribute** to **Cloud-only group display names**.

### 5. Download metadata and assign people

In **SAML Signing Certificate**, download **Federation Metadata XML**. Then open **Users and groups** and assign the users or groups who should use Metorial.

## 3. Finish in Metorial

Back in the **Add SAML Connection** panel, enter a **Name**, set **Metadata source** to **Metadata XML**, paste the file's contents, and select **Add Connection**.

## 4. Add SCIM provisioning

SAML decides who can sign in. SCIM creates accounts ahead of time and deprovisions people when they are disabled in Entra.

### 1. Create the directory in Metorial

Open the connection, select **Directories**, then **Add Directory**. Set **Directory provider** to **Microsoft Entra ID**, enter a **Directory name**, and select **Create Directory**. Copy the **SCIM endpoint** and **Bearer token**. The token is not shown again after you close the panel.

### 2. Configure provisioning in Entra

In the enterprise application, select **Provisioning**, then **New configuration**. Enter the SCIM endpoint as **Tenant URL** and the bearer token as **Secret Token**. Select **Test Connection**, then **Create**.

### 3. Start provisioning

Review **Attribute mapping** for users and groups. Use **Provision on-demand** to test one user, then select **Start provisioning**. After the first cycle, Entra syncs about every 40 minutes.

## Check it worked

On the connection in Metorial, select **Try this connection** under **Test SSO Connection**. The test result lists the name, email, **Groups** and **Roles** Entra returned, without creating a user. The directory's **Logs** show each SCIM request with its status code.

A person signs in from the terminal and checks the groups Metorial received:

```bash
metorial login
metorial whoami
```

## Troubleshooting

### A "not assigned" error when signing in

The user is not assigned to the enterprise application. Assign the user, or a group they belong to, under **Users and groups**.

### Sign-in fails right after setup

The **Reply URL** must match Metorial's value exactly. A trailing slash breaks validation.

## Next steps

* [Map directory groups to tool access](https://metorial.com/docs/platform/guides/map-idp-groups-to-tool-access): turn Entra groups into access groups
* [Offboard a user](https://metorial.com/docs/platform/guides/offboard-a-user): what ends when an account is disabled in Entra
* [SSO and SCIM overview](https://metorial.com/docs/platform/guides/sso-and-scim): the other supported identity providers