I have an application configured with LDAP and it works perfectly fine. But now I would need to pull details of users manager. I am not able to get the details please find the details
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws
Exception {
auth
.ldapAuthentication()
.userSearchBase("dc=ab,dc=test,dc=com")
.userSearchFilter("TestName={0}")
.groupSearchBase("ou=Groups,dc=ab,dc=test,dc=com")
.groupSearchFilter("member={1}")
.groupRoleAttribute("cn")
.userDetailsContextMapper(userContextMapper())
.contextSource(contextSource());
}
@Bean
public LdapContextSource contextSource() {
LdapContextSource contextSource= new LdapContextSource();
contextSource.setUrl("ldap:test");
contextSource.setUserDn("CN=,OU=Accounts,DC=ab,DC=test,DC=com");
contextSource.setPassword();
return contextSource;
}
@Bean
public InetOrgPersonContextMapper userContextMapper() {
return new InetOrgPersonContextMapper();
}
I am able to fetch user but I need users manager details.