npm.io
1.0.4 • Published 9 years ago

ldap-search

Licence
ISC
Version
1.0.4
Deps
2
Vulns
0
Weekly
0

Install

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm install ldap-search

API

var eidLookUpLDAP = require('ldap-search')
ldapSearch(parameters, filter, attributes, res)

Create LDAP connection using the given parameters and perform LDAP search using the filter criteria used. This function will return the list of attributes from LDAP (given as input).

Examples

LDAP search using UID
var eidLookUpLDAP = require('ldap-search');

// Set the LDAP arguments
var ldapParameters = {
  user: "cn=foo,ou=users,o=example",
  pwd:  "secret",
  server: "LDAP://example.com",
  base: "o=example"
}

getLDAPinfo: function(req, res){  
  var ldapFilter = req.params.filter; //"xxxxxxx"
  var ldapAttributes = req.params.attributes; //"mail,cn,uid,telephonenumber";
  eidLookUpLDAP.ldapSearch(ldapParameters, ldapFilter, ldapAttributes, res);
}