Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 7496d3d

Browse files
authored
Merge pull request #7151 from matrix-org/jaywink/saml-redirect-fix
Allow RedirectResponse in SAML response handler
2 parents fa4f121 + 55ca6cf commit 7496d3d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

changelog.d/7151.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix error page being shown when a custom SAML handler attempted to redirect when processing an auth response.

synapse/handlers/saml_handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from synapse.http.server import finish_request
2727
from synapse.http.servlet import parse_string
2828
from synapse.module_api import ModuleApi
29+
from synapse.module_api.errors import RedirectException
2930
from synapse.types import (
3031
UserID,
3132
map_username_to_mxid_localpart,
@@ -119,6 +120,9 @@ async def handle_saml_response(self, request):
119120

120121
try:
121122
user_id = await self._map_saml_response_to_user(resp_bytes, relay_state)
123+
except RedirectException:
124+
# Raise the exception as per the wishes of the SAML module response
125+
raise
122126
except Exception as e:
123127
# If decoding the response or mapping it to a user failed, then log the
124128
# error and tell the user that something went wrong.

0 commit comments

Comments
 (0)