Class TrimerLdapAuthoritiesPopulator
- java.lang.Object
-
- com.im.df.security.mechanim.ldap.authorization.IJCAbstractLdapAuthoritiesPopulator
-
- com.im.df.security.mechanim.ldap.authorization.TrimerLdapAuthoritiesPopulator
-
- All Implemented Interfaces:
org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator
public final class TrimerLdapAuthoritiesPopulator extends IJCAbstractLdapAuthoritiesPopulator
This class is an extension toDefaultLdapAuthoritiesPopulator
with two extra attributes which allows the user to configure the class to remove a suffix or a prefix from the role retrieved from the LDAP prior to using them for authorization. The attributes are suffixFixToRemove and prefixToRemove which one can set their values e.g in the bean configuration file- Author:
- Masoud Kalali
-
-
Field Summary
-
Fields inherited from class com.im.df.security.mechanim.ldap.authorization.IJCAbstractLdapAuthoritiesPopulator
convertToUpperCase, defaultRole, groupRoleAttribute, groupSearchBase, groupSearchFilter, ldapTemplate, rolePrefix, searchControls
-
-
Constructor Summary
Constructors Constructor Description TrimerLdapAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<org.springframework.security.core.GrantedAuthority>
getAdditionalRoles(org.springframework.ldap.core.DirContextOperations user, String username)
Collection<org.springframework.security.core.GrantedAuthority>
getGrantedAuthorities(org.springframework.ldap.core.DirContextOperations user, String username)
Set<org.springframework.security.core.GrantedAuthority>
getGroupMembershipRoles(String userDn, String username)
void
setIgnorePartialResultException(boolean ignore)
void
setPrefixToRemove(String prefixToRemove)
void
setSuffixFixToRemove(String suffixFixToRemove)
-
Methods inherited from class com.im.df.security.mechanim.ldap.authorization.IJCAbstractLdapAuthoritiesPopulator
getContextSource, getGroupSearchBase, setConvertToUpperCase, setDefaultRole, setGroupRoleAttribute, setGroupSearchBase, setGroupSearchFilter, setRolePrefix, setSearchSubtree
-
-
-
-
Constructor Detail
-
TrimerLdapAuthoritiesPopulator
public TrimerLdapAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase)
-
-
Method Detail
-
getAdditionalRoles
protected Set<org.springframework.security.core.GrantedAuthority> getAdditionalRoles(org.springframework.ldap.core.DirContextOperations user, String username)
-
getGrantedAuthorities
public Collection<org.springframework.security.core.GrantedAuthority> getGrantedAuthorities(org.springframework.ldap.core.DirContextOperations user, String username)
-
getGroupMembershipRoles
public Set<org.springframework.security.core.GrantedAuthority> getGroupMembershipRoles(String userDn, String username)
-
setIgnorePartialResultException
public void setIgnorePartialResultException(boolean ignore)
-
setSuffixFixToRemove
public void setSuffixFixToRemove(String suffixFixToRemove)
-
setPrefixToRemove
public void setPrefixToRemove(String prefixToRemove)
-
-