Read an account attribute in the cloud rule

Hi All,

Has anyone tried retrieving the account attribute in the cloud rule using idn.getAccountAttribute passing arguments Application, unique account ID, and attributename(value of the property you want to read)

I tried the below snippet that did not work:

String appName ="<My source> [Source]"
String accountID = "<nativeIdentity>"
String attributeName = "isEnabled"

String xyz = idn.getAccountAttribute(appName, accountID, attributeName);

I checked the below URL:

 /**
     * Gets the String value of an attribute from an account on an application.
     *
     * @param applicationName The application name.
     * @param nativeIdentity The native identity of the account.
     * @param attribute The name of the attribute to retrieve.
     * @return The attribute value or null if the attribute does not exist.
     * @throws GeneralException wrapping underlying DB related errors
     */
     String getAccountAttribute(String applicationName, String nativeIdentity, String attribute)

What is the applicationName format here?, I cannot play with trial and error due to the cloud rule deployment process!

Try this format Source name [source]

If your Source name is Active Directory then Application name will be Active Directory [source]

1 Like

@iamology Thank You for than reply!. That already tried and did not. work. If you notice my snippet above appName, I am using [source] which is not working.

1 Like

ok, looks like it is case-sensitive. I was using <My source name> [Source]" instead <My source name> [source].

Small s in the source

2 Likes

Hi Ragu,

Are you saying that @iamology 's suggestion worked?

3 Likes

Hi @colin_mckibben, @anneragh

I am looking to use the same rule. Can you please help me what is the nativeIdentity you are passing.

My application is Active Directory so will it be the “distinguishedName” as a attribute or actual DN value of an account I need to pass.

I guess it’s later but need second thoughts.

@maheshtare

1st argument is your source name.
2nd argument is your distinguishedName(its a value)
3rd argument is which attribute you want to read from account(its a name of the attribute)

Here is the link for javadocs for your future reference

https://developer.sailpoint.com/rule-java-docs/