Closed theasp closed 5 years ago
Hmm it should reset the adminBound
flag in case of errors but maybe it's not then working as expected. Unfortunately I don't have much time to look at this, but the strategy implementation is quite simple, maybe you could debug it a little further?
It doesn't appear the error event is ever fired. From this issue, https://github.com/joyent/node-ldapjs/issues/392, it appears that this is expected. Near the end there is an example to handle it is by binding using the connect event:
// e.g. in your client's class constructor
this.ldapClient = ldap.createClient({
url: ldap_url,
reconnect: {
initialDelay: 100,
maxDelay: 1000,
failAfter: 10
}
});
const client = this.ldapClient;
// do a rebind when reconnect
this.ldapClient.on('connect', function () {
client.bind(ldap_user, ldap_pwd, err => {
if (err) {
logger.error('error while ldap binding' + err);
}
});
});
PR incoming...
I'm having a problem with authentication not working after my LDAP connection is lost. It's successfully reconnecting, but not binding to the admin user, which prevents logins.
After restarting the LDAP server:
On the next login attempt:
For
reconnect
in options, I'm usinginitialDelay
of 5000 andmaxDelay
of 60000.