> ## 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

<Info>
  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.
</Info>

## Configure a SCIM connection for a specific Organization

<Steps>
  <Step title="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”.

    <img src="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" alt="Go to Entra App Catalog to create SCIM app" width="1690" height="570" data-path="images/multi-tenant-auth/enterprise-ready/scim/entra-scim-browse-apps.png" />

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

    <img src="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" alt="Create your SCIM application in Microsoft Entra" width="581" height="435" data-path="images/multi-tenant-auth/enterprise-ready/scim/entra-create-own-app.png" />
  </Step>

  <Step title="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.

    <img src="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" alt="In Entra app navigate to Provisioning" width="1898" height="966" data-path="images/multi-tenant-auth/enterprise-ready/scim/entra-scim-app-select-provisioning.png" />

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

    <img src="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" alt="Select automatic provisioning mode in Entra SCIM app" width="1897" height="614" data-path="images/multi-tenant-auth/enterprise-ready/entra-scim-select-provisioning-mode.png" />

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

  <Step title="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](/api-reference/b2b/api/scim/connection-management/create-scim-connection).  Select Microsoft Entra as the IdP.

    <img src="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" alt="Create Microsoft Entra SCIM Connection In Stytch" width="1320" height="610" data-path="images/multi-tenant-auth/enterprise-ready/entra-create-connection-in-stytch.png" />

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

    <img src="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" alt="Entra Connection Credentials from Stytch" width="2280" height="674" data-path="images/multi-tenant-auth/enterprise-ready/entra-connection-creds-in-stytch.png" />

    Leave this tab open and navigate back to Entra to input the returned credentials.
  </Step>

  <Step title="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)
    </Note>

    <img src="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" alt="Input admin credentials for SCIM with Microsoft Entra" width="1211" height="705" data-path="images/multi-tenant-auth/enterprise-ready/entra-scim-admin-credentials.png" />

    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”.

           <img src="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" alt="Enable provisioning for Entra SCIM" width="1896" height="1071" data-path="images/multi-tenant-auth/enterprise-ready/entra-scim-provisioning-and-mapping-on.png" />
  </Step>

  <Step title="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.

    <img src="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" alt="Provision on demand with Entra for testing" width="1616" height="556" data-path="images/multi-tenant-auth/enterprise-ready/entra-scim-provision-on-demand.png" />

    You should see the status of the member changing from `active` to `deactivated`.
  </Step>

  <Step title="(Optional) Configure webhooks">
    To notify your own system of changes that occur via SCIM, [configure webhooks](/resources/workspace-management/webhooks).  See the full list of relevant webhooks [here](/multi-tenant-auth/enterprise-ready/scim/overview#supported-scim-actions).
  </Step>
</Steps>

## 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](/multi-tenant-auth/enterprise-ready/admin-portal) component.

<img src="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" alt="Admin Portal SCIM Management UI" width="1552" height="1024" data-path="images/api-reference/b2b/frontend-sdks/admin-portal-scim.png" />

<Columns cols={2}>
  <Card title="Admin Portal Guide" href="/multi-tenant-auth/enterprise-ready/admin-portal" icon="grid-2x2-check" arrow>
    Read the guide on Admin Portal.
  </Card>

  <Card title="Admin Portal SDK Reference" href="/api-reference/b2b/frontend-sdks/react/prebuilt-ui/admin-portal/scim" icon="plug">
    Jump straight to the React, Next.js, or Vanilla JS SDK reference.
  </Card>
</Columns>
