DefaultLdapLoginPlugin implements OnLoginRunnable { @Override public boolean validateUser(String userId, String password, String encPass, Object encoder, Object salt) { if (!ldapContext.isEnabled()) { throw new BadCredentialsException("LDAP login is disabled"); } Entry userEntry = getUserFromLDAP(userId); try { LDAPConnection authConnection = ldapContext.getLdapConnection(userEntry.getDN(), password); return authConnection.isConnected(); } catch (Exception e) { throw new BadCredentialsException("Invalid LDAP credential", e); } }  @Override User loadUser(String userId); @Override boolean validateUser(String userId, String password, String encPass, Object encoder, Object salt); @Deprecated @Override void saveUser(User user);  }
@Test public void testValidateUser() { assertTrue(defaultLdapLoginPlugin.validateUser(LDAP_TEST_USER_ID, LDAP_TEST_USER_PASSWORD, null, null, null)); }