I have a few problems, while following documentation I wanted to achieve login through Active Directory domain account or directly from app created account. At this moment configuration allows me to login by AD account but not from app account. Could you please help me with it? I’ve also encountered a bug while deleting account created from LDAP, app can’t create a new one when this same user trying to login again. And while I’m giving roles to domain accounts in app, some ‘anonymous’ user delete them when user re-login to app.
application.properties:
jmix.ldap.urls = ldap://###/
jmix.ldap.activeDirectoryDomain = ###
jmix.ldap.baseDn = ###
jmix.ldap.managerDn = dc=###,dc=com
jmix.ldap.managerPassword = ###
jmix.ldap.userSearchFilter = (&(objectClass=user)(sAMAccountName={0}))
jmix.ldap.defaultRoles = ui-minimal
jmix.ldap.useActiveDirectoryConfiguration = true
jmix.ldap.synchronizeRoleAssignments = false
##########################################################################
@Component("sample_MyUserSynchronizationStrategy")
public class MyUserSynchronizationStrategy extends AbstractLdapUserDetailsSynchronizationStrategy<User> {
@Override
protected Class<User> getUserClass() {
return User.class;
}
@Override
protected void mapUserDetailsAttributes(User userDetails, DirContextOperations ctx) {
userDetails.setFirstName(ctx.getStringAttribute("givenName"));
userDetails.setLastName(ctx.getStringAttribute("sn"));
userDetails.setActive(true);
userDetails.setVersion(1);
userDetails.setPassword(ctx.getStringAttribute("unicodePwd"));
userDetails.setEmail(ctx.getStringAttribute("mail"));
}
}