From d7bcbaa3729f0489fb0138a898fea1a2ef77bbf6 Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Thu, 21 Nov 2024 18:46:55 +0100 Subject: [PATCH] Never fatal. Signed-off-by: Rick Elrod --- ansible_base/authentication/backend.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible_base/authentication/backend.py b/ansible_base/authentication/backend.py index ce444b9ee..040fdd087 100644 --- a/ansible_base/authentication/backend.py +++ b/ansible_base/authentication/backend.py @@ -37,7 +37,11 @@ def authenticate(self, request, *args, **kwargs): last_modified = None if last_modified_item is None else last_modified_item.get('modified') for authenticator_id, authenticator_object in get_authentication_backends(last_modified).items(): - user = authenticator_object.authenticate(request, *args, **kwargs) + try: + user = authenticator_object.authenticate(request, *args, **kwargs) + except Exception: + logger.exception(f"Exception raised while trying to authenticate with {authenticator_object.database_instance.name}") + continue # Social Auth pipeline can return status string when update_user_claims fails (authentication maps deny access) if user == SOCIAL_AUTH_PIPELINE_FAILED_STATUS: