Class DefaultLdapAuthoritiesPopulator

java.lang.Object
com.codename1.backend.security.ldap.DefaultLdapAuthoritiesPopulator
All Implemented Interfaces:
LdapAuthoritiesPopulator

public final class DefaultLdapAuthoritiesPopulator extends Object implements LdapAuthoritiesPopulator
Roles from the groups a user is a member of, as Spring's: the groups under a search base whose member names the user, each group's cn becoming ROLE_ and its name in upper case. {0} in the filter is the user's DN, {1} the user name.
  • Constructor Details

    • DefaultLdapAuthoritiesPopulator

      public DefaultLdapAuthoritiesPopulator(LdapContextSource contextSource, String groupSearchBase)
      Parameters:
      groupSearchBase - relative to the base; null for no group search
  • Method Details

    • setGroupSearchFilter

      public void setGroupSearchFilter(String filter)
    • setGroupRoleAttribute

      public void setGroupRoleAttribute(String attribute)
    • setRolePrefix

      public void setRolePrefix(String prefix)
    • setConvertToUpperCase

      public void setConvertToUpperCase(boolean convert)
    • setSearchSubtree

      public void setSearchSubtree(boolean searchSubtree)
      Whether to look below the group search base; false by default, as Spring's.
    • setDefaultRole

      public void setDefaultRole(String role)
      A role every user signed in this way has.
    • getGrantedAuthorities

      public Collection<GrantedAuthority> getGrantedAuthorities(LdapEntry user, String username)
      Specified by:
      getGrantedAuthorities in interface LdapAuthoritiesPopulator