views:

35

answers:

1

I have an application using Acegi (earlier version of Spring Security) and LDAP for logins. Now, a specific scenario requires me to discover user's LDAP groups at arbitrary time (not at login time).

Is it possible to use already set up Acegi to handle this situation?

I'm thinking of using the configured LdapAuthProvider (or LdapAuthPopulator or whatever's appropriate) to get all the groups associated with a given username. Is this possible?
If yes, please, please, give some hints how it should be done...

A: 

You should use DefaultLdapAuthoritiesPopulator.getGroupMembershipRoles(String userDn, String username).

rodrigoap