Documentation / v1 / Connections

Connect Microsoft Entra ID

Sign in the users of one Entra tenant. Built and tested locally; the person is the tenant plus the object id, never an address.

State in this release

This is the OpenID Connect type with Entra's facts and identity rules applied; read the OpenID Connect guide for mapping, domains and the journey. It was tested locally against a provider that mimics Entra's tokens. No real tenant was used, so app registration screens, conditional access, guest users and national clouds are untested here. A tenant can also connect over SAML; choose one per tenant.

What the preset fixes

A connection is for exactly one tenant, given as its GUID. The values common, organizations and consumers, and any non-GUID, are refused; multi-tenant sign-in is not supported. The issuer is derived from the tenant and a different issuer is refused.

  1. The federated identity is the issuer plus the token's oid. It is never sub, which Entra makes different per application, and never an address, which a tenant administrator can set to anything.
  2. The token's tid must equal the configured tenant and oid must be present, or the login is refused.
  3. While the default mapping is unchanged, Entra addresses are not treated as verified: Entra does not assert email_verified and the default mapping has no rule for it, so an Entra address never links an existing account on its own, whatever trusted_for_email says. A person whose address matches an existing account is asked to prove that account before anything is linked. Do not add an email_verified rule to an Entra connection's mapping. The guarantee is a property of the default mapping, not a check the service makes for this strategy, and such a rule would let an Entra address count as verified and link an existing account when trusted_for_email, a verified domain claim and no other federated identity are all present.
  4. The default mapping reads email, then preferred_username as a required fallback, then names and groups.

Register the application in Entra

Register a single-tenant application. Add a Web redirect URI equal to the connection's callback_url, create a client secret and copy its value, not its id. Note the application id and the tenant id.

Create the connection

Post the strategy microsoft with the client id and the tenant id; scopes default to openid, email and profile.

Request · http
POST /v1/console/accounts/{account_id}/directories/{directory_id}/connections
Content-Type: application/json
X-Auth-Proof: <receipt, when the directory asks for one>

{
  "strategy": "microsoft",
  "display_name": "Fabrikam Entra ID",
  "config": {
    "client_id": "11111111-2222-3333-4444-555555555555",
    "tenant_id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
  },
  "client_secret": "secret-value-from-entra",
  "jit_enabled": true
}

Groups

The groups claim is mapped to the groups attribute when Entra sends it. With sync_groups on, that attribute becomes the person's membership of groups this connection owns, and a role comes only from a role mapping on one of those groups. Entra sends object ids, not names, so the groups are named by id. For a person in many groups Entra sends a pointer instead of the list: the service then sees no groups and the person leaves the connection's groups. Test with your own tenant before relying on it for authorization.

Enable and test

Sign in with a user of the tenant, which must work; with a user of another tenant, which must be refused; and with a user whose address matches an existing directory account, which must be asked to prove that account, with nothing linked until it does.