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

Support LDAP with anonymous bind disabled #11714

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ services:
- CLI_ARGUMENTS=--server https://presto-master:8443 --keystore-path /etc/openldap/certs/coordinator.jks --keystore-password testldap

ldapserver:
image: 'prestodb/centos6-oj8-openldap:${DOCKER_IMAGES_VERSION}'
image: 'prestodb/centos6-oj8-openldap:4fc1925'