If you want to build and test the full XAA flow from the Requesting App side: Complete Environment Setup and Okta as OIDC IdP first, then return here to configure your Token Vault application.If you already have Token Vault set up and want to add XAA support: Skip to Add XAA to an existing Token Vault integration.
What’s different with XAA?
- When using Token Vault with XAA, end users do not need to connect their account with external applications. Your application does not need to provide a button to “Connect to [Third-party Application]” that makes a
POSTrequest to the My Account API’s/me/v1/connected-accounts/connectendpoint. - The end user needs to authenticate using a federated login with an Okta, OIDC, or SAML connection that is configured for XAA. That connection must be configured as a Requesting App.
- The third-party API being accessed must support XAA as a Resource App, meaning it can exchange an
ID-JAGfor access tokens. - A connection to the third-party application must exist with Connected Accounts for Token Vault and Cross App Access for Token Vault enabled.
Use Token Vault with a SAML IdP
You can use Token Vault with XAA if your users sign in through a supported SAML IdP. Your IdP must be able to exchange a SAML assertion for a refresh token and issue ID-JAGs. SAML handles sign-in. Token Vault then uses the IdP’s OAuth 2.0 token endpoint, which Auth0 finds in the IdP’s OpenID Connect metadata. To set up a SAML connection, read Configure the Requesting App connection.Add XAA to an existing Token Vault integration
If you already have Token Vault set up and want to add XAA support, you need to update two existing connections: the connection your users authenticate with (the Requesting App connection) and the connection to the third-party API (the Resource App connection).This section covers only the Auth0-side changes needed to enable XAA on existing connections. If you are creating these connections for the first time, or need to configure the Okta side, follow Okta as OIDC IdP for the full end-to-end setup.If your users sign in with SAML, you must also map the SAML Service Provider (SP) Entity ID that Auth0 uses for the connection to the OAuth client that Auth0 uses to authenticate with your IdP. If you skip this step, users can still sign in, but Token Vault requests fail. To learn how, read Okta as SAML IdP.
Configure the Requesting App connection
The connection your users authenticate with must be configured to request anID-JAG from the enterprise IdP on the user’s behalf. This can be an Okta Workforce, OIDC, or SAML connection.
Okta or OIDC
- Auth0 Dashboard
- Management API
- Navigate to Authentication > Enterprise, select your connection, and open its settings.
- Under Credentials, set Communication Channel to Back Channel. Token Vault cannot request an ID-JAG using the front channel.
- Under Settings > Scopes, add
offline_access. - Under Mappings, select Okta Basic and add
offline_accessto theuserinfo_scopelist in the JSON mapping. Select Save. - Under Cross App Access > Cross App Access Role, select Requesting Application.

- Select Save.
SAML
- Auth0 Dashboard
- Management API
- Navigate to Authentication > Enterprise, select your SAML connection, and open its settings.
- On the Settings tab, under OpenID Connect features, enter your IdP’s URL in Issuer or discovery URL, or upload a metadata document.
- Under Cross App Access Roles, turn on Requesting Application.
- Under Authentication Settings, enter the Client ID that Auth0 uses to authenticate with your IdP. Then set Authentication Method to Private Key JWT or Client Secret. If you select Client Secret, enter the secret under Credentials. Select Save.
- If you selected Private Key JWT, give your IdP the connection’s public key, either as a download from Credentials > Public Keys or as its JWKS URI. To learn how, read Private Key JWT Client Authentication.

Configure the Resource App connection
The Resource App connection to the third-party API must be an OIDC connection with both Connected Accounts for Token Vault and Cross App Access for Token Vault enabled.- Auth0 Dashboard
- Management API
- Navigate to Authentication > Enterprise, select the OIDC connection to the third-party API, and open its settings.
- Under Purpose, select Connected Accounts for Token Vault or Authentication and Connected Accounts for Token Vault.
- Under Cross App Access:
- Enable Cross App Access for Token Vault.

