APM Cookbook: Modify LDAP Attribute Values using iRulesLX
Published Sep 27, 2016
Version 1.0Was this article helpful?
I've successfully implemented what you're trying to do, as a proof of concept. You need to modify the index.js in the iLX workspace. For example (what I did), you could add the following function that encodes the value, then call the function IF the attribute name is unicodePwd.
// From https://github.com/ldapjs/node-ldapjs/issues/92#issuecomment-29070786
function encodePassword(password) {
return new Buffer('"' + password + '"', 'utf16le').toString();
}
To call that function, I inserted the following line just after the three LDAP variables are declared:
if (ldap_attribute == 'unicodePwd') { ldap_value = encodePassword(ldap_value) }