Class AbstractLdapUserDetailsSynchronizationStrategy<T extends org.springframework.security.core.userdetails.UserDetails>

java.lang.Object
io.jmix.ldap.userdetails.AbstractLdapUserDetailsSynchronizationStrategy<T>
Type Parameters:
T - user details class
All Implemented Interfaces:
LdapUserDetailsSynchronizationStrategy

public abstract class AbstractLdapUserDetailsSynchronizationStrategy<T extends org.springframework.security.core.userdetails.UserDetails> extends Object implements LdapUserDetailsSynchronizationStrategy
A basic implementation of LdapUserDetailsSynchronizationStrategy, which provides a general functionality for user synchronization with UserRepository.
  • Field Details

  • Constructor Details

    • AbstractLdapUserDetailsSynchronizationStrategy

      public AbstractLdapUserDetailsSynchronizationStrategy()
  • Method Details

    • synchronizeUserDetails

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

      protected Collection<RoleAssignmentEntity> buildRoleAssignments(Collection<org.springframework.security.core.GrantedAuthority> grantedAuthorities, String username)
    • getUserClass

      protected abstract Class<T> getUserClass()
    • createUserDetails

      protected T createUserDetails(String username, org.springframework.ldap.core.DirContextOperations ctx)
    • mapUserDetailsAttributes

      protected abstract void mapUserDetailsAttributes(T userDetails, org.springframework.ldap.core.DirContextOperations ctx)
      This method should be overridden to define how attributes mapping is to be performed.
      Parameters:
      userDetails - a UserDetails which should be populated with attributes from LDAP.
      ctx - a DirContextOperations object containing the user's full DN and attributes.