public class RolePreprocessingMapper
extends org.springframework.security.ldap.userdetails.LdapUserDetailsMapper
implements org.springframework.beans.factory.InitializingBean
LdapUserDetailsMapper
which extracts the value of the component named
tokenName
within any attribute in roleAttributes
.
Example LDIF:
dn: uid=admin,ou=users,ou=system ... uniqueMember: cn=ceo,ou=rolesAssume that you want the value of the
cn
component within the value of the uniqueMember
attribute to be used as the role name.
You would use mapper.setTokenName("cn")
or the equivalent to this setter call in your Spring beans XML.Constructor and Description |
---|
RolePreprocessingMapper() |
RolePreprocessingMapper(String tokenName) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected org.springframework.security.core.GrantedAuthority |
createAuthority(Object role) |
String |
getTokenName() |
protected Object |
preprocessRole(Object role) |
void |
setTokenName(String tokenName) |
public RolePreprocessingMapper()
public RolePreprocessingMapper(String tokenName)
protected org.springframework.security.core.GrantedAuthority createAuthority(Object role)
createAuthority
in class org.springframework.security.ldap.userdetails.LdapUserDetailsMapper
public void setTokenName(String tokenName)
public String getTokenName()
Copyright © 2019 Hitachi Vantara. All rights reserved.