Hello Jon,
Sorry I was not able to deploy your suggestion sooner but I did and it works great, thanks a lot for your help !
However, I may have found an issue (bug?) and I wanted to report here too just to let you know ... and also because it could be useful to everybody.
In the mapping rule, I have this line :
cleanup_string = cleanup_string.replace(/é/gi,"e");
but if I save this in the mapping rule through the console, the line will look like this once saved :
var temp = cleanup_string.replace(/é/gi,"e");
and when I try to push the line through rest-api (git IBM security and ansible combo), the text will look like this :
var temp = cleanup_string.replace(/é/gi,"e");
I did some testing and the result remains in the same : in the trace, I can see that the following ldap attribute "2450,rue Girouard Ouest, éédifice Est" can be seen as this in the SAML token :
<saml:Attribute Name="tagvalue_credattrs_officeAddress" NameFormat="urn:ibm:names:ITFIM:5.1:accessmanager"><saml:AttributeValue xsi:type="xs:string">2450,rue Girouard Ouest, eédifice Est</saml:AttributeValue>
(ps : I know the ldap value is strange but it is just for testing and debugging purpose).
I am reporting it in a IBM case.
Thanks again for you help,
Thank you,
------------------------------
Christophe Agostini
------------------------------
Original Message:
Sent: Fri May 03, 2019 04:56 AM
From: Jon Harry
Subject: Secure Federation Mapping Rules : Loop and replace ?
Hello,
You can get a java.util.Iterator over the attributes in an AttributeContainer using the
getAttributeIterator()method.
Or, you could use the getAttributes() method of the AttributeContainer() to get a Java array of Attributes to work with as you please.
For the string replace, perhaps you need to try using this format for the search and replace:
var x = "Something";
var y = x.replace(/thing/g,"way");
Also worth checking that the string you're performing the action on is actually a JavaScript string and not a Java string.
Cheers... Jon.
------------------------------
Jon Harry
Consulting IT Security Specialist
IBM
------------------------------