Hello All,
We are working with two identity sources: Employee Auth and Functional Auth. The Functional Auth source contains functional accounts that are actually owned by employees. (but we are treating them as an Identity rather than treating it as an account of the employee).
A challenge we’re facing is that the Functional Auth source does not include a value for a particular attribute ‘btAnnex2RoleCode’ for these functional identities. However, it does include an attribute called ownerUin
, which represents the unique ID of the employee who owns the functional account.
This ownerUin
value corresponds to the userLogin
attribute in the Employee Auth source. The userLogin
is effectively the username (or UID) for the employee’s identity profile.
To populate the btAnnex2RoleCode for the functional identity, we plan to:
- Retrieve the
ownerUin
from the functional identity. - Search for an employee identity in the Employee Auth source where
userLogin
matches theownerUin
. - If a match is found, extract the btAnnex2RoleCode from the employee profile.
- Map this btAnnex2RoleCode to the corresponding functional identity. Also, if the employee has no value i.e. null the for function identity also the value should be null
We have written a rule, Identity Attribute Rule to meet this use case, but the rule seems to be not working. Below is the rule logic. It throws error at line ‘btAnnex2RoleCode = iden.getAttribute(“btAnnex2RoleCode”);’ The error says ‘couldn’t find the method getAttribute on object ‘iden’ same for getAttribute’, same error if I use another method i.e. ‘btAnnex2RoleCode = iden.getStringAttribute(“btAnnex2RoleCode”);’
However, I have worked on a similar rule, the only difference there was the attribute that we were fetching was email rather than btAnnex2RoleCode. There it worked with the below code ‘email = iden.getEmail();’
String btAnnex2RoleCode = null;
String OwnerUIN = null;
log.error (“identity attribute rule started”);
OwnerUIN = identity.getAttribute( “ownerUin” );
log.error(“OwnerUIN is:” + OwnerUIN);
if( OwnerUIN != null) {
List identities = idn.findIdentitiesBySearchableIdentityAttribute(“uid”,“Equals”,OwnerUIN,“uid”);
if (identities != null) {
log.error(“identity found”);
Identity iden = identities.get(0);
btAnnex2RoleCode = iden.getAttribute(“btAnnex2RoleCode”);
}
else {
btAnnex2RoleCode = null;
}
}
else{
btAnnex2RoleCode = null;
}
return btAnnex2RoleCode;
]]>