diff --git service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java index 7292cd9..0bd067b 100644 --- service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java +++ service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java @@ -46,6 +46,11 @@ public void Authenticate(String user, String password) throws AuthenticationExce env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, ldapURL); + if (password == null || password.isEmpty()) { + throw new AuthenticationException("Error validating LDAP user:" + + " a null or blank password has been provided"); + } + // If the domain is available in the config, then append it unless domain is // already part of the username. LDAP providers like Active Directory use a // fully qualified user name like foo@bar.com.