SAML Addon Mappings from ID Token Custom Claims in Actions
Sep 10, 2025
Overview
This article explains how to achieve the same result when using Actions.
Applies To
- Auth0 as SAML IDP
- Mappings
- SAML Addon Mappings.
Cause
Solution
- To achieve the same result, instead of adding the desired values to the user object, those values have to be added to the ID token as custom claims.
For example:
- Action's code:
exports.onExecutePostLogin = async (event, api) => {
api.idToken.setCustomClaim('IDTokenClaimName',"Hello!");
};
- SAML Addon mappings:
{
"mappings": {
"IDTokenClaimName": "SAMLResponseAttrName"
}
}
- Then, the SAML response will include: