- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
02-14-2025 07:39 AM
Trying to add a new claim to a OIDC application that contains a filtered list of the groups a user is a member of.
setClaim('Role', LoginUser.GroupNames);
Works fine to supply ALL the groups the member of but when I try some filtering and setting the claim to the filtered subset I get an error.
Example: (This logic does appear to work on a SAML app using the setAttributeArray function in the SAML Response section)
var filteredArray = [];
var RawGroupNames = LoginUser.GroupNames;
for(var i=0; i < RawGroupNames.Length; i++) {
if(RawGroupNames[i].indexOf("XYZ") >= 0) {
filteredArray.push(RawGroupNames[i]);
}
}
setClaim('Role', filteredArray);
The setClaim step generates a "Self referencing loop detected for property 'Owner' with type 'Jint.Native.JsObject'. Path 'Role[0].Value.Owner[0].Value'." error when using the Test button.
Any tips\suggestions?
02-14-2025 04:33 PM
Hi @Chris Kubiak
Please check if your OIDC app accepts a single string, then use filteredArray.join(',') and if your OIDC app accepts arrays, try setClaimArray('Role', filteredArray).
Please see if it’s possible to convert the Array to a simple string.
02-14-2025 04:33 PM
Hi @Chris Kubiak
Please check if your OIDC app accepts a single string, then use filteredArray.join(',') and if your OIDC app accepts arrays, try setClaimArray('Role', filteredArray).
Please see if it’s possible to convert the Array to a simple string.
02-17-2025 04:26 AM
setClaimArray did the trick, that function isn't in the default script comments in the OIDC app nor in any of the docs pages I was looking up. Got too focused on the normal setClaim('Role', LoginUser.GroupNames); being able to return an array I got blind.
Thanks
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

