IdP login failures
Symptom. Users whose email domain signs in through an external identity provider (Microsoft Entra ID, Google, Keycloak and the like) cannot sign in. They see a JSON error from the platform instead of the console, or are sent back to the sign-in page. Password users and other domains are unaffected.
The flow, and what it checks
Section titled “The flow, and what it checks”- The user enters their email; the platform finds the email-domain mapping for its domain and the
identity provider the mapping names, and redirects to the provider (
/auth/oidc/login), with PKCE, a state and a nonce. The state is bound to this browser by a cookie. - The provider authenticates the user and redirects to
<FC_JWT_ISSUER>/auth/oidc/callback. - The platform consumes the state (single use), checks it was started in this browser, exchanges the
code for tokens with the provider, authenticating with the provider’s client authentication method (a stored client secret, a certificate assertion or a federated assertion; see section 2), verifies the
id_token(signature, issuer or issuer pattern, audience, nonce), then checks the claims: an email, its domain matching the login domain, the tenant (tid) when one is required, not a guest account, and optionallyemail_verified. - It finds or provisions the principal, applies role mappings, and starts a session.
1. Find the code and the cause
Section titled “1. Find the code and the cause”The user’s browser shows an error envelope with a code. For server-side failures the platform log
has the underlying error: search for internal error response with that code, and read its err.
The Login Attempts page in the console also records SSO attempts with the reason.
| Code | Meaning | Usual cause and fix |
|---|---|---|
EMAIL_DOMAIN_NOT_MAPPED (404) |
No email-domain mapping for the domain | A typo or a new domain. Create the mapping, with an explicit scope (anchor or client), on the right identity provider |
OIDC_NOT_CONFIGURED (400) |
The mapping’s identity provider has no OIDC configuration | Complete the provider’s issuer URL, client id and client authentication (a secret, or a certificate or federated credential) |
OIDC_RESOLVE_FAILED (500) |
The platform could not set up the provider | The log’s err says which: the client secret could not be decrypted (saved under a different FLOWCATALYST_APP_KEY: enter the secret again), or issuer discovery failed (wrong issuer URL, or the platform cannot reach the provider: check outbound network and DNS), or the method is CERTIFICATE and the provider has no ACTIVE certificate (generate one) |
OIDC_STATE (500) |
The login state could not be stored or read | A database problem; check the platform’s database health |
INVALID_STATE (400) |
Unknown or expired login session | The user took too long, used the back button, or reopened an old callback link. Start again. Many at once: check the platform’s clock and that state rows are not purged early |
LOGIN_NOT_STARTED_HERE (400) |
The callback arrived in a browser that did not start this sign-in | Protection against login CSRF. Legitimate causes: the user started in one browser or profile and finished in another; cookies blocked; a proxy stripping cookies; the platform reached on a host other than FC_JWT_ISSUER; FC_SESSION_COOKIE_SAME_SITE=strict |
OIDC_EXCHANGE (500) |
The provider refused the code exchange | See below; the provider’s own error is in the log |
OIDC_VERIFY (403) |
The id_token failed verification |
Issuer not matching the provider’s issuer or issuer pattern (including a broad pattern refused by FC_OIDC_ISSUER_PATTERN_REQUIRE_PINNED=true), wrong audience, an expired token (clock skew), a key rotation at the provider not yet visible |
OIDC_CLAIMS (400) |
Claims could not be read | A provider misconfiguration; inspect the token claims at the provider |
NONCE_MISMATCH |
The token was not issued for this sign-in | Replayed or mixed-up sign-ins; start again |
NO_EMAIL |
The token has neither email nor preferred_username |
Configure the provider to release the email claim (scopes or optional claims) |
EMAIL_NOT_VERIFIED |
The provider says the email is unverified, and FC_OIDC_REJECT_UNVERIFIED_EMAIL=true |
Verify the address at the provider, or turn the setting off if that provider sends false for trusted accounts |
EXTERNAL_GUEST |
A guest account (#EXT#) |
Guest accounts are not supported; the user signs in with a home account |
EMAIL_DOMAIN_MISMATCH |
The token’s email is in another domain than the one the user entered | The user was already signed in at the provider with a different account. Sign out there, or use a private window |
TENANT_MISMATCH |
The tid claim is missing or not the configured tenant |
A multi-tenant application used from the wrong tenant, or a wrong required tenant id on the provider |
MAPPING_GONE |
The mapping was removed while the user was signing in | Expected after a configuration change; start again |
2. Code exchange failures
Section titled “2. Code exchange failures”OIDC_EXCHANGE is the most common failure after a configuration change. The provider’s error text
is in the log line’s err. A provider authenticates the platform in one of three ways, set on the identity
provider (oidcClientAuthMethod): CLIENT_SECRET (the default), CERTIFICATE or FEDERATED. The last two
send a signed client_assertion in place of the secret. Check which method the provider uses before you
read the table.
| Provider says | Cause | Fix |
|---|---|---|
| The request must contain a client secret or assertion | The platform sent no secret: none is saved, or it could not be read | Enter the client secret on the identity provider in the console and save |
| Invalid client secret, or secret expired | The secret is wrong or expired at the provider | Create a new secret at the provider and enter it (see key rotation) |
Redirect URI mismatch, invalid_grant |
The provider’s registered redirect URI is not <FC_JWT_ISSUER>/auth/oidc/callback |
Register exactly that URI, or correct FC_JWT_ISSUER |
| Invalid client | Wrong client id, or the application was deleted at the provider | Correct the client id |
An error about the client assertion or certificate, with method CERTIFICATE |
The provider does not have the ACTIVE certificate, or the platform’s clock is wrong |
Download the active certificate from the provider’s page and upload it at the provider; if you just rotated, upload the NEXT certificate before choosing Make active. Check NTP on the platform’s hosts |
An error about the client assertion or federated credential, with method FEDERATED |
The provider’s federated credential does not match: issuer, subject (identity-provider:<provider id>) or audience (api://AzureADTokenExchange), or the provider cannot fetch the platform’s /.well-known/jwks.json |
Compare the three values on the provider’s page with the federated credential at the provider. The platform must be reachable from the internet on a public https address, and FC_JWT_ISSUER must be that address. The platform logs a warning at start-up when a FEDERATED provider is configured and the issuer is not public https |
Certificate and federated client authentication are built but have not been tested against a real Microsoft Entra tenant, so the causes in the last two rows come from how the methods are built, not from errors seen in a run against Entra. Rotation steps are in key rotation.
Changes to an identity provider (secret, client id, issuer, pattern, authentication method) take effect at the next sign-in; no restart is needed.
3. Checks that help
Section titled “3. Checks that help”- Does the platform hold a credential it can read? A secret saved before an app key rotation, under a
key the platform no longer has, cannot be decrypted. The repository’s
cmd/decrypt-checktool tells you whether a key opens a given stored value (it prints only the length unless asked). The practical fix is the same either way: enter the secret again. - Is the issuer pattern pinned? For multi-tenant providers the console flags a pattern that does
not pin the tenant, and such patterns are refused for new saves. A pinned pattern looks like
^https://login\.microsoftonline\.com/<tenant-id>/v2\.0$. - Is the clock right? Token validation tolerates little skew. Check NTP on the platform’s hosts.
- Is it one provider or all? If every provider fails, look at what they share: outbound network
to the providers,
FC_JWT_ISSUER, cookies through the load balancer, the app key.
Read next
Section titled “Read next”- Configure identity providers.
- Federation: mappings, scopes and role sync.
- Security hardening: pinning issuers and refusing unverified emails.