passport-ldapauth
passport-ldapauth copied to clipboard
Real Error should also been handled as failed if multiple url provided
- [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions, such as how to use the library, there).
- [x] I believe this is an issue in this library and not in the underlying libraries ldapjs or ldapauth-fork. (This library is a passport strategy and does not implement the LDAP communication)
Problem Description
when given multiple ldap server url, when first ldap server is not connectable, will throw error to callback.
Steps to Reproduce
- set two ldap server for strategy(one main and one backup), make main one not connectable and backup one run properly
- try to login a correct user.
- error will be thrown when main ldap server failed to connect as connection error is considered as other errors.
my internal solution is passthrough error returned by passport which code is eqaul to ETIMEDOUT
or ECONNREFUSED
, if the url is match main server, but I feel unsafe using such method to passthrough error and it may cause request hang.