Class UsernameAttributeLdapContextMapper

  • All Implemented Interfaces:
    org.springframework.security.ldap.userdetails.UserDetailsContextMapper

    public class UsernameAttributeLdapContextMapper
    extends org.springframework.security.ldap.userdetails.LdapUserDetailsMapper
    LdapUserDetailsMapper implementation to get original username from LDAP by using proper attribute name
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getLdapUsernameAttribute()  
      org.springframework.security.core.userdetails.UserDetails mapUserFromContext​(org.springframework.ldap.core.DirContextOperations ctx, java.lang.String username, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)  
      void setLdapUsernameAttribute​(java.lang.String ldapUsernameAttribute)  
      • Methods inherited from class org.springframework.security.ldap.userdetails.LdapUserDetailsMapper

        createAuthority, mapPassword, mapUserToContext, setConvertToUpperCase, setPasswordAttributeName, setRoleAttributes, setRolePrefix
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UsernameAttributeLdapContextMapper

        public UsernameAttributeLdapContextMapper()
    • Method Detail

      • mapUserFromContext

        public org.springframework.security.core.userdetails.UserDetails mapUserFromContext​(org.springframework.ldap.core.DirContextOperations ctx,
                                                                                            java.lang.String username,
                                                                                            java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
        Specified by:
        mapUserFromContext in interface org.springframework.security.ldap.userdetails.UserDetailsContextMapper
        Overrides:
        mapUserFromContext in class org.springframework.security.ldap.userdetails.LdapUserDetailsMapper
      • setLdapUsernameAttribute

        public void setLdapUsernameAttribute​(java.lang.String ldapUsernameAttribute)
        Parameters:
        ldapUsernameAttribute - Sets the name of the LDAP attribute to use for the username after authentication.
      • getLdapUsernameAttribute

        public java.lang.String getLdapUsernameAttribute()