From 3a5cde29ec5a2c8faf4c42e1c90bf35cb5b9d94e Mon Sep 17 00:00:00 2001 From: Vincent Hatakeyama Date: Tue, 11 Feb 2025 17:24:13 +0100 Subject: [PATCH] [FIX] auth_saml: avoid redirecting when there is a SAML error --- auth_saml/controllers/main.py | 2 +- auth_saml/readme/newsfragments/+avoid_autoredirect_loop.bugfix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 auth_saml/readme/newsfragments/+avoid_autoredirect_loop.bugfix diff --git a/auth_saml/controllers/main.py b/auth_saml/controllers/main.py index fb635d3a72..6cdd118cd8 100644 --- a/auth_saml/controllers/main.py +++ b/auth_saml/controllers/main.py @@ -83,7 +83,7 @@ def _saml_autoredirect(self): autoredirect_providers = self.list_saml_providers(True) # do not redirect if asked too or if a SAML error has been found disable_autoredirect = ( - "disable_autoredirect" in request.params or "error" in request.params + "disable_autoredirect" in request.params or "saml_error" in request.params ) if autoredirect_providers and not disable_autoredirect: return werkzeug.utils.redirect( diff --git a/auth_saml/readme/newsfragments/+avoid_autoredirect_loop.bugfix b/auth_saml/readme/newsfragments/+avoid_autoredirect_loop.bugfix new file mode 100644 index 0000000000..76fade2faf --- /dev/null +++ b/auth_saml/readme/newsfragments/+avoid_autoredirect_loop.bugfix @@ -0,0 +1 @@ +Avoid redirecting when there is a SAML error.