custom-token-exchange trigger executes the single Action associated with that profile. If the Action successfully completes and sets a user for the transaction, post-login Actions and the rest of the Auth0 pipeline are then executed for that logged-in user.

Custom Token Exchange vs Post Login Actions
The Post Login Actions trigger executes after the Custom Token Exchange Action runs for the user you set for the transaction. For other use cases, such as adding custom claims to access tokens, use the Post Login Action trigger. The Custom Token Exchange uses the token exchange grant type, where theevent.transaction.protocol is set to oauth2-token-exchange in the Post Login Action trigger. Both the Custom Token Exchange and Native Social Login use the token exchange grant type. To distinguish between the two, use the value of the subject_token_type, which should correspond to one of your Custom Token Exchange Profiles.
Custom Token Exchange Early Access doesn’t support
api.authentication.challengeWith() or api.authentication.enrollWith(). If you use those methods with your Post-Login Actions, the transaction will fail with a non-recoverable error. Make sure you skip those two methods when event.transaction.protocol==oauth2-token-exchange depending on the subject_token_type value.Triggers
Custom Token Exchange
Thecustom-token-exchange trigger is the first step in the Auth0 pipeline. This function is executed after the received Custom Token Exchange request has been validated and successfully mapped to an existing profile.
References
- Event object: Provides contextual information about the a Token Exchange request, including the subject_token, IP address, client, and more.
- API object: Provides methods to use with your Token Exchange Action that allows you to set the user, reject the transaction, set user metadata and access the Actions cache, and more.