- Select Save.
Configure your Token Vault application
In your Requesting App tenant, create or configure the application that will perform the Token Vault token exchange.Only confidential, first-party, OIDC-conformant clients can use the Token Vault grant type. Regular Web Applications meet these requirements.
- Auth0 Dashboard
- Management API
- Under Application URIs, add your application’s callback URL (e.g.
https://localhost:3000/callback) to Allowed Callback URLs. - Under Advanced Settings > Grant Types, enable Authorization Code, Refresh Token, and Token Vault.
- Select Save Changes.
Enable enterprise connections for the application
If you set up the XAA test environment from the Requesting App side from scratch: You need to enable the OIDC connection you configured in the Environment Setup between your Requesting App tenant and Resource App tenant and the Okta Workforce connection you configured in Okta as OIDC IdP for this application. If you already have Token Vault set up and are adding XAA support: You need to enable the Requesting App connection and Resource App connection for the application you just created. To learn more, read Add XAA to an existing Token Vault integration.- Auth0 Dashboard
- Management API
To enable the Requesting App connection:
- Navigate to Authentication > Enterprise, select the Requesting App connection, and select the Applications tab. Then, enable it for the application you just created.
- Navigate to Authentication > Enterprise > OpenID Connect (OIDC), select the OIDC connection, and select the Applications tab. Then, enable it for the application you just created.
Test the end-to-end flow
To test the XAA Token Vault flow, your application must:- Obtain an Auth0 refresh token by completing an authorization code flow with your Requesting App connection (Okta Workforce, OIDC, or SAML).
- Exchange the refresh token for a Resource App access token with the OIDC connection using the Token Vault grant type or the Resource App connection.
Step 1: Obtain an Auth0 refresh token
Your application uses the authorization code flow with your Requesting App connection to authenticate the user and obtain an Auth0 refresh token.Initiate the authorization request
Send the followingGET request to the Auth0 /authorize endpoint, substituting your own values:
Your test user will be redirected to the enterprise IdP to authenticate. After a successful login, Auth0 redirects back to your
redirect_uri with an authorization code in the query string.
Exchange the authorization code for a refresh token
Send aPOST request to the Auth0 /oauth/token endpoint to exchange the authorization code for tokens:
A successful response includes a
refresh_token:
Step 2: Exchange the refresh token with Token Vault
Use the refresh token to call the Token Vault grant type endpoint and retrieve a Resource App access token.
Token Vault uses the XAA flow to obtain an access token to the Resource App by looking for a stored refresh token from a valid Requesting App IdP, asking that IdP for an
ID-JAG token on your behalf, and then presenting it to the Resource App in exchange for an access token, before returning the access token to your app.
A successful response returns a Resource App access token:
Handle multiple Requesting App IdPs
An Auth0 tenant might have many connections configured to IdPs that support XAA as a Requesting App, and which have XAA enabled (e.g. theircross_app_access_requesting_app.active property is set to
true).
When an application makes a token exchange request, Token Vault can only request an ID-JAG from an IdP that the user has already authenticated with. There must be exactly one valid user identity linked to the current
user’s profile, where XAA is enabled on the connection authenticating the user, otherwise Token Vault will not know which IdP to request an ID-JAG from. If there are multiple valid identities, the request will fail with the following error:
Use Auth0 Organizations with XAA
Token Vault will also filter the available Requesting App connections by those that are enabled for the current user’s organization. An Auth0 solution that uses Organizations can limit access to each IdP by Organization in order to clarify which Requesting App connection should be used for each user session. Eachsubject_token that is used in a Token Vault exchange contains information about the
organization that the user logged into. This organization context will be used to find the correct
XAA Requesting App connection. However, if multiple valid connections are found, the request will
still fail.
Diagnosing issues
When a Token Vault exchange fails, the response to your application contains a short, fixederror_description that does not include details from the upstream IdP or Resource App authorization server. To find the cause, check your tenant logs.
Token exchange failures
A failed exchange creates afeta (Failed token exchange at Token Vault) log entry. The details.failure_reason field identifies what went wrong. When the IdP or Resource App authorization server returns an OAuth error, the entry also includes the upstream error, error_description, and HTTP status.
Login failures
When a user logs in through a Requesting App connection, Auth0 stores the IdP refresh token that Token Vault later uses for the exchange. If Auth0 cannot store it, the login still succeeds but atoken_vault_xaa_refresh_token_acquisition_failed log entry is created. The details.failure_reason field can have the following values:
no_refresh_token: The IdP did not return a refresh token.idp_failure: The IdP rejected or could not complete the request.details.error.messagedescribes the cause.rate_limited: Auth0 reached the Token Vault limit, so the refresh token was not stored.
tokenset_not_found.