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

# Microsoft Entra

> Set up a SCIM connection with Microsoft Entra

> [!NOTE]
>
> To test out SCIM, set up an [Entra developer instance](https://learn.microsoft.com/en-us/entra/verified-id/how-to-create-a-free-developer-account) to use for this guide.

## Configure a SCIM connection for a specific Organization

**1. Create application in Entra**

If you don't already have an application in Entra, create one by navigating to “Applications” → “Enterprise Applications” and selecting “create your own application”.

![Go to Entra App Catalog to create SCIM app](https://mintcdn.com/stytch-34ca0595/BnjAf5sdfGdYB0xZ/images/multi-tenant-auth/enterprise-ready/scim/entra-scim-browse-apps.png?fit=max\&auto=format\&n=BnjAf5sdfGdYB0xZ\&q=85\&s=3afbb9f78e72028b89278ac13ad4c970)

In the app creation flow, input a name for your application and select “Integrate any other application you didn't find in the gallery".

![Create your SCIM application in Microsoft Entra](https://mintcdn.com/stytch-34ca0595/BnjAf5sdfGdYB0xZ/images/multi-tenant-auth/enterprise-ready/scim/entra-create-own-app.png?fit=max\&auto=format\&n=BnjAf5sdfGdYB0xZ\&q=85\&s=54f2efa6ca762a39e94f5f4c38c58d2d)

**2. Enable automatic provisioning**

Once you have an application, enable SCIM by clicking on “Provisioning” on the left hand management side bar, or “Provision User Accounts” under the Getting Started section.

![In Entra app navigate to Provisioning](https://mintcdn.com/stytch-34ca0595/BnjAf5sdfGdYB0xZ/images/multi-tenant-auth/enterprise-ready/scim/entra-scim-app-select-provisioning.png?fit=max\&auto=format\&n=BnjAf5sdfGdYB0xZ\&q=85\&s=39bc4ed00506151df679a8e30b31283b)

On the next page, click “Get started” and then switch the provisioning mode from “Manual” to “Automatic”.

![Select automatic provisioning mode in Entra SCIM app](https://mintcdn.com/stytch-34ca0595/BnjAf5sdfGdYB0xZ/images/multi-tenant-auth/enterprise-ready/entra-scim-select-provisioning-mode.png?fit=max\&auto=format\&n=BnjAf5sdfGdYB0xZ\&q=85\&s=6e5ab3d63a3960f0ffbb374c59289e62)

You should now see an "Admin Credentials" section.  Leave this tab open, and navigate back to Stytch.

**3. Create SCIM Connection in Stytch**

Create a SCIM Connection on the Organization in the [Stytch Dashboard](https://stytch.com/dashboard/organizations) or the [Create SCIM Connection endpoint](https://stytch.com/docs/api-reference/b2b/api/scim/connection-management/create-scim-connection.md).  Select Microsoft Entra as the IdP.

![Create Microsoft Entra SCIM Connection In Stytch](https://mintcdn.com/stytch-34ca0595/BnjAf5sdfGdYB0xZ/images/multi-tenant-auth/enterprise-ready/entra-create-connection-in-stytch.png?fit=max\&auto=format\&n=BnjAf5sdfGdYB0xZ\&q=85\&s=ee3e05887749f20582e9330b0d79d25c)

Once you click save, you'll be provided with the base url and bearer token you'll need for the next step.

![Entra Connection Credentials from Stytch](https://mintcdn.com/stytch-34ca0595/BnjAf5sdfGdYB0xZ/images/multi-tenant-auth/enterprise-ready/entra-connection-creds-in-stytch.png?fit=max\&auto=format\&n=BnjAf5sdfGdYB0xZ\&q=85\&s=e53b32d22befd4f6e0cb901859fb360d)

Leave this tab open and navigate back to Entra to input the returned credentials.

**4. Configure SCIM credentials in Entra**

On the "Provisioning" tab under "Admin Credentials":

1. Copy the "BaseURL" from Stytch into the “Tenant URL” field
2. Copy the "HTTP Header Bearer Token" from Stytch into the "Secret Token" field

> [!NOTE]
>
> If you did not specify an IdP when creating the SCIM Connection, you must append `?aadOptscim062020` to the returned BaseURL to flag the application into [Entra's SCIM 2.0 compliant version](https://learn.microsoft.com/en-us/entra/identity/app-provisioning/application-provisioning-config-problem-scim-compatibility#scim-20-compliance-issues-and-status)

![Input admin credentials for SCIM with Microsoft Entra](https://mintcdn.com/stytch-34ca0595/BnjAf5sdfGdYB0xZ/images/multi-tenant-auth/enterprise-ready/entra-scim-admin-credentials.png?fit=max\&auto=format\&n=BnjAf5sdfGdYB0xZ\&q=85\&s=c3095d2d5be673ced5662d868478a071)

Click "Test Connection", then save.

Navigate back to “Provisioning”, and

1. Under "Mappings" ensure that `objectId` is mapped to `externalId` (i.e. `objectId` is set to the "Source" attribute and `externalId` is set to the "Target" attribute).
2. Toggle "Provisioning Status" to “On”.

   ![Enable provisioning for Entra SCIM](https://mintcdn.com/stytch-34ca0595/BnjAf5sdfGdYB0xZ/images/multi-tenant-auth/enterprise-ready/entra-scim-provisioning-and-mapping-on.png?fit=max\&auto=format\&n=BnjAf5sdfGdYB0xZ\&q=85\&s=eac3e4fe6c4963dd54a06d2fb297a4e6)

**5. Provision users**

Once saved, you can test the SCIM integration by assigning people to and removing people from the application.  Entra does automatic syncing on a 40 minute timer, but you can provision on demand to speed up testing.

![Provision on demand with Entra for testing](https://mintcdn.com/stytch-34ca0595/BnjAf5sdfGdYB0xZ/images/multi-tenant-auth/enterprise-ready/entra-scim-provision-on-demand.png?fit=max\&auto=format\&n=BnjAf5sdfGdYB0xZ\&q=85\&s=d3e8e26fc3353bfb92ce3ce8e01ee6bb)

You should see the status of the member changing from `active` to `deactivated`.

**6. (Optional) Configure webhooks**

To notify your own system of changes that occur via SCIM, [configure webhooks](https://stytch.com/docs/resources/workspace-management/webhooks.md).  See the full list of relevant webhooks [here](https://stytch.com/docs/multi-tenant-auth/enterprise-ready/scim/overview.md#supported-scim-actions).

## Next Steps

If you only have a few customers who require SCIM connections, you can manage them by hand in the [Stytch Dashboard](https://stytch.com/dashboard/organizations).  However, as your enterprise customer base grows, you may want to build a UI in your application to allow admins of Organizations to self-serve creating and updating their own SCIM connections.

The simplest way to add SCIM connection management to your application is to use Stytch's pre-built [Admin Portal](https://stytch.com/docs/multi-tenant-auth/enterprise-ready/admin-portal.md) component.

![Admin Portal SCIM Management UI](https://mintcdn.com/stytch-34ca0595/ZVUUFsqZuqcX7gxa/images/api-reference/b2b/frontend-sdks/admin-portal-scim.png?fit=max\&auto=format\&n=ZVUUFsqZuqcX7gxa\&q=85\&s=6962e2e541541627e1319854e3fec76a)

> [card] [Admin Portal Guide](https://stytch.com/docs/multi-tenant-auth/enterprise-ready/admin-portal.md)
>
> Read the guide on Admin Portal.

> [card] [Admin Portal SDK Reference](https://stytch.com/docs/api-reference/b2b/frontend-sdks/react/prebuilt-ui/admin-portal/scim.md)
>
> Jump straight to the React, Next.js, or Vanilla JS SDK reference.
