Skip to content

Commit 4a99c60

Browse files
committed
Add detailed SAML error reason to logs and response
Helps debug invalid_response errors by including get_last_error_reason() Bumped to 0.5.16
1 parent 920040c commit 4a99c60

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

django_forms_workflows/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Enterprise-grade, database-driven form builder with approval workflows
44
"""
55

6-
__version__ = "0.5.15"
6+
__version__ = "0.5.16"
77
__author__ = "Django Forms Workflows Contributors"
88
__license__ = "LGPL-3.0-only"
99

django_forms_workflows/sso_views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,12 @@ def post(self, request):
139139
errors = auth.get_errors()
140140

141141
if errors:
142+
last_error_reason = auth.get_last_error_reason()
142143
logger.error(f"SAML authentication errors: {errors}")
143-
return HttpResponseBadRequest(f"SAML authentication failed: {errors}")
144+
logger.error(f"SAML last error reason: {last_error_reason}")
145+
return HttpResponseBadRequest(
146+
f"SAML authentication failed: {errors}. Reason: {last_error_reason}"
147+
)
144148

145149
if not auth.is_authenticated():
146150
return HttpResponseBadRequest("SAML authentication failed")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-forms-workflows"
3-
version = "0.5.15"
3+
version = "0.5.16"
44
description = "Enterprise-grade, database-driven form builder with approval workflows and external data integration"
55
license = "LGPL-3.0-only"
66
readme = "README.md"

0 commit comments

Comments
 (0)