public LdapAuthenticationProviderImpl(HiveConf conf) { this(conf, new LdapSearchFactory()); }
/** * {@inheritDoc} */ @Override public DirSearch getInstance(HiveConf conf, String principal, String password) throws AuthenticationException { try { DirContext ctx = createDirContext(conf, principal, password); return new LdapSearch(conf, ctx); } catch (NamingException e) { LOG.debug("Could not connect to the LDAP Server:Authentication failed for {}", principal); throw new AuthenticationException("Error validating LDAP user", e); } }
@Test public void authenticateGivenBlankPassword() throws Exception { auth = new LdapAuthenticationProviderImpl(conf, new LdapSearchFactory()); expectAuthenticationExceptionForInvalidPassword(); auth.Authenticate("user", ""); }
/** * {@inheritDoc} */ @Override public DirSearch getInstance(HiveConf conf, String principal, String password) throws AuthenticationException { try { DirContext ctx = createDirContext(conf, principal, password); return new LdapSearch(conf, ctx); } catch (NamingException e) { LOG.debug("Could not connect to the LDAP Server:Authentication failed for {}", principal); throw new AuthenticationException("Error validating LDAP user", e); } }
@Test public void authenticateGivenNullForPassword() throws Exception { auth = new LdapAuthenticationProviderImpl(conf, new LdapSearchFactory()); expectAuthenticationExceptionForInvalidPassword(); auth.Authenticate("user", null); }
@Test public void authenticateGivenStringWithNullCharacterForPassword() throws Exception { auth = new LdapAuthenticationProviderImpl(conf, new LdapSearchFactory()); expectAuthenticationExceptionForInvalidPassword(); auth.Authenticate("user", "\0"); }
public LdapAuthenticationProviderImpl(HiveConf conf) { this(conf, new LdapSearchFactory()); }