Summary
When the authentication to an LDAP endpoint fails, do not retry authentication against other endpoints. Restore this behavior from the state previous to JDK-8160768.
Problem
If the authentication to an LDAP endpoint fails because of providing wrong credentials (i.e.: a typo while entering the password), the OpenJDK client may automatically try on other endpoints without any different result expected. In addition to the resources spent, this situation can lead to the LDAP user blocked after exceeding the maximum number of authentication attempts.
Solution
After getting an authentication failure on an LDAP endpoint, stop any further authentication attempts on other endpoints. The rationale behind is that the LDAP endpoint that responded with the authentication failure is alive and there is no need to keep trying.
Specification
From a specification point of view, there is no need to modify any public or internal APIs to implement this behavioral change because the methods com.sun.jndi.ldap.LdapCtxFactory::getUsingURL
and com.sun.jndi.ldap.LdapCtxFactory::getUsingURLs
already declare to throw a javax.naming.NamingException
exception, and javax.naming.AuthenticationException
is a subclass of it. The only difference is the change of behavior while iterating the URLs.
- csr of
-
JDK-8275535 Retrying a failed authentication on multiple LDAP servers can lead to users blocked
-
- Resolved
-