Create an Okta Group Rule to Fetch Groups Ending With a Specific Name
Last Updated:
Overview
Okta Expression Language (OEL) and regular expressions (Regex) can be used to create a group rule that selects groups ending with a specific name (*.name). By applying the isMemberOfGroupNameRegex function, Okta evaluates and assigns users based on their membership in groups matching the specified string pattern.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Group Rules
- Regular Expressions (Regex)
- Okta Expression Language (OEL)
Solution
How is a group rule created to fetch groups ending with a specific name?
Within Group Rules, Regex can be used to achieve the desired outcome. This configuration selects all the groups that end with the word "name".
Apply the following OEL function to evaluate group memberships matching the specific string pattern:
isMemberOfGroupNameRegex(".*name$*")
Review the following examples demonstrating the configuration and evaluation of the group rule using the regular expression:
NOTE: The isMemberOfGroupNameRegex group functions are designed to retrieve only an Okta user's group memberships. Do not use them to retrieve an app user's group memberships. Using App groups is not supported for this Regex. For more details, review the documentation in the Related References section.
