/** * Obtains the authorities for the user who's directory entry is represented by the supplied * LdapUserDetails object. * * @param user the user who's authorities are required (or user:password to be used to bind to * ldap server prior to the search operations). * @return the set of roles granted to the user. */ public final Collection<GrantedAuthority> getGrantedAuthorities( final DirContextOperations user, final String username) { return getGrantedAuthorities(user, username, null); }
/** * We need to give authoritiesPopulator both username and password, so * it can bind to the LDAP server. */ @Override protected Collection<? extends GrantedAuthority> loadUserAuthorities( DirContextOperations userData, String username, String password) { return ((BindingLdapAuthoritiesPopulator) getAuthoritiesPopulator()) .getGrantedAuthorities(userData, username, password); } };