The Cross App Access Flow is only applicable for multi-tenant auth uses of Connected Apps.
urn:ietf:params:oauth:grant-type:jwt-bearer grant type and implements the Identity Assertion Authorization Grant (ID-JAG) draft specification.
When to use the XAA Flow
Use the Cross App Access Flow when:- Your application needs to act on behalf of users who have already authenticated with a workforce IdP
- You want to avoid browser redirects (e.g. in CLI tools, background services, or AI agents)
- Your users sign in via OIDC SSO and you want Connected Apps to recognize them without a separate authorization code flow
Prerequisites
- A B2B Stytch project with Connected Apps enabled
- An OIDC SSO connection configured for the organization, pointing to the external IdP
- A Confidential Connected App client (first-party or third-party)
How it works
User authenticates with the workforce IdP
The user authenticates with their organization’s workforce identity provider (e.g. Okta, Microsoft Entra) via OpenID Connect. After authentication, the Connected App receives an ID token representing the user’s session with the IdP.
Connected App requests an ID-JAG from the IdP
The Connected App makes a Token Exchange request to the workforce IdP’s token endpoint to obtain an ID-JAG token:The IdP validates the subject token, evaluates any administrator-defined policies, and issues a signed ID-JAG token with
typ: "oauth-id-jag+jwt" in the header.Connected App exchanges the ID-JAG for a Stytch access token
The Connected App sends the ID-JAG token to Stytch’s token endpoint using the XAA Flow’s grant type:
Stytch validates and issues access token
Stytch validates the ID-JAG token by:
- Matching the token’s
issclaim to a configured OIDC connection - Verifying the token signature against the OIDC connection’s JWKS endpoint
- Validating that
audcontains the Stytch project’s issuer URL - Confirming the
client_idclaim matches the requesting Connected App - Resolving the token’s
subclaim to a member (see below)
Member resolution
Stytch resolves the ID-JAG token’ssub claim to a member using two mechanisms, checked in this order:
-
OIDC registration match: Stytch looks for an active OIDC member registration on the same connection where the
provider_subjectmatches the token’ssub. This is automatically created when a member signs in via OIDC SSO — no additional configuration is needed. -
External ID match: If no OIDC registration is found, Stytch checks for a member in the organization whose
external_idmatches the token’ssub.
If your members sign in via OIDC SSO before using the XAA Flow, they will be resolved automatically through their OIDC registration. No manual
external_id mapping is required.ID-JAG token format
The ID-JAG token must be a signed JWT with the following structure: Header:| Claim | Description |
|---|---|
iss | The IdP’s issuer URL (must match the OIDC connection’s issuer) |
sub | The user’s identifier at the IdP |
aud | Must include your Stytch project’s issuer URL |
client_id | The Connected App’s client ID |
scope | Requested scopes (space-delimited) |
exp | Expiration time |
iat | Issued-at time |
jti | Unique token identifier |