Skip to main content
To test the XAA flow, the Requesting App must obtain an Identity Assertion Authorization Grant (ID-JAG) from the enterprise IdP, then exchange it with Auth0 for an access token. This article walks through both steps: obtaining the ID-JAG (via SAML or OIDC) and sending it to Auth0’s /token endpoint to get an access token for your API. You can test the XAA flow manually or using our online sandbox environment. If you use Okta as your enterprise IdP, once you’ve tested the XAA flow, publish your Resource App to the Okta Integration Network (OIN) to increase app discoverability for your enterprise customers.

Test manually

Obtain the ID-JAG

There are two ways to obtain an ID-JAG, depending on whether the Requesting App authenticates with your enterprise IdP using SAML or OIDC.

SAML Requesting App

First, you need to log in to your Requesting App with your IdP tenant. When you successfully log in, the IdP redirects the browser back to your Requesting App with a SAML response. Your Requesting App then securely exchanges the SAML assertion contained within the SAML response for an OIDC refresh_token and then exchanges the refresh_token for an ID-JAG.
SAML Response => SAML Assertion => refresh_token => ID-JAG
Once you receive the SAML response from the IdP, extract the SAML assertion using a SAML library. The following is an example SAML response:
You can use the xmllint command line tool to extract the SAML assertion:
To exchange the SAML assertion for an OIDC refresh token, the Requesting App makes a token exchange request to the /token endpoint of your IdP with the following parameters:
If the IdP client is confidential, either client_secret or client_assertion is sent in the form post or HTTP headers; as a result, they are mutually exclusive and marked as optional. When the call is successful, refresh_token is returned inside the access_token property of the JSON response:
To exchange the refresh_token for an ID-JAG, make another token exchange request to the /token endpoint of your IdP with the following parameters:
If the IdP client is confidential, either client_secret or client_assertion is sent in the form post or HTTP headers; as a result, they are mutually exclusive and marked as optional. The response of this call contains the ID-JAG inside the access_token property:
The ID-JAG follows a JWT format, such as the following:
When the Resource App is a SAML application, the ID-JAG also includes a sub_id claim containing the SAML NameID details (format, issuer, nameid, and nameid_format) of the authenticated user, alongside the standard sub claim.

OIDC Requesting App

First, you need to log in to your Requesting App with your IdP tenant. When you successfully log in, the IdP redirects the browser back to your Requesting App with an authorization code. Your Requesting App then securely exchanges the authorization code for an access token and ID token.
ID Token => ID-JAG
To exchange the ID token for an ID-JAG, the Requesting App makes a token exchange request to the /token endpoint of your IdP with the following parameters:
If the IdP client is confidential, either client_secret or client_assertion is sent in the form post or HTTP headers; as a result, they are mutually exclusive and marked as optional.

Send ID-JAG to Auth0’s /token endpoint

Once the Requesting App gets an ID-JAG, it sends an access token request to the /token endpoint of your Auth0 tenant:
If the Requesting App is a confidential client, either client_secret or client_assertion is sent in the form post or HTTP headers; as a result, they are mutually exclusive and marked as optional. After the Auth0 Authorization Server validates the ID-JAG to verify the user’s identity, it issues an access token for the API in your Auth0 tenant. The access token also includes the scopes you requested that are allowed by RBAC and other policies set in your Auth0 tenant. The Auth0 Authorization Server does not issue refresh tokens in response to ID-JAG token exchanges. As a result, the Requesting App needs to get a new ID-JAG from the enterprise IdP, and undergo the applicable access controls, to get a new access token via XAA.

Test using our online sandbox environment

If you use Okta as your enterprise identity provider, XAA.dev is our online sandbox environment for testing Cross App Access in your browser. Follow the instructions to test your Resource App against a hosted Requesting App that mints an ID-JAG via OIDC or SAML, depending on your IdP connection, and calls your Resource App API.

Publish your Resource App in OIN

If you use Okta as your enterprise identity provider, after you’ve tested the end-to-end flow, B2B and SaaS providers can amplify their reach to enterprise customers by publishing their Resource App to the Okta Integration Network (OIN). To learn how, follow the instructions in How to Build and List Secure Cross App Access Connections on OIN and Express Configuration with Okta. For a list of fields needed to publish your Resource App to the OIN, review your Auth0 logs for idjag-exchange-succeeded.

Learn more

To help you test the XAA flow, use the following resources: