Skip to content

Commit ae9fef2

Browse files
authored
Expand error message
For several reasons I just triggered the following case: SAML_USE_NAME_ID_AS_USERNAME = True SAML_DJANGO_USER_MAIN_ATTRIBUTE = 'email' I've been trying out different IdPs, which needed name as id and those which didn't. Due to hard coding (sigh) djangosaml2idp returned a username instead of the email address I was configured for (not its fault), but then the logs report that a user that does exist can't be found since the search is looking for email addresses not usernames. I hope this change helps clarify the cause of the problem.
1 parent b66f8eb commit ae9fef2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

djangosaml2/backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def _get_saml2_user(self, main_attribute, attributes, attribute_mapping):
188188
user = User.objects.get(**user_query_args)
189189
user = self.update_user(user, attributes, attribute_mapping)
190190
except User.DoesNotExist:
191-
logger.error('The user "%s" does not exist', main_attribute)
191+
logger.error('The user "%s" does not exist, searched %s', (main_attribute, django_user_main_attribute))
192192
return None
193193
except MultipleObjectsReturned:
194194
logger.error("There are more than one user with %s = %s",

0 commit comments

Comments
 (0)