Passing CDATA as custom SAML data using rules

hey, I’m performing and IDP-initiated-flow using AWS Cognito <> Auth0 <> SP
and would like to transfer CDATA for each specific user, dependent on the data it has received from cognito

I have Rule to support static data with mappings (see below)

And would like to pass CDATA which includes multiple attributes, something like that:

<saml:Attribute Name="ApplicationData" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
  <saml:AttributeValue>
  <![CDATA[<ApplicationData><UserData>
  <Data Name="FirstName"/>
  <Data Name="Phone"/>
  </UserData>
  <ClientData/>
  </ApplicationData>]]>
   </saml:AttributeValue>
</saml:Attribute>

my user comes with this data:

{
  
    "first_name": "x@gmail.com",
    "phone_number": "+12345678",
}

but not sure how can I transfer this data via rule?

{
  context.samlConfiguration.mapUnknownClaimsAsIs = true;
  context.samlConfiguration.mapIdentities = false;
  context.samlConfiguration.mappings = {
     "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "email",
     "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress":       "email",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/user_id": "cognito:username",
   };
}

was thinking maybe something like that?
user.application_data = [user.phone_number, user.first_name];
then map it on the SamlConfiguration – but it won’t create multiple attributes.
thanks!

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!