Package io.jmix.ldap.userdetails
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 Summary
Modifier and TypeFieldDescriptionprotected JmixLdapGrantedAuthoritiesMapper
protected UnconstrainedDataManager
protected LdapProperties
protected RoleGrantedAuthorityUtils
protected static final String
protected UserRepository
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<RoleAssignmentEntity>
buildRoleAssignments
(Collection<org.springframework.security.core.GrantedAuthority> grantedAuthorities, String username) protected T
createUserDetails
(String username, org.springframework.ldap.core.DirContextOperations ctx) 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.org.springframework.security.core.userdetails.UserDetails
synchronizeUserDetails
(org.springframework.ldap.core.DirContextOperations ctx, String username, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
-
Field Details
-
ROW_LEVEL_ROLE_PREFIX
- See Also:
-
dataManager
-
userRepository
-
authoritiesMapper
-
ldapProperties
-
roleGrantedAuthorityUtils
-
-
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 interfaceLdapUserDetailsSynchronizationStrategy
-
buildRoleAssignments
protected Collection<RoleAssignmentEntity> buildRoleAssignments(Collection<org.springframework.security.core.GrantedAuthority> grantedAuthorities, String username) -
getUserClass
-
createUserDetails
-
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.
-