1 | # ldap-client
|
2 | This is a simple wrapper library to make it easier to do basic LDAP operations
|
3 | like changing a password, resetting a password, and authenticating.
|
4 |
|
5 | ## Usage
|
6 | ```js
|
7 | const ldapClient = require('ldap-client')
|
8 | const url = 'ldaps://ad1.dcloud.cisco.com:636/'
|
9 | const baseDn = 'DC=dcloud,DC=cisco,DC=com'
|
10 | const upn = 'sjeffers@dcloud.cisco.com'
|
11 | const password = 'C1sco12345'
|
12 |
|
13 | // init client
|
14 | let ldap = new ldapClient(url, baseDn)
|
15 |
|
16 | // attempt authentication
|
17 | ldap.authenticate({ upn, password })
|
18 | .then(() => {
|
19 | console.log('authentication successful')
|
20 | })
|
21 | .catch(error => {
|
22 | console.log(error)
|
23 | })
|
24 | ```
|