ldapjs

Use ldapjs with bluebird promise

会有一股神秘感。 提交于 2020-01-13 10:42:09
问题 I posted something similar here: Use ldapjs with promise. Unfortunately, it is still unsolved. This time I tried bluebird and hopefully I can get some luck. // https://www.npmjs.com/package/ldapjs var Promise = require('bluebird'); var ldap = Promise.promisifyAll( require('ldapjs') ); var config = require('./config'); var print_r = require('print_r').print_r; var my_filter = "(&(objectCategory=person)(objectClass=user)" + "(cn=" + 'someone' + "))"; var ldap_username = config.ad.username; var

Use ldapjs with promise

帅比萌擦擦* 提交于 2019-12-13 20:52:28
问题 I want to convert the following code to use promise. It is working and output a user's attributes within the active directory. var client = ldap.createClient({ url: ldap_url }); client.bind(ldap_username, ldap_password, function (err) { client.search(ldap_dn_search, opts, function (err, search) { search.on('searchEntry', function (entry) { var user = entry.object; // It is working!!!. It outputs all user attributes. console.log(user); }); }); }); The following is my attempt, butit doesn't

Use ldapjs with bluebird promise

a 夏天 提交于 2019-12-05 10:36:41
I posted something similar here: Use ldapjs with promise . Unfortunately, it is still unsolved. This time I tried bluebird and hopefully I can get some luck. // https://www.npmjs.com/package/ldapjs var Promise = require('bluebird'); var ldap = Promise.promisifyAll( require('ldapjs') ); var config = require('./config'); var print_r = require('print_r').print_r; var my_filter = "(&(objectCategory=person)(objectClass=user)" + "(cn=" + 'someone' + "))"; var ldap_username = config.ad.username; var ldap_password = config.ad.password; var ldap_url = config.ad.url; var ldap_dn_search = config.ad.dn