LdapServices.getUserAttributes

Returns all attributes associated with a user from the Ldap Registry identified by properties in the XIldap.properties file file.

The returned Map contains one entry for each unique attribute name where the key is the property name and the value is an array of property values. When a property only occurs once, this array will only contain a single value.

This method works as follows:

  1. Connects to the Ldap Registry using the user identified by properties Ldap.BindDistinguishedName and Ldap.BindPassword in XIldap.properties file. If these properties are missing, attempts to bind anonymously.
  2. Searches the registry for the user name starting from the location identified by parameter baseDistinguishedName and obtains the full distinguished name (DN) identifying the user. Parameter userKeyAttributeName is used to build the search string.
  3. Returns all attributes for the DN.

Javascript example:

 var root = "OU=Ebase Users and Groups,DC=ebasetech,DC=com";
 var userAttr = "sAMAccountName";
 var attrs = LdapServices.getUserAttributes(fields.USER.value, root, userAttr, false);
 for (var attrid in attrs)
 {
   var attrValues = attrs[attrid];
   log ("Attribute: " + attrid);
   for each (var attrValue in attrValues)
   {
     log(" value: " + attrValue); 
   }
 }
 

returns java.util.Map

Parameters

java.lang.String  userName,  java.lang.String  baseDistinguishedName,  java.lang.String  userKeyAttributeName,  boolean  removeDomainNameFromUser,