diff --git a/services/auth/source/ldap/source_search.go b/services/auth/source/ldap/source_search.go index 5a2d25b0c..2a61386ae 100644 --- a/services/auth/source/ldap/source_search.go +++ b/services/auth/source/ldap/source_search.go @@ -208,7 +208,7 @@ func (source *Source) listLdapGroupMemberships(l *ldap.Conn, uid string, applyGr } var searchFilter string - if applyGroupFilter { + if applyGroupFilter && groupFilter != "" { searchFilter = fmt.Sprintf("(&(%s)(%s=%s))", groupFilter, source.GroupMemberUID, ldap.EscapeFilter(uid)) } else { searchFilter = fmt.Sprintf("(%s=%s)", source.GroupMemberUID, ldap.EscapeFilter(uid))