@Override @SuppressWarnings("rawtypes") public void setupEnvironment(Hashtable env, String dn, String password) { super.setupEnvironment(env, dn, password); // Remove the pooling flag unless we are authenticating as the 'manager' // user. if (!DefaultSpringSecurityContextSource.this.userDn.equals(dn) && env.containsKey(SUN_LDAP_POOLING_FLAG)) { DefaultSpringSecurityContextSource.this.logger .debug("Removing pooling flag for user " + dn); env.remove(SUN_LDAP_POOLING_FLAG); } } });
@Override @SuppressWarnings("unchecked") public void setupEnvironment(Hashtable env, String dn, String password) { super.setupEnvironment(env, dn, password); // Remove the pooling flag unless we are authenticating as the 'manager' user. if (!userDn.equals(dn) && env.containsKey(SUN_LDAP_POOLING_FLAG)) { logger.debug("Removing pooling flag for user " + dn); env.remove(SUN_LDAP_POOLING_FLAG); } } });
@Override @SuppressWarnings("rawtypes") public void setupEnvironment(Hashtable env, String dn, String password) { super.setupEnvironment(env, dn, password); // Remove the pooling flag unless we are authenticating as the 'manager' // user. if (!DefaultSpringSecurityContextSource.this.userDn.equals(dn) && env.containsKey(SUN_LDAP_POOLING_FLAG)) { DefaultSpringSecurityContextSource.this.logger .debug("Removing pooling flag for user " + dn); env.remove(SUN_LDAP_POOLING_FLAG); } } });
@Test public void testSetupEnvironment() { Hashtable env = new Hashtable(); tested.setupEnvironment(env, "cn=John Doe", "pw"); assertThat(env.get(Context.SECURITY_AUTHENTICATION)).isEqualTo("simple"); assertThat(env.get(Context.SECURITY_PRINCIPAL)).isEqualTo("cn=John Doe"); assertThat(env.get(Context.SECURITY_CREDENTIALS)).isEqualTo("pw"); }