Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ActiveDirectory = require('activedirectory');
- var ad = new ActiveDirectory({
- url: 'ldap://10.10.10.10',
- baseDN: 'dc=domain,dc=com',
- username: 'Administrator',
- password: 'kokoko'
- });
- ad.findUser('', function (err, user) {
- console.log('-- callback');
- if (err) {
- console.log('Error: ' + JSON.stringify(err));
- } else {
- console.log('User: ' + JSON.stringify(user));
- }
- });
- // Double error issue:
- // ===================
- //
- // activedirectory: ldapjs:
- //
- // findUser()
- // |
- // search()
- // |
- // client ============================ createClient()
- // |
- // retry = backoff.exponential()
- // |
- // x-----------------------------------x
- // |
- // client.on('error', !callback!) ---> this.search()
- // ^ ^ this.connect()
- // | | |
- // | | x-----------------x
- // | | |
- // | | v
- // | | retry.on('ready', function)
- // | | |
- // | | connectSocket()
- // | | onConnect()
- // | | setupClient()
- // | | forEachPipeline()
- // | | |
- // | | v
- // | | this.on('setup', function(err, cb))
- // | | | |
- // | | | retry.backoff(err)
- // | | | |
- // | | | x----------------x
- // | | (Solution is get rid this)-->X |
- // | | | v
- // | | | retry.on('fail', function)
- // | | | |
- // | | | x-------------------x
- // | | | |
- // | | v v
- // | | self.emit('error', err)
- // | | | |
- // | x---------------------------------------x |
- // x-------------------------------------------x
- //
- //
- // Fix:
- // ====
- //
- // ldapjs/lib/client/client.js:348
- //
- // clt.bind(options.bindDN, options.bindCredentials, function (err) {
- // if (err) {
- // self.emit('error', err);
- // }
- // cb(err);
- // });
- //
- // to
- //
- // clt.bind(options.bindDN, options.bindCredentials, cb);
- //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement