- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
Complete reference for Idira Identity User object in Dynamic Role scripts. Includes enumeration script and documentation showing all 25 available properties, methods, and usage. Covers limitations, workarounds, and differences between Dynamic Roles vs Application Policies. Essential for Identity admins working with RBAC.
user-object-reference.js into the script editorNote: The script will show different properties depending on the user type (Cloud Directory vs Active Directory).
User.Uuid // User's UUID
User.Username // Username
User.DisplayName // Display name
User.Mail // Email address
User.UserType // "CUS" (Cloud), "AD", "FDS", "LDAP"
User.DirectoryServiceUuid // Directory service UUID
User.RiskLevel // "No Risk", "Low", "Medium", "High", "Unknown"
User.IsIdentityCookiePresent // Boolean
User.IsYubikeyOtpConfigured // Boolean
User.OrgId // Organization ID (usually null)
User.Properties // DataEntity object
These are the ONLY properties available in Dynamic Role scripts:
User.Get('Alias') // User alias
User.Get('CreateDate') // Account creation date
User.Get('DisplayName') // Display name
User.Get('InEverybodyRole') // Boolean (True/False)
User.Get('LastModifiedDate') // Last modification date
User.Get('LastPasswordChangeDate') // Password change date
User.Get('Mail') // Email address
User.Get('MobileNumber') // Mobile phone
User.Get('Name') // Username
User.Get('OauthClient') // Boolean (False for regular users)
User.Get('ReportsTo') // Manager/supervisor
User.Get('role_membership') // Role names
User.Get('State') // Value: "None" (not useful)
User.Get('Version') // Version number
Note: Custom attributes for Cloud Directory users use underscore suffix (e.g., country_, department_).
var email = User.Get('Mail');
var dept = User.Get('department_'); // Custom attribute
var email = User.Properties.Get('Mail');
var dept = User.Properties.Get('department_');
Both methods are equivalent.
// Check if property exists (even if null/empty)
if (User.Properties.Has('MobileNumber')) { ... }
// Check if property has actual value
if (User.Properties.HasNonNullOrWhitespaceValue('Department')) { ... }
// Safe get (returns null if not found)
var country = User.Properties.TryGet('country_');
User.InRole(roleId) // Check role by ID
User.InRoleByNames(roleNames[]) // Check multiple roles by name
User.InEffectiveGroupByNames(groupNames[]) // Check effective groups
User.InEffectiveGroupByDNs(DNs[]) // Check groups by DN
User.InDirectGroupByNames(groupNames[]) // Check direct groups
User.InDirectGroupByDNs(DNs[]) // Check direct groups by DN
if (User.InRole('abc12345-uuid-here')) {
return true;
}
if (User.UserType == 'CUS') {
var country = User.Get('country_');
if (country === 'Poland') {
return true;
}
}
if (User.UserType == 'AD') {
var dn = User.Get('distinguishedname');
if (dn && dn.indexOf('OU=Sales') > -1) {
return true;
}
}
var dept = User.Get('department_');
var hasPhone = User.Properties.HasNonNullOrWhitespaceValue('MobileNumber');
if (dept === 'Engineering' && hasPhone) {
return true;
}
The following attributes always return null in Dynamic Role scripts:
Status, StatusEnum - User status (Active/Invited/Suspended)Enabled, Locked - Account state flagsPassword, PasswordHash, PasswordIsSet - Security sensitiveFirstName, LastName - Name componentsPhoto, PictureUrl - Profile imagesEffectiveGroupObjects, RoleObjects - Complex objectsmodule() function - Cannot use module('User'), module('SqlQuery')Use Authentication Policies with SQL queries instead:
// Application Policy Script (NOT Dynamic Role)
var sqlMod = module('SqlQuery');
var result = sqlMod.query("SELECT StatusEnum FROM User WHERE Username = '" + User.Username + "'");
var userStatus = result[0].StatusEnum;
if (userStatus === "Invited") {
policy.AuthenticationProfile = "Email MFA Required";
}
country_, department_, employee_id_User.Get('country_')distinguishedname, samaccountnameUser.Get('distinguishedname')