1 | var LdapAuth = require('./lib/ldapauth'), fs = require('fs');
|
2 |
|
3 | var opts = {
|
4 | "url": "ldaps://v-eprdnetdc1.eprdnet.local:1398",
|
5 | "adminDn": "cn=Production Monitoring LDAP sa,ou=Service Accounts,OU=Zender,DC=EPRDNET,DC=local",
|
6 | "adminPassword": "R9vExzzv8pzMKxm",
|
7 | "searchBase": "OU=Zender,DC=EPRDNET,DC=local",
|
8 | "searchFilter": "(&(objectClass=person)(sAMAccountName={{username}}))",
|
9 | "searchAttributes": [
|
10 | "dn"
|
11 | ],
|
12 | "tlsOptions": {
|
13 | "ca": [fs.readFileSync("/home/vesse/Downloads/enfo/v-eprdnetdc1.pem")]
|
14 | }
|
15 | };
|
16 |
|
17 | var a = new LdapAuth(opts);
|
18 | var c = 1;
|
19 | var test = function() {
|
20 | console.log('Round', c);
|
21 | a.authenticate('extLVesaP', 'cx3gS0vIhQTEl', function(err, user) {
|
22 | console.log(err, user);
|
23 | c++;
|
24 | setTimeout(function() {
|
25 | test();
|
26 | }, 120000);
|
27 | });
|
28 | }
|
29 |
|
30 | setTimeout(function() {
|
31 | test();
|
32 | }, 1);
|