Okta Group Rule Expressions for User Status Yield Incorrect Results
Last Updated:
Overview
An issue occurs where Okta group rules using user status expressions, such as status=="Active" or status=="suspended", output incorrect values for users. This happens because the expression validator does not distinguish between Okta user statuses, except for the deactivated status. Resolve this issue by using the user.getInternalProperty("status") expression or targeting specific attributes instead.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Group Rules
- Okta Expression Language
Cause
The expression validator does not distinguish among Okta user statuses, except for the deactivated status. Consequently, standard status expressions evaluate incorrectly and output values for users that do not match the rule.
Solution
How does Okta evaluate the user status correctly in group rules?
Use the user.getInternalProperty("status") expression to achieve the desired result instead of standard status expressions.
Review the following example expression used to exclude suspended users.
user.getInternalProperty("status") != "SUSPENDED"
Target specific attributes or group memberships as an alternative.
Alternatively, target specific attributes, such as user.attribute1=="valueX", or use a combination of attribute expressions and group expressions, such as isMemberOfGroup("<groupId>").
