![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)
ldap-get-user
Get user from LDAP returns object
Set options
const options = {
user: 'riemann',
url: 'ldap://ldap.forumsys.com:389',
bindDn: 'cn=read-only-admin,dc=example,dc=com',
bindCredentials: 'password',
searchBase: 'dc=example,dc=com',
searchFilter: '(sAMAccountName={{username}})'
}
Using promises
getLdapUser(options).then((data) => {
console.log(data)
process.exit()
}).catch((err) => {
console.error(err)
process.exit()
})
Using callbacks
getLdapUser(options, (err, data) => {
if (err) {
console.log(err)
process.exit(0)
} else {
console.log(data)
}
})
License
MIT