From 455052f13da59232a1fb27524c27ffcf76cd74f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20Croise=CC=81?= Date: Fri, 16 Sep 2022 15:16:34 +0200 Subject: [PATCH] Better logging for _get_attribute_value to debug wrong configurations --- djangosaml2/backends.py | 8 +++++--- setup.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/djangosaml2/backends.py b/djangosaml2/backends.py index 7528a35a..e7f36fc2 100644 --- a/djangosaml2/backends.py +++ b/djangosaml2/backends.py @@ -110,9 +110,11 @@ def _get_attribute_value( return saml_attribute[0] else: logger.error( - "attributes[saml_attr] attribute " - "value is missing. Probably the user " - "session is expired." + "attributes[saml_attr] attribute value is missing. " + f"Either the user session is expired or your mapping is invalid.\n" + f"django_field: {django_field}\n" + f"attributes: {attributes}\n" + f"attribute_mapping: {attribute_mapping}" ) def authenticate( diff --git a/setup.py b/setup.py index 1c71a3e6..c75d7bc4 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ def read(*rnames): setup( name="djangosaml2", - version="1.5.2", + version="1.5.3", description="pysaml2 integration for Django", long_description=read("README.md"), long_description_content_type="text/markdown",