Class CustomDefaultLdapAuthoritiesPopulator
java.lang.Object
org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
com.xebialabs.deployit.security.authentication.CustomDefaultLdapAuthoritiesPopulator
- All Implemented Interfaces:
org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator
public class CustomDefaultLdapAuthoritiesPopulator
extends org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
Custom authorities populator based on
DefaultLdapAuthoritiesPopulator 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
ConstructorsConstructorDescriptionCustomDefaultLdapAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase) Constructor for group search scenarios.CustomDefaultLdapAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase, int pageSize) Constructor for group search scenarios. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.security.ldap.SpringSecurityLdapTemplatevoidsetIgnoreNameNotFoundException(boolean ignore) Sets the corresponding property on the underlying template, avoiding specific issues with Active Directory.voidsetIgnoreSizeLimitExceededException(boolean ignore) Sets the corresponding property on the underlying template, avoiding specific issues with Active Directory.voidsetSearchSubtree(boolean searchSubtree) Methods inherited from class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
getAdditionalRoles, getContextSource, getGrantedAuthorities, getGroupMembershipRoles, getGroupRoleAttribute, getGroupSearchBase, getGroupSearchFilter, getRolePrefix, isConvertToUpperCase, setAuthorityMapper, setConvertToUpperCase, setDefaultRole, setGroupRoleAttribute, setGroupSearchFilter, setIgnorePartialResultException, setRolePrefix
-
Constructor Details
-
CustomDefaultLdapAuthoritiesPopulator
public CustomDefaultLdapAuthoritiesPopulator(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 context factory. If null, no search will be performed.
-
CustomDefaultLdapAuthoritiesPopulator
public CustomDefaultLdapAuthoritiesPopulator(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:
getLdapTemplatein classorg.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
-
setSearchSubtree
public void setSearchSubtree(boolean searchSubtree) - Overrides:
setSearchSubtreein classorg.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:
-
setIgnoreNameNotFoundException
public void setIgnoreNameNotFoundException(boolean ignore) Sets the corresponding property on the underlying template, avoiding specific issues with Active Directory.- See Also:
-