SEC-1848: LDAP encode name when using user DN patterns in AbstractLdapAuthenticator.

This commit is contained in:
Luke Taylor
2011-11-01 13:28:56 +00:00
parent 8fd2963e6b
commit 8e1d407e3e
2 changed files with 4 additions and 2 deletions

View File

@@ -55,10 +55,11 @@ public class BindAuthenticatorTests extends AbstractLdapIntegrationTests {
@Test
public void testAuthenticationWithCorrectPasswordSucceeds() {
authenticator.setUserDnPatterns(new String[] {"uid={0},ou=people"});
authenticator.setUserDnPatterns(new String[] {"uid={0},ou=people", "cn={0},ou=people"});
DirContextOperations user = authenticator.authenticate(bob);
assertEquals("bob", user.getStringAttribute("uid"));
authenticator.authenticate(new UsernamePasswordAuthenticationToken("mouse, jerry", "jerryspassword"));
}
@Test