diff --git a/ldapauthenticator/ldapauthenticator.py b/ldapauthenticator/ldapauthenticator.py index c195786..03cdf1a 100644 --- a/ldapauthenticator/ldapauthenticator.py +++ b/ldapauthenticator/ldapauthenticator.py @@ -513,6 +513,9 @@ def authenticate(self, handler: web.RequestHandler, data: dict) -> typing.Option search_scope=ldap3.SUBTREE, attributes=self.user_membership_attribute if self.allowed_groups else list(), paged_size=2) + + # remove all searchResRef from response + conn.response = [search_ref for search_ref in conn.response if 'type' in search_ref and search_ref['type'] != 'searchResRef'] # handle abnormal search results if not conn.response or len(conn.response) > 1: