From c57fbcfd8954c43d9c599c58b37e0bf60e57ed6b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 2 Mar 2022 20:37:42 +0100 Subject: [PATCH] sources/oauth: log body when get_profile fails Signed-off-by: Jens Langhammer --- authentik/sources/oauth/clients/base.py | 2 +- authentik/sources/oauth/types/azure_ad.py | 2 +- authentik/sources/oauth/types/mailcow.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/authentik/sources/oauth/clients/base.py b/authentik/sources/oauth/clients/base.py index 33e05d2be..25f8671db 100644 --- a/authentik/sources/oauth/clients/base.py +++ b/authentik/sources/oauth/clients/base.py @@ -44,7 +44,7 @@ class BaseOAuthClient: response = self.do_request("get", profile_url, token=token) response.raise_for_status() except RequestException as exc: - LOGGER.warning("Unable to fetch user profile", exc=exc) + LOGGER.warning("Unable to fetch user profile", exc=exc, body=response.text) return None else: return response.json() diff --git a/authentik/sources/oauth/types/azure_ad.py b/authentik/sources/oauth/types/azure_ad.py index 02d0d18bf..951822398 100644 --- a/authentik/sources/oauth/types/azure_ad.py +++ b/authentik/sources/oauth/types/azure_ad.py @@ -37,7 +37,7 @@ class AzureADClient(OAuth2Client): ) response.raise_for_status() except RequestException as exc: - LOGGER.warning("Unable to fetch user profile", exc=exc) + LOGGER.warning("Unable to fetch user profile", exc=exc, body=response.text) return None else: return response.json() diff --git a/authentik/sources/oauth/types/mailcow.py b/authentik/sources/oauth/types/mailcow.py index 55bd5cc75..a296b9efa 100644 --- a/authentik/sources/oauth/types/mailcow.py +++ b/authentik/sources/oauth/types/mailcow.py @@ -36,7 +36,7 @@ class MailcowOAuth2Client(OAuth2Client): ) response.raise_for_status() except RequestException as exc: - LOGGER.warning("Unable to fetch user profile", exc=exc) + LOGGER.warning("Unable to fetch user profile", exc=exc, body=response.text) return None else: return response.json()