When authenticating using active directory with a custom filter, such as:
jmix.ldap.useActiveDirectoryConfiguration = true
jmix.ldap.userSearchFilter = (&(objectClass=user)(sAMAccountName={0}))
the debug log shows the filter as:
filter = ‘(&(objectClass=user)(userPrincipalName={0}))’
It appears that it is required to specify userSearchFilter but its value is ignored when working with active directory.
I don’t know if this is a bug in the ldap add-on or if this is how Spring Security LDAP is supposed to function. However, it might be worth noting this in the documentation.
In case this helps anyone else: it appears that occurrences of {0} are replaced with the username@domain if jmix.ldap.activeDirectoryDomain is specified. Once I realized that, the filter became a non-issue. My users can sign in with their sAMAccountName but the search uses userPrincipalName which contains their email address.