/token endpoint to get an access token for your API.
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 OIDCrefresh_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:
xmllint command line tool to extract the SAML assertion:
/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:
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:
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.
Learn more
To help you test the XAA flow, use the following resources:- Auth0 Cross App Access Inspector: A simple Node.js application for testing the XAA flow between Okta and Auth0.
- XAA.dev: An online sandbox for testing Cross App Access in your browser.