Checking for regex match of attribute values in a script

Wessel, Keith kwessel at
Wed Feb 21 14:50:42 EST 2018

Interesting suggestion, David. I had already coded a solution with a for loop, but your solution is probably much more efficient. I could make another attribute that’s a mapped attribute and that does the regex mapping then use its results in my script. This would, I assume, be more efficient code as I assume the mapped attribute code behind the scenes is more efficient than iterating over all values of the attribute to do regex matches. Is that assumption true, Scott?


From: users [mailto:users-bounces at] On Behalf Of IAM David Bantz
Sent: Wednesday, February 21, 2018 12:12 PM
To: Shib Users <users at>
Subject: Re: Checking for regex match of attribute values in a script

We "ValueMap" memberOf values with regex to extract (possibly multiple) attribute values.*
Not exactly what you asked for but a possible alternative depending on your precise need(s).

David Bantz




          <SourceValue ignoreCase="true">cn=aws:([0-9]+):role:(.*?),ou=group,dc=alaska,dc=edu</SourceValue>


On Wed, Feb 21, 2018 at 7:23 AM, Wessel, Keith <kwessel at<mailto:kwessel at>> wrote:
Hi, all,

We've got a scripted attribute definition that checks for several values of memberOf with memberOf.getValues().contains(). I'd like to convert this to use a regex to match partial group names....
Is there a way to do a regex match on attribute values with contains()? Or do I need to iterate through the attribute values with a loop to do this comparison? Or is there another method on collections that I should be using other than contains()?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list