From 22983561471fc5269bd3063eea76759b3f5e74c4 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Fri, 20 Sep 2024 00:22:35 +0200 Subject: [PATCH] Improve logging when failing unique `search_filter` match --- ldapauthenticator/ldapauthenticator.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ldapauthenticator/ldapauthenticator.py b/ldapauthenticator/ldapauthenticator.py index cb1f85e..1187349 100644 --- a/ldapauthenticator/ldapauthenticator.py +++ b/ldapauthenticator/ldapauthenticator.py @@ -521,13 +521,15 @@ async def authenticate(self, handler, data): n_users = len(conn.response) if n_users == 0: self.log.warning( - f"User with '{self.user_attribute}={username}' not found in directory" + "Configured search_filter found no user associated with " + f"userattr='{self.user_attribute}' and username='{username}'" ) return None if n_users > 1: self.log.warning( - "Duplicate users found! {n_users} users found " - f"with '{self.user_attribute}={username}'" + "Configured search_filter found multiple users associated with " + f"userattr='{self.user_attribute}' and username='{username}', a " + "unique match is required." ) return None