mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-22 12:02:14 +00:00
SEC-1145: Updated LDAP code to make sure pooling flag is removed when binding as a specific user (for real this time)
This commit is contained in:
parent
b77f780993
commit
781c99f257
@ -5,6 +5,7 @@ import static org.junit.Assert.assertNull;
|
|||||||
import javax.naming.directory.DirContext;
|
import javax.naming.directory.DirContext;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.springframework.security.BadCredentialsException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luke Taylor
|
* @author Luke Taylor
|
||||||
@ -30,4 +31,16 @@ public class DefaultSpringSecurityContextSourceTests extends AbstractLdapIntegra
|
|||||||
ctx.close();
|
ctx.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(expected=BadCredentialsException.class)
|
||||||
|
public void poolingIsntUsedForSingleUser2() throws Exception {
|
||||||
|
DirContext ctx = getContextSource().getReadWriteContext("uid=Bob,ou=people,dc=springframework,dc=org", "bobspassword");
|
||||||
|
com.sun.jndi.ldap.LdapPoolManager.showStats(System.out);
|
||||||
|
ctx.close();
|
||||||
|
com.sun.jndi.ldap.LdapPoolManager.showStats(System.out);
|
||||||
|
// Now get it gain, with wrong password
|
||||||
|
ctx = getContextSource().getReadWriteContext("uid=Bob,ou=people,dc=springframework,dc=org", "wrongpassword");
|
||||||
|
com.sun.jndi.ldap.LdapPoolManager.showStats(System.out);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user