LDAP Client and Server API for node.js
Go to file
Craig Baker 60870497ef Removed commented out code and some left over console.log's. 2012-01-19 14:00:23 -08:00
bin minor clean up 2011-12-20 15:07:07 -08:00
docs GH-13 server.use() 2012-01-06 15:10:46 -08:00
examples DTrace rework so probes always fire 2011-11-18 16:39:37 -08:00
lib Removed commented out code and some left over console.log's. 2012-01-19 14:00:23 -08:00
tst GH-48 Ensure escaped filters work 2012-01-19 14:00:23 -08:00
.gitignore Documentation and makefile 2011-08-15 10:53:57 -07:00
.travis.yml travis tweak 2012-01-14 10:30:28 -08:00
LICENSE Initial working client/server version 2011-08-04 13:32:01 -07:00
Makefile Version bump 2011-12-21 10:19:04 -08:00
README.md tabs in README 2011-11-10 10:15:26 -08:00
package.json version bump 2012-01-10 09:38:51 -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.