Skip to main content

Ldap

Add an attribute (e.g. "member of") to the entry identified by "filterDN"​

Syntax

var num = utils.addAttribute(host, port, filterDN, ldapUsername, ldapPassword, attributeNameToAdd, attributeValueToAdd);

Details

ArgumentDescription
hostLDAP host
portLDAP port (optional: if not specified, 389 will be used)
filterDN - base DN to apply as a filter
ArgumentDescription
ldapUsernameusername to use to authenticate to the LDAP server
ldapPasswordpassword to use to authenticate to the LDAP server
attributeNameToAddattribute name to add to every entry matching the search criteria
attributeValueToAddattribute value to add to every entry matching the search criteria
Returns the number of entries found and updated

Remove an attribute (e.g. "memberOf") from the entry identified by "filterDN"​

Syntax

var num = utils.removeAttribute(host, port, filterDN, ldapUsername, ldapPassword, attributeNameToRemove, attributeValueToRemove);

Details

ArgumentDescription
hostLDAP host
portLDAP port (optional: if not specified, 389 will be used)
filterDN - base DN to apply as a filter
ArgumentDescription
ldapUsernameusername to use to authenticate to the LDAP server
ldapPasswordpassword to use to authenticate to the LDAP server
attributeNameToRemoveattribute name to remove from every entry matching the search criteria
attributeValueToRemoveattribute value to remove from every entry matching the search criteria
Returns number of entries found and updated

Get a list of records read from the LDAP server​

where each record is expressed as a Javascript Object

Syntax

var listOfObjects = utils.getEntriesList(host, port, baseDN, ldapUsername, ldapPassword, searchAttributes,attributesListToRead);

Details

ArgumentDescription
hostLDAP host
portLDAP port (optional: if not specified, 389 will be used)
baseDN - base DN to apply as a filter
ArgumentDecription
ldapUsernameusername to use to authenticate to the LDAP server
ldapPasswordpassword to use to authenticate to the LDAP server
searchAttributesattributes to apply as a filter
attributesListToReadlist of attribute names to take into account when reading records from the LDAP server: these will be the only ones to use when creating the JSON result
Returns a list of records read from the LDAP server, where each record is expressed as a Javascript object.

starting from a specified attribute name of a specific entry read from the LDAP server

Syntax

var listOfStrings = utils.getMultipleValuesList(host, port, baseDN, ldapUsername, ldapPassword, searchAttributes, attributeName);

Details

ArgumentDescription
hostLDAP host
portLDAP port (optional: if not specified, 389 will be used)
baseDN - base DN to apply as a filter
ArgumentDescription
ldapUsernameusername to use to authenticate to the LDAP server
ldapPasswordpassword to use to authenticate to the LDAP server
searchAttributesattributes to apply as a filter, in order to identity a single entry into the LDAP server
attributeNameattribute name to read: each matching found will generate a row in the results list