Fix LDAP authentication for the RFC2307 server type

The accountWithMemberOfQuery is only set for the active directory server
type. We must not use this query for authenticating against an RFC2307
server type as it is null in this case and no account is found.

Honor the fetchMemberOf parameter of the Helper.findAccount only when
the accountMemberField is supported for the given LDAP type.

Bug: Issue 3201
Change-Id: Ifa58dcf6588b6bcae7c46d1cf793aaecb107aff2
This commit is contained in:
Saša Živkov
2015-03-10 17:21:09 +01:00
parent ff03c9cfbf
commit b246f9e098

View File

@@ -194,7 +194,7 @@ import javax.security.auth.login.LoginException;
params.put(LdapRealm.USERNAME, username);
List<LdapQuery> accountQueryList;
if (fetchMemberOf) {
if (fetchMemberOf && schema.type.accountMemberField() != null) {
accountQueryList = schema.accountWithMemberOfQueryList;
} else {
accountQueryList = schema.accountQueryList;