passport-ldapauth icon indicating copy to clipboard operation
passport-ldapauth copied to clipboard

Real Error should also been handled as failed if multiple url provided

Open Sczlog opened this issue 1 year ago • 0 comments

  • [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

  1. set two ldap server for strategy(one main and one backup), make main one not connectable and backup one run properly
  2. try to login a correct user.
  3. error will be thrown when main ldap server failed to connect as connection error is considered as other errors. image

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.

Sczlog avatar Jun 14 '23 07:06 Sczlog