public class UserGroupLdapAuthoritiesPopulator
extends org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
implements org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator
groupToRoleMap
property either in a Spring context file or by calling setGroupToRoleMap(Map)
.Constructor and Description |
---|
UserGroupLdapAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource,
String groupSearchBase) |
Modifier and Type | Method and Description |
---|---|
protected Set<org.springframework.security.core.GrantedAuthority> |
getAdditionalRoles(org.springframework.ldap.core.DirContextOperations user,
String username)
This function returns a list of roles from the given set of groups
based on the value of the
groupToRoleMap property. |
void |
setGroupRoleAttribute(String groupRoleAttribute) |
void |
setGroupSearchFilter(String groupSearchFilter) |
void |
setGroupToRoleMap(Map<String,List<String>> groupToRoleMap)
This property contains a set of group to role mappings.
|
void |
setSearchSubtree(boolean searchSubtree) |
getContextSource, getGrantedAuthorities, getGroupMembershipRoles, getGroupSearchBase, setConvertToUpperCase, setDefaultRole, setIgnorePartialResultException, setRolePrefix
public UserGroupLdapAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase)
protected Set<org.springframework.security.core.GrantedAuthority> getAdditionalRoles(org.springframework.ldap.core.DirContextOperations user, String username)
groupToRoleMap
property.getAdditionalRoles
in class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
Set
object.public void setGroupRoleAttribute(String groupRoleAttribute)
setGroupRoleAttribute
in class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
public void setGroupSearchFilter(String groupSearchFilter)
setGroupSearchFilter
in class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
public void setGroupToRoleMap(Map<String,List<String>> groupToRoleMap)
This property contains a set of group to role mappings. Both values are specified as string values.
An example Spring context that sets this property could be:
<property xmlns="http://www.springframework.org/schema/beans" name="groupToRoleMap">
<map>
<entry>
<key><value>CompanyX_OpenNMS_User_Group</value></key>
<list>
<value>ROLE_USER</value>
</list>
</entry>
</map>
</property>
public void setSearchSubtree(boolean searchSubtree)
setSearchSubtree
in class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
Copyright © 2016. All rights reserved.