IdnRuleUtil getFirstAccount

We have a generic rule where we are using idn.getFirstAccount method for fetching some account attribute of an identity.

Please confirm the input parameters this method is expecting as our current code is not returning anything. I am copying our sample code here and both Option1 and Option2 are not working. I need to know, what is expected for applicationName and identityName input.

public String getUserAccountAttribute(String attribute){
	String strReturn="";
	//Option 1
	try{
	Account account = idn.getFirstAccount("MySource", identity.getName());
	Map accountAttributes = account.getAttributes();
	
	String attributeValue = accountAttributes.get(attribute);
	strReturn=attributeValue;
	} catch (sailpoint.tools.GeneralException e){
		log.debug("getUserAccountAttribute without bracket exception occured..."+e.getMessage());
	}
	
	//Option 2
	try{
	Account acct = idn.getFirstAccount("MySource [source]", identity.getName());
	Map acctaAttrs = acct.getAttributes();
	
	String atrValue = acctAttrs.get(attribute);
	strReturn=atrValue;
	} catch (sailpoint.tools.GeneralException ex){
		log.debug("getUserAccountAttribute with bracket exception occured..."+e.getMessage());
	}
	
	return strReturn;
}

Option 1 will not work as source name should be "MySource [source]'.
Option 2 should work:

  1. Was the source name changed after creation? If yes, then use the original name.
  2. Try below but I really doubt that is causing it:
import sailpoint.tools.Util;
String atrValue = Util.otos(acctAttrs.get("attribute1"))

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.