I am using Spring Security 3.2.5 with Java config and LDAP authentication/authorization.
We have a requirement to search for groups in two separate trees in LDAP.
ou=groups
and
ou=Groups,ou=webapps,ou=Applications
I have searched and have been unable to find any information on this topic.
This is my current code which is working fine:
@Autowired
public void configureGlobal(UserDetailsContextMapper userDetailsContextMapper, LdapContextSource contextSource, AuthenticationManagerBuilder builder) throws Exception {
builder
.ldapAuthentication()
.userDetailsContextMapper(userDetailsContextMapper)
.contextSource(contextSource)
.userSearchFilter("cn={0}")
.userSearchBase("ou=Users")
.groupSearchBase("ou=groups");
}
I want to do something like this:
builder
.ldapAuthentication()
.userDetailsContextMapper(userDetailsContextMapper)
.contextSource(contextSource)
.userSearchFilter("cn={0}")
.userSearchBase("ou=Users")
.groupSearchBase("ou=groups")
.groupSearchBase("ou=Groups,ou=webapps,ou=Applications");
Which understandably does not work.
Anyone have any pointers on where to start?