Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8275535: Retrying a failed authentication on multiple LDAP servers can lead to users blocked #268

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java
Expand Up @@ -189,6 +189,10 @@ private static DirContext getUsingURL(String url, Hashtable<?,?> env)
ctx = getLdapCtxFromUrl(
r.getDomainName(), url, new LdapURL(u), env);
return ctx;
} catch (AuthenticationException e) {
// do not retry on a different endpoint to avoid blocking
// the user if authentication credentials are wrong.
throw e;
} catch (NamingException e) {
// try the next element
lastException = e;
Expand Down Expand Up @@ -241,6 +245,10 @@ private static DirContext getUsingURLs(String[] urls, Hashtable<?,?> env)
for (String u : urls) {
try {
return getUsingURL(u, env);
} catch (AuthenticationException e) {
// do not retry on a different endpoint to avoid blocking
// the user if authentication credentials are wrong.
throw e;
} catch (NamingException e) {
ex = e;
}
Expand Down