SEC-836: Made LDAP namespace elements use subtree group searching by default.
This commit is contained in:
parent
871e529840
commit
45c3084502
|
@ -123,6 +123,7 @@ public class LdapUserServiceBeanDefinitionParser extends AbstractUserDetailsServ
|
|||
populator.addConstructorArg(parseServerReference(elt, parserContext));
|
||||
populator.addConstructorArg(groupSearchBase);
|
||||
populator.addPropertyValue("groupSearchFilter", groupSearchFilter);
|
||||
populator.addPropertyValue("searchSubtree", Boolean.TRUE);
|
||||
|
||||
if (StringUtils.hasText(rolePrefix)) {
|
||||
if ("none".equals(rolePrefix)) {
|
||||
|
|
|
@ -38,8 +38,8 @@ public class LdapProviderBeanDefinitionParserTests {
|
|||
Authentication auth = provider.authenticate(new UsernamePasswordAuthenticationToken("ben", "benspassword"));
|
||||
LdapUserDetailsImpl ben = (LdapUserDetailsImpl) auth.getPrincipal();
|
||||
|
||||
assertEquals(2, ben.getAuthorities().length);
|
||||
}
|
||||
assertEquals(3, ben.getAuthorities().length);
|
||||
}
|
||||
|
||||
@Test(expected = SecurityConfigurationException.class)
|
||||
public void missingServerEltCausesConfigException() {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class LdapUserServiceBeanDefinitionParserTests {
|
|||
UserDetails ben = uds.loadUserByUsername("ben");
|
||||
|
||||
Set authorities = AuthorityUtils.authorityArrayToSet(ben.getAuthorities());
|
||||
assertEquals(2, authorities.size());
|
||||
assertEquals(3, authorities.size());
|
||||
assertTrue(authorities.contains("ROLE_DEVELOPERS"));
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class LdapUserServiceBeanDefinitionParserTests {
|
|||
UserDetails ben = uds.loadUserByUsername("ben");
|
||||
|
||||
Set authorities = AuthorityUtils.authorityArrayToSet(ben.getAuthorities());
|
||||
assertEquals(2, authorities.size());
|
||||
assertEquals(3, authorities.size());
|
||||
assertTrue(authorities.contains(new GrantedAuthorityImpl("ROLE_DEVELOPER")));
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue