Skip to content

Commit

Permalink
Support LDAP with anonymous bind disabled
Browse files Browse the repository at this point in the history
For many users, enabling anonymous bind is not an option from security
perspective.

Test coverage is provided by disabling anonymous bind in the LDAP server
used in product tests --
trinodb/docker-images@4fc1925
  • Loading branch information
findepi committed Jan 29, 2019
1 parent 6dada93 commit a1c4802
Showing 1 changed file with 0 additions and 11 deletions.
Expand Up @@ -76,7 +76,6 @@ public LdapAuthenticator(LdapConfig serverConfig)
.put(INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory")
.put(PROVIDER_URL, ldapUrl)
.build();
checkEnvironment(environment);
this.basicEnvironment = environment;
this.authenticationCache = CacheBuilder.newBuilder()
.expireAfterWrite(serverConfig.getLdapCacheTtl().toMillis(), MILLISECONDS)
Expand Down Expand Up @@ -175,16 +174,6 @@ private static String replaceUser(String pattern, String user)
return pattern.replaceAll("\\$\\{USER}", user);
}

private static void checkEnvironment(Map<String, String> environment)
{
try {
closeContext(createDirContext(environment));
}
catch (NamingException e) {
throw new RuntimeException(e);
}
}

private static void closeContext(DirContext context)
{
try {
Expand Down

0 comments on commit a1c4802

Please sign in to comment.