1.0.9 • Published 7 years ago

ldap-get-user v1.0.9

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Build Status js-standard-style

ldap-get-user

Greenkeeper badge Get user from LDAP returns object

Set options

const options = {
  user: 'riemann', // The user to get
  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}})'
  /* If LDAPS use ldaps in URL and tlsOptions
  tlsOptions: {
    rejectUnauthorized: true,
    ca: [
      fs.readFileSync(path.join(__dirname, 'filename')
    ]
  }
  */
}

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

1.0.9

7 years ago

1.0.7

7 years ago

1.0.5

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago