Class NoOpLdapAuthoritiesPopulator

  • All Implemented Interfaces:
    org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator

    public class NoOpLdapAuthoritiesPopulator
    extends Object
    implements org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator
    For use when authorities are stored in the user object (e.g. objectClass=Person) and therefore retrieved by an UserDetailsContextMapper instance. This class helps since LdapUserDetailsService requires a non-null LdapAuthoritiesPopulator instance.

    LdapAuthenticationProvider actually defines a NullLdapAuthoritiesPopulator which does the same thing as this class. Unfortunately, NullLdapAuthoritiesPopulator is not visible outside of LdapAuthenticationProvider.

    Author:
    mlowery
    • Constructor Detail

      • NoOpLdapAuthoritiesPopulator

        public NoOpLdapAuthoritiesPopulator()
    • Method Detail

      • getGrantedAuthorities

        public Collection<? extends org.springframework.security.core.GrantedAuthority> getGrantedAuthorities​(org.springframework.ldap.core.DirContextOperations userDetails,
                                                                                                              String username)
        Specified by:
        getGrantedAuthorities in interface org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator