Received a question related to the ‘art’ of making an attribute that is multivalued for the purpose of a SAML Mapping rule, but this is still relevant when using Infomap, OAuth or even the AuthSvcCred mapping rules.
Take Attribute for example:
We have ways to make the Attribute that includes single valued attributes as well as multi-valued attributes by way of a “List”, a “String Array” and “DOM Nodes”.
Assuming you had some groups:
That you wanted to put into an STSUU, you might think you can do this:
var groups = ["group1", "group2"]; var attr = new Attribute("groups", "", groups);
This will result in an error, not unlike this:
In order to do this correctly, follow the steps below:
var javaStringArray = java.lang.reflect.Array.newInstance(java.lang.String, 2);
javaStringArray = "group1"; javaStringArray = "group2";
var rolesAttribute = new Attribute("group", "", javaStringArray);