From bc198abd30003762cb5bd3b7876123bac2366375 Mon Sep 17 00:00:00 2001 From: Hammad Ali Baig <38509606+hammadab@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:12:16 +0500 Subject: [PATCH] Update ldapauthenticator.py --- ldapauthenticator/ldapauthenticator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ldapauthenticator/ldapauthenticator.py b/ldapauthenticator/ldapauthenticator.py index e634bea..fd49ae8 100644 --- a/ldapauthenticator/ldapauthenticator.py +++ b/ldapauthenticator/ldapauthenticator.py @@ -298,6 +298,10 @@ def resolve_username(self, username_supplied_by_user): ) user_dn = user_dn[0] + # Escape username if escape_userdn is True + if self.escape_userdn: + user_dn = escape_filter_chars(user_dn) + return (user_dn, response[0]["dn"]) def get_connection(self, userdn, password):