# Microsoft Entra ID fixes

<!-- Generated by scripts/generate.ts. Do not edit. -->

Fix steps for failed Microsoft Entra ID tests and sign-ins. For setup, see the [Microsoft Entra ID guides](/idp-guides/entra-id/).

## Connection Doctor fixes

Connection Doctor shows these steps when a test or sign-in through Microsoft Entra ID fails. Codes without their own Microsoft Entra ID steps use the [generic fixes](/idp-guides/generic/). Values in braces are filled in with the connection's own settings in the dashboard and portal.

<a id="oidc_email_missing"></a>

### Fix for `oidc_email_missing`

The identity provider did not release the user's email claim.

1. In Entra, open App registrations > the app > Token configuration and add the optional claim email to the ID token; the user's email (mail) must be set.

See the [`oidc_email_missing` error reference](/errors/oidc_email_missing/).

<a id="oidc_idp_error"></a>

### Fix for `oidc_idp_error`

The identity provider returned an error to the sign-in callback instead of signing the user in (most often the user is not assigned to the application, or canceled).

1. In Entra, open Enterprise applications > the application > Users and groups and add the user or a group; if Properties > Assignment required is Yes, only assigned users can sign in.

See the [`oidc_idp_error` error reference](/errors/oidc_idp_error/).

<a id="oidc_personal_account_refused"></a>

### Fix for `oidc_personal_account_refused`

A personal Google or Microsoft account signed in, and this connection only accepts work accounts.

1. Ask the user to choose "Work or school account" (not a personal Microsoft account such as outlook.com) when Microsoft asks which account to use.

See the [`oidc_personal_account_refused` error reference](/errors/oidc_personal_account_refused/).

<a id="oidc_tenant_claim_missing"></a>

### Fix for `oidc_tenant_claim_missing`

Microsoft Entra sent an ID token without a tenant ID (tid claim), so the account cannot be matched to your organization.

1. Sign in with a work or school account of your Entra tenant (not a personal Microsoft account) and retry; the tid claim is always present in tokens for work and school accounts.

See the [`oidc_tenant_claim_missing` error reference](/errors/oidc_tenant_claim_missing/).

<a id="oidc_tenant_mismatch"></a>

### Fix for `oidc_tenant_mismatch`

The account signed in from a Google Workspace domain or Microsoft Entra tenant that is not the one this organization verified.

1. In Microsoft Entra admin center, open Overview and compare the Tenant ID with the tenant recorded in this setup; the user must belong to that tenant (guests sign in with their home tenant).

See the [`oidc_tenant_mismatch` error reference](/errors/oidc_tenant_mismatch/).

<a id="oidc_token_exchange_failed"></a>

### Fix for `oidc_token_exchange_failed`

The identity provider refused to exchange the sign-in code (often a wrong client secret or redirect URI).

1. In Entra, open App registrations > the app > Certificates & secrets (create a new client secret if it expired) and Authentication > Redirect URIs (add `{redirect_uri}`).

See the [`oidc_token_exchange_failed` error reference](/errors/oidc_token_exchange_failed/).

<a id="saml_audience_mismatch"></a>

### Fix for `saml_audience_mismatch`

The identity provider uses a different SP Entity ID (Audience) than this connection's.

1. In Entra, open Single sign-on > Basic SAML Configuration > Edit and set Identifier (Entity ID) to `{sp_entity_id}`; make it the default identifier.

See the [`saml_audience_mismatch` error reference](/errors/saml_audience_mismatch/).

<a id="saml_decryption_failed"></a>

### Fix for `saml_decryption_failed`

The assertion is encrypted with a key we cannot use.

1. In Entra, open Single sign-on > Token encryption and import the certificate from `{metadata_url}`, or remove token encryption.

See the [`saml_decryption_failed` error reference](/errors/saml_decryption_failed/).

<a id="saml_destination_mismatch"></a>

### Fix for `saml_destination_mismatch`

The identity provider sends the response to a different address than this connection's.

1. In Entra, open Single sign-on > Basic SAML Configuration > Edit and set Reply URL (Assertion Consumer Service URL) to `{acs_url}`.

See the [`saml_destination_mismatch` error reference](/errors/saml_destination_mismatch/).

<a id="saml_email_missing"></a>

### Fix for `saml_email_missing`

The response does not include the user's email address.

1. In Entra, open Single sign-on > Attributes & Claims > Add new claim, name email, source attribute user.mail.

See the [`saml_email_missing` error reference](/errors/saml_email_missing/).

<a id="saml_idp_status_error"></a>

### Fix for `saml_idp_status_error`

The identity provider refused the sign-in before sending an assertion.

1. In Microsoft Entra admin center, open the enterprise application > Users and groups and assign the user.
2. Check the enterprise application's Sign-in logs for the failure reason.

See the [`saml_idp_status_error` error reference](/errors/saml_idp_status_error/).

<a id="saml_issuer_mismatch"></a>

### Fix for `saml_issuer_mismatch`

The response comes from a different identity provider (issuer) than the one configured here.

1. In Entra, open Single sign-on > Set up the application and copy Microsoft Entra Identifier, or upload the app's Federation Metadata XML here.

See the [`saml_issuer_mismatch` error reference](/errors/saml_issuer_mismatch/).

<a id="saml_nameid_missing"></a>

### Fix for `saml_nameid_missing`

The response has no user identifier (NameID).

1. In Entra, open Single sign-on > Attributes & Claims and make sure the Unique User Identifier (Name ID) claim is set (for example user.userprincipalname).

See the [`saml_nameid_missing` error reference](/errors/saml_nameid_missing/).

<a id="saml_signature_algorithm_weak"></a>

### Fix for `saml_signature_algorithm_weak`

The response is signed with SHA-1, which is not accepted.

1. In Entra, open Single sign-on > SAML Certificates > Edit and set Signing Algorithm to SHA-256.

See the [`saml_signature_algorithm_weak` error reference](/errors/saml_signature_algorithm_weak/).

<a id="saml_signature_invalid"></a>

### Fix for `saml_signature_invalid`

The signature does not match the identity provider certificate we have on file (often after a certificate change).

1. In Entra, open Single sign-on > SAML Certificates and download "Certificate (Base64)" or "Federation Metadata XML" for the active certificate, then upload it here.

See the [`saml_signature_invalid` error reference](/errors/saml_signature_invalid/).

<a id="saml_signature_missing"></a>

### Fix for `saml_signature_missing`

The SAML response or assertion is not signed.

1. In Entra, open Single sign-on > SAML Certificates > Edit and choose Signing Option "Sign SAML response and assertion".

See the [`saml_signature_missing` error reference](/errors/saml_signature_missing/).
