LDAP Client and Server API for node.js
Go to file
Mark Cavage 4f2dc61feb sample dtrace script 2011-11-17 16:19:18 -08:00
bin Include CLI in npm bundle 2011-10-18 16:26:38 -07:00
docs 'operation' instead of 'type'. Include 'require' stmts to help 2011-11-06 14:27:53 -08:00
lib comment wrong for dtrace probe 2011-11-17 11:56:19 -08:00
tst GH-26 rewrite network parser 2011-11-11 10:09:20 -08:00
.gitignore Documentation and makefile 2011-08-15 10:53:57 -07:00
LICENSE Initial working client/server version 2011-08-04 13:32:01 -07:00
Makefile Docs and anonymous bind support 2011-08-24 12:38:23 -07:00
README.md tabs in README 2011-11-10 10:15:26 -08:00
package.json GH-35 reference error in client connect() 2011-11-14 09:23:33 -08:00
snoopldap.d sample dtrace script 2011-11-17 16:19:18 -08:00

README.md

ldapjs makes the LDAP protocol a first class citizen in Node.js.

Usage

For full docs, head on over to http://ldapjs.org.

var ldap = require('ldapjs');

var server = ldap.createServer();

server.search('dc=example', function(req, res, next) {
  var obj = {
    dn: req.dn.toString(),
    attributes: {
      objectclass: ['organization', 'top'],
          o: 'example'
    }
  };

  if (req.filter.matches(obj.attributes))
    res.send(obj);

  res.end();
});

server.listen(1389, function() {
  console.log('ldapjs listening at ' + server.url);
});

To run that, assuming you've got the OpenLDAP client on your system:

ldapsearch -H ldap://localhost:1389 -x -b dc=example objectclass=*

Installation

npm install ldapjs

License

MIT.

Bugs

See https://github.com/mcavage/node-ldapjs/issues.