Wednesday, 12 April 2017

Using ldapjs in node, how can I obfuscate my bindCredentials (password)

In Node, running on a Windows box, I'm using ldapjs to run an LDAP query (to get the user thumbnailPhoto). Our IT department has created a service account for me to use, but I'd prefer not to hard code this username/password combination in my code. Currently, my code works, and looks like this:

let ldap = require('ldapjs');
let client = ldap.createClient({ "url": "LDAP://WILLOW", "bindDN": "user@domain.com", "bindCredentials": "thepassword" });

Does anyone have any ideas for how to not store the password in my code?



via quack

No comments:

Post a Comment