1.1 KiB
1.1 KiB
LDAPjs
[] []
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();
.search('dc=example', function(req, res, next) {
servervar obj = {
dn: req.dn.toString(),
attributes: {
objectclass: ['organization', 'top'],
o: 'example'
};
}
if (req.filter.matches(obj.attributes))
.send(obj);
res
.end();
res;
})
.listen(1389, function() {
serverconsole.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
DTrace support is included in ldapjs. To enable it,
npm install dtrace-provider
.
License
MIT.