org.pentaho.platform.plugin.services.security.userrole.ldap
Class RolePreprocessingMapper

java.lang.Object
  extended by org.springframework.security.userdetails.ldap.LdapUserDetailsMapper
      extended by org.pentaho.platform.plugin.services.security.userrole.ldap.RolePreprocessingMapper
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.security.userdetails.ldap.UserDetailsContextMapper

public class RolePreprocessingMapper
extends org.springframework.security.userdetails.ldap.LdapUserDetailsMapper
implements org.springframework.beans.factory.InitializingBean

Extension of LdapUserDetailsMapper which extracts the value of the component named tokenName within any attribute in roleAttributes.

Example LDIF:

        dn: uid=joe,ou=users,ou=system
        ...
        uniqueMember: cn=ceo,ou=roles
 
Assume 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.

Author:
mlowery

Constructor Summary
RolePreprocessingMapper()
           
RolePreprocessingMapper(String tokenName)
           
 
Method Summary
 void afterPropertiesSet()
           
 String getTokenName()
           
 void setTokenName(String tokenName)
           
 
Methods inherited from class org.springframework.security.userdetails.ldap.LdapUserDetailsMapper
mapUserFromContext, mapUserToContext, setConvertToUpperCase, setPasswordAttributeName, setRoleAttributes, setRolePrefix
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RolePreprocessingMapper

public RolePreprocessingMapper()

RolePreprocessingMapper

public RolePreprocessingMapper(String tokenName)
Method Detail

setTokenName

public void setTokenName(String tokenName)

getTokenName

public String getTokenName()

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception