Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
- });
- });
Add Comment
Please, Sign In to add comment