Class LdapAweUserDetailsMapper

java.lang.Object
com.almis.awe.config.ServiceConfig
com.almis.awe.service.user.LdapAweUserDetailsMapper
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.security.ldap.userdetails.UserDetailsContextMapper

public class LdapAweUserDetailsMapper extends ServiceConfig implements org.springframework.security.ldap.userdetails.UserDetailsContextMapper
Custom ldap user details mapper Used to set UserDetails
  • Constructor Details

    • LdapAweUserDetailsMapper

      public LdapAweUserDetailsMapper(org.springframework.security.core.userdetails.UserDetailsService userDetailService)
      Autowired constructor
      Parameters:
      userDetailService - AWE user detaill service
  • Method Details

    • mapUserFromContext

      public org.springframework.security.core.userdetails.UserDetails mapUserFromContext(org.springframework.ldap.core.DirContextOperations ctx, String username, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
      Specified by:
      mapUserFromContext in interface org.springframework.security.ldap.userdetails.UserDetailsContextMapper
    • mapUserToContext

      public void mapUserToContext(org.springframework.security.core.userdetails.UserDetails user, org.springframework.ldap.core.DirContextAdapter ctx)
      Specified by:
      mapUserToContext in interface org.springframework.security.ldap.userdetails.UserDetailsContextMapper
    • setConvertToUpperCase

      public void setConvertToUpperCase(boolean convertToUpperCase)
      Determines whether role field values will be converted to upper case when loaded. The default is true.
      Parameters:
      convertToUpperCase - true if the roles should be converted to upper case.
    • setPasswordAttributeName

      public void setPasswordAttributeName(String passwordAttributeName)
      The name of the attribute which contains the user's password. Defaults to "userPassword".
      Parameters:
      passwordAttributeName - the name of the attribute
    • setRoleAttributes

      public void setRoleAttributes(String[] roleAttributes)
      The names of any attributes in the user's entry which represent application roles. These will be converted to GrantedAuthorities and added to the list in the returned LdapUserDetails object. The attribute values must be Strings by default.
      Parameters:
      roleAttributes - the names of the role attributes.
    • setRolePrefix

      public void setRolePrefix(String rolePrefix)
      The prefix that should be applied to the role names
      Parameters:
      rolePrefix - the prefix (defaults to "ROLE_").