Class CustomNestedLdapAuthoritiesPopulator

java.lang.Object
org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
org.springframework.security.ldap.userdetails.NestedLdapAuthoritiesPopulator
com.xebialabs.deployit.security.authentication.CustomNestedLdapAuthoritiesPopulator
All Implemented Interfaces:
org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator

public class CustomNestedLdapAuthoritiesPopulator extends org.springframework.security.ldap.userdetails.NestedLdapAuthoritiesPopulator
Custom nested authorities populator based on NestedLdapAuthoritiesPopulator which uses pagination. Use this poplulator only if pagination support is required. Issue was reported with spring-security (https://github.com/spring-projects/spring-security/issues/14741). Once fixed, remove this class.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomNestedLdapAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase)
    Constructor for group search scenarios.
    CustomNestedLdapAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase, int pageSize)
    Constructor for group search scenarios.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.security.ldap.SpringSecurityLdapTemplate
     
    void
    Sets the corresponding property on the underlying template, avoiding specific issues with Active Directory.
    void
    Sets the corresponding property on the underlying template, avoiding specific issues with Active Directory.
    void
    setSearchSubtree(boolean searchSubtree)
     

    Methods inherited from class org.springframework.security.ldap.userdetails.NestedLdapAuthoritiesPopulator

    getGroupMembershipRoles, setAttributeNames, setMaxSearchDepth

    Methods inherited from class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator

    getAdditionalRoles, getContextSource, getGrantedAuthorities, getGroupRoleAttribute, getGroupSearchBase, getGroupSearchFilter, getRolePrefix, isConvertToUpperCase, setAuthorityMapper, setConvertToUpperCase, setDefaultRole, setGroupRoleAttribute, setGroupSearchFilter, setIgnorePartialResultException, setRolePrefix

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CustomNestedLdapAuthoritiesPopulator

      public CustomNestedLdapAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase)
      Constructor for group search scenarios. userRoleAttributes may still be set as a property.
      Parameters:
      contextSource - supplies the contexts used to search for user roles.
      groupSearchBase - if this is an empty string the search will be performed from the root DN of the
    • CustomNestedLdapAuthoritiesPopulator

      public CustomNestedLdapAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase, int pageSize)
      Constructor for group search scenarios. userRoleAttributes may still be set as a property.
      Parameters:
      contextSource - supplies the contexts used to search for user roles.
      groupSearchBase - if this is an empty string the search will be performed from the root DN of the context factory. If null, no search will be performed.
      pageSize - pageSize with pagedResultsControl for search operations.
  • Method Details

    • getLdapTemplate

      protected org.springframework.security.ldap.SpringSecurityLdapTemplate getLdapTemplate()
      Overrides:
      getLdapTemplate in class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
    • setSearchSubtree

      public void setSearchSubtree(boolean searchSubtree)
      Overrides:
      setSearchSubtree in class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
    • setIgnoreSizeLimitExceededException

      public void setIgnoreSizeLimitExceededException(boolean ignore)
      Sets the corresponding property on the underlying template, avoiding specific issues with Active Directory.
      See Also:
      • LdapTemplate.setIgnoreSizeLimitExceededException(boolean)
    • setIgnoreNameNotFoundException

      public void setIgnoreNameNotFoundException(boolean ignore)
      Sets the corresponding property on the underlying template, avoiding specific issues with Active Directory.
      See Also:
      • LdapTemplate.setIgnoreNameNotFoundException(boolean)