0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-04 21:58:54 +01:00

Merge pull request #7151 from matrix-org/jaywink/saml-redirect-fix

Allow RedirectResponse in SAML response handler
This commit is contained in:
Jason Robinson 2020-03-26 22:10:31 +02:00 committed by GitHub
commit 7496d3d2f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
changelog.d/7151.bugfix Normal file
View file

@ -0,0 +1 @@
Fix error page being shown when a custom SAML handler attempted to redirect when processing an auth response.

View file

@ -26,6 +26,7 @@ from synapse.config import ConfigError
from synapse.http.server import finish_request
from synapse.http.servlet import parse_string
from synapse.module_api import ModuleApi
from synapse.module_api.errors import RedirectException
from synapse.types import (
UserID,
map_username_to_mxid_localpart,
@ -119,6 +120,9 @@ class SamlHandler:
try:
user_id = await self._map_saml_response_to_user(resp_bytes, relay_state)
except RedirectException:
# Raise the exception as per the wishes of the SAML module response
raise
except Exception as e:
# If decoding the response or mapping it to a user failed, then log the
# error and tell the user that something went wrong.