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 test 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 or OIDC 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.
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.
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 or OIDC connection.
- 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.
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:
- For Cross App Access Roles, enable Requesting Application.
- Enable Cross App Access for Token Vault.

- Select Save.
Configure your test 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 Cross App Access, enable Allow Cross App Access.
- Under Advanced Settings > Grant Types, enable Authorization Code, Refresh Token, and Token Vault.
- Select Save Changes.
Enable Okta 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 test application you just created. To learn more, read Add XAA to an existing Token Vault integration.- Auth0 Dashboard
- Management API
To enable the Okta Workforce connection or the Requesting App connection:
- Navigate to Authentication > Enterprise > Okta Workforce, select the Okta Workforce connection, and select the Applications tab. Then, enable it for the test 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 test 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 the Okta Workforce connection or the Requesting App connection.
- 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 the Okta Workforce connection to authenticate the user and obtain a 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 Okta 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.