Skip to content

Instantly share code, notes, and snippets.

@thegoleffect
Created August 21, 2014 21:24
Show Gist options
  • Save thegoleffect/311b9b41e7b769b8f252 to your computer and use it in GitHub Desktop.
Save thegoleffect/311b9b41e7b769b8f252 to your computer and use it in GitHub Desktop.
basic ldapjs usage example
var LDAP = require('ldapjs');
var protocol = "ldap://";
var host = "...";
var post = 3268;
var dn = "cn=Van Nguyen,...";
var password = "some password";
var client = LDAP.createClient({
url: protocol + host + ":" + port
});
//authenticate
client.bind(dn, password, function (err) {
if (err) {
throw err;
}
// authentication successful
// do stuff
// close connection when done
client.unbind(function(err){
if (err) {
throw err;
}
});
});
@nsagot
Copy link

nsagot commented Jul 19, 2018

Modify your code :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment