<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content

Common Expressions Explained in Access Certifications

Identity Governance
Okta Classic Engine
Okta Identity Engine

Overview

When creating an Access Certification, the builder has the ability to take the default options related to which users are being reviewed and who the reviewer(s) should be. They also have the ability to leverage very powerful expressions to select a subset of targeted users or dynamically look elsewhere for who the reviewer should be.

Applies To

  • Okta Access Certifications

Solution

Assumptions

  • The user has familiarity with Okta and holds administrative rights to create Access Certification Campaigns.
  • User has familiarity with building Access Certifications. Use the Create resource campaigns guide to review how to create campaigns.  

Steps

In order to understand how to use Okta Expression Language in Access Certifications, we must discuss the two types of campaigns:  

  • Resource Campaign
  • User Campaign

Resource Campaigns are designed to target Applications, Groups, and Applications with Entitlements, while User campaigns are designed to target resources assigned to a specific user or group of users. Resource Campaigns allow expression language to be used when defining which Users are in scope and which Reviewers. User Campaigns only allow expression language when determining the Reviewer.

When building expressions, remember that: 

  • && means "And’
  • || means "Or’
  • ! means is not
  • “ or ‘ can be used interchangeably, but not at the same time. Either all of “ or all of ‘ is preferred. 

 

Users Step

When defining users in scope for an Access Certification Campaign, enter the expression on this screen.

Users Expression Page

Click the Sample expressions to see some common examples listed below. 

Users selection expressions:

Restrict a campaign to members of Google-Read group

user.isMemberOf({“group.profile.name”: “Google-Read”}) 

Restrict a campaign to members with a certain attribute in their profile

user.profile.title == "Engineer” or 

user.profile.department == "Accounting’ or

user.profile.<value> == "<value>”

More complex restricting a campaign based upon multiple attributes

user.profile.title == "Engineer” && user.profile.department ==”Accounting”  

More complex restricting a campaign based upon user having one attribute value or the other

user.profile.title == "Engineer” || user.profile.department ==”Accounting”  

Restrict a campaign to non members of Google-Security group

!user.isMemberOf({“group.profile.name: "Google-Security”}) 

Restrict a campaign to members of one group AND not the other group

user.isMemberOf({"group.profile.name”: “Google-Read”}) && !user.isMemberOf({"group.profile.name”: "Google-Security”}) 

Restrict a campaign to members of “Google-Read” OR not a member of Google-Security

user.isMemberOf({"group.profile.name”: “Google-Read”}) || !user.isMemberOf({"group.profile.name”: "Google-Security”}) 

Restrict a campaign to users that are a member of a single group

user.isMemberOf({"group.id”: "00g82gmr8736og3np1d7”})

Restrict a campaign to users that are a member of multiple groups

user.isMemberOf({"group.id”: "00g82gmr8736og3np1d7”}) && user.isMemberOf({"group.id”: "00g8cv90o2vH2f7bz1d7”})

Restrict a campaign to users that are a member of one group OR another

user.isMemberOf({"group.id”: "00g82gmr8736og3np1d7”}) || user.isMemberOf({"group.id”: "00g8cv90o2vH2f7bz1d7”})

Restrict a campaign to users that are a member of a group based on its name.

user.isMemberOf({"group.profile.name”: "All Three Apps for Entitlements”})

 

Reviewers Step

Reviewer

Reviewer selection expressions:

Assign the Reviewer of a campaign to the managerId field for lookup if the user is in either Human Resources or Accounting department.  Otherwise assign it to “user@domain.com”

user.profile.department == "Human Resources” ? user.profile.managerId : user.profile.department == “Accounting” ? user.profile.managerId : “user@domain.com”

Assign a reviewer to the owners of a group

user.findGroupAndGetOwners({"group.id": "00gdqjkbwxvIBXNWw1d7"}, "USER")[0]

Assign reviewer who belong to a specific Realm

user.realmId == “guo4c8usniIlFgluO0g7” ? “jane@gmail.com”:(user.realmId == “guo4c8usniIlFgluO0g7” ? “joe@gmail.com”:”joea@gmail.com”)

 

Use this expression only if the Realms feature is enabled.


 

Assign the user’s manager to each user

user.profile.managerId

Assign a user’s manager to only users with a certain profile attribute (in this case, department is Department 1), and a specific reviewer for all other users.

User.profile.department ==”Human Resources” ? user.profile.managerId : “jsmith@example.com”

Assign a reviewer for users who are members of two groups. Otherwise, assign the user's manager.

(user.isMemberOf({'group.id': '00gjitX9HqABSoqTB0g3'}) && user.isMemberOf({'group.id': '00garwpuyxHaWOkdV0g4'})) ? 'groupreviewer@example.com' : user.profile.managerId

Assign a reviewer for users who are a member of at least one of the two groups. Otherwise, assign the Fallback reviewer.

user.isMemberOf({'group.id': {'00gjitX9HqABSoqTB0g3', '00garwpuyxHaWOkdV0g4'}}) ? "groupreviewer@example.com" : null

Assign a reviewer for users who are a member of one group, but not a member of another group. Otherwise, assign the user's manager.

(user.isMemberOf({'group.profile.name': 'West Coast Users', 'operator': 'EXACT'}) && !user.isMemberOf({'group.id': '00garwpuyxHaWOkdV0g4'})) ? "groupreviewer@example.com" : user.profile.managerId

 

Happy Governing!

Related References

Loading
Okta Support - Common Expressions Explained in Access Certifications