OIDC SetClaim Array value.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OIDC SetClaim Array value.

L3 Networker

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?

1 accepted solution

Accepted Solutions

L7 Applicator

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.

 

 

View solution in original post

2 REPLIES 2

L7 Applicator

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.

 

 

L3 Networker

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

 

 

  • 1 accepted solution
  • 65 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!