Pass in Hard coded values in SAML mapping
Last Updated:
Overview
We have a new requirement where we want to add hard coded values in the SAML response that will not be in the user's profile. Is this possible? Is there some kind of guideline/document for this?
Cause
Solution
user.fixed_value = 'Testing123';
context.samlConfiguration.mappings = {
'fixed_attribute': 'user.fixed_value'
};
It's important to note that the 'fixed_value' is not persisted in the user profile. It's only a transient value used as a trick to update the SAML configuration. The attribute will stay only for the duration of the rules execution.There are a couple of examples that use this method in this document: https://auth0.com/docs/authenticate/protocols/saml/saml-configuration/customize-saml-assertions#example-changing-the-saml-token-lifetime-and-use-upn-as-nameid