LDAP Client and Server API for node.js
Go to file
Mark Cavage 34b9d7f8fd Merge pull request #67 from nrogers/master
add support for RFC 2696 paged results controls
2012-03-27 12:09:09 -07:00
bin GH-51 Timeout support in client library 2012-01-19 18:02:10 -08:00
deps Initial setup for 0.5 (use eng.git layout) 2012-02-18 08:15:52 +00:00
docs Add persistent search cache, minor bug fix to client 2012-02-23 15:21:17 -08:00
examples DTrace rework so probes always fire 2011-11-18 16:39:37 -08:00
lib added tests and better handle zero-length cookies 2012-03-26 14:30:23 -05:00
test added tests and better handle zero-length cookies 2012-03-26 14:30:23 -05:00
tools Initial setup for 0.5 (use eng.git layout) 2012-02-18 08:15:52 +00:00
.dir-locals.el Initial setup for 0.5 (use eng.git layout) 2012-02-18 08:15:52 +00:00
.gitignore missing Makefile.targ due to gitignore 2012-02-18 08:18:42 +00:00
.gitmodules Initial setup for 0.5 (use eng.git layout) 2012-02-18 08:15:52 +00:00
.travis.yml travis broken 2012-02-18 08:26:50 +00:00
LICENSE Initial working client/server version 2011-08-04 13:32:01 -07:00
Makefile add logger to del_request test 2012-02-18 11:47:58 -08:00
Makefile.deps Initial setup for 0.5 (use eng.git layout) 2012-02-18 08:15:52 +00:00
Makefile.targ missing Makefile.targ due to gitignore 2012-02-18 08:18:42 +00:00
README.md tabs in README 2011-11-10 10:15:26 -08:00
package.json D'oh! Invalid package.json (screw you, ','). 2012-03-14 09:13:16 -07: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.