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

# Set up SSO and SCIM for the MCP gateway with Okta
URL: https://metorial.com/docs/platform/guides/sso-okta

Create a SAML 2.0 app in Okta with Metorial’s Reply URL and Entity ID, map attributes and groups, paste the Metadata URL, then enable SCIM and push groups.

---

To set up SSO with Okta, create a **SAML 2.0** app integration, set **Single sign on URL** to Metorial's Reply URL and Audience URI (SP Entity ID) to Metorial's Entity ID, and set **Name ID format** to **EmailAddress**. Map four profile attributes and a `groups` attribute, copy the **Metadata URL** from the **Sign On** tab, and paste it into Metorial's **Add SAML Connection** panel. Then enable SCIM on the same Okta app with the endpoint and token from Metorial.

**What you'll learn**

* How to create the SAML app in Okta and connect it to Metorial
* How to enable SCIM provisioning and push groups
* How to confirm users and groups arrive

**Before you start**

* Admin access to Metorial's **Enterprise Admin** and to the Okta Admin Console
* Access to your company domain's DNS settings
* A plan that includes SSO, see [pricing](https://metorial.com/pricing)

## 1. Start in Metorial

### 1. Verify your domain

In **Enterprise Admin**, open **Security**, **Authentication**. Under **SSO Domains**, select **Add Domain** and add the DNS TXT record Metorial shows.

### 2. Start the SAML connection

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

## 2. Create the SAML app in Okta

### 1. Create the app integration

In Okta, open **Applications** and select **Create App Integration**. Choose **SAML 2.0**, select **Next**, enter an **App Name**, and select **Next**.

### 2. Enter the SAML settings

In **SAML Settings**, enter:

| Okta field                      | Value                                     |
| ------------------------------- | ----------------------------------------- |
| **Single sign on URL**          | The **Reply URL (ACS URL)** from Metorial |
| **Audience URI (SP Entity ID)** | The **Entity ID** from Metorial           |
| **Name ID format**              | **EmailAddress**                          |

On the next screen, select **I'm an Okta customer adding an internal app** and select **Finish**.

### 3. Map attributes and groups

Open the app's **Sign On** tab. Scroll to **Attribute statements**, select **Show legacy configuration**, then **Edit**. Under **Profile attribute statements**, map:

| Name        | Value            |
| ----------- | ---------------- |
| `id`        | `user.id`        |
| `email`     | `user.email`     |
| `firstName` | `user.firstName` |
| `lastName`  | `user.lastName`  |

In **Group attribute statements**, add the name `groups` with the filter **Matches regex** and the value `.*`. Select **Save**.

### 4. Copy the metadata URL

On the **Sign On** tab, find **Metadata URL** and copy it.

### 5. Assign users

On the **Assignments** tab, assign the people or groups who should use Metorial.

## 3. Finish in Metorial

In the **Add SAML Connection** panel, enter a **Name**, set **Metadata source** to **Metadata URL**, paste the URL, and select **Add Connection**.

## 4. Enable SCIM provisioning

The `groups` attribute tells Metorial a person's groups at sign-in. SCIM keeps groups current between sign-ins and deactivates people who leave, so set up both.

### 1. Create the directory in Metorial

Open the connection, select **Directories**, then **Add Directory**. Set **Directory provider** to **Okta**, 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. Turn on SCIM in the Okta app

In the Okta app, open the **General** tab and edit **App Settings**. Under **Provisioning**, select **SCIM** and select **Save**. Okta adds the **Provisioning** and **Push Groups** tabs.

### 3. Configure the connector

Open **Provisioning**, select **Integration**, and enter:

| Okta field                            | Value                                                              |
| ------------------------------------- | ------------------------------------------------------------------ |
| **SCIM connector base URL**           | The **SCIM endpoint** from Metorial                                |
| **Unique identifier field for users** | `email`                                                            |
| **Supported provisioning actions**    | **Push New Users**, **Push Profile Updates**, **Push Groups**      |
| **Authentication Mode**               | **HTTP Header**                                                    |
| **Authorization**                     | The **Bearer token** from Metorial. Okta adds the `Bearer` prefix. |

Leave the import actions off. Select **Test Connector Configuration**, then **Save**.

### 4. Enable provisioning to the app

Under **Provisioning**, select **To App**, then **Edit**. Enable **Create Users**, **Update User Attributes**, and **Deactivate Users**. Leave **Sync Password** off. Select **Save**.

### 5. Push groups

Open **Push Groups**, select **+ Push Groups**, then **Find groups by name**. Select a group, choose **Create Group** under **Match result & push action**, keep **Push group memberships immediately** on, and select **Save**. Repeat for each group.

### 6. Assign the app to the groups

On **Assignments**, select **Assign**, then **Assign to Groups**, and assign each group. Pushing a group syncs the group. Assigning the app decides which members are provisioned as users.

## Check it worked

In Okta, **Test Connector Configuration** reports **Connector configured successfully**. In Metorial, open the connection, then **Directories**, the directory, and **Logs**. Successful SCIM requests show a `200` status and a **Success** result.

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

```bash
metorial login
metorial whoami
```

## Troubleshooting

### Okta sign-in fails for everyone

**Name ID format** must be **EmailAddress**, and the **Single sign on URL** and **Audience URI** must match Metorial's values with no trailing slash.

### One person cannot sign in

They are not assigned to the app. Assign them or a group they belong to on the **Assignments** tab.

### The attribute mapping fields are missing

Attribute mapping is on the **Sign On** tab under **Show legacy configuration**, not in the app creation wizard.

### Groups exist in Okta but not in Metorial

Pushing groups and assigning the app are separate actions. Enable **Push Groups** in the connector settings, push each group on the **Push Groups** tab, and assign the app to it.

## Next steps

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