summary refs log tree commit diff
path: root/synapse/handlers/saml_handler.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-16 15:06:19 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-16 15:06:19 +0100
commit394e6d2c723cef2ad5a63c4db5f0f68dea26e025 (patch)
treea3f979a8fe50852fad93e8232674d5f27a7f34ce /synapse/handlers/saml_handler.py
parentlint (diff)
parentPreparatory refactoring of the SamlHandlerTestCase (#8938) (diff)
downloadsynapse-394e6d2c723cef2ad5a63c4db5f0f68dea26e025.tar.xz
Merge commit '01333681b' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'synapse/handlers/saml_handler.py')
-rw-r--r--synapse/handlers/saml_handler.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/synapse/handlers/saml_handler.py b/synapse/handlers/saml_handler.py

index f2ca1ddb53..6001fe3e27 100644 --- a/synapse/handlers/saml_handler.py +++ b/synapse/handlers/saml_handler.py
@@ -163,6 +163,29 @@ class SamlHandler(BaseHandler): return logger.debug("SAML2 response: %s", saml2_auth.origxml) + + await self._handle_authn_response(request, saml2_auth, relay_state) + + async def _handle_authn_response( + self, + request: SynapseRequest, + saml2_auth: saml2.response.AuthnResponse, + relay_state: str, + ) -> None: + """Handle an AuthnResponse, having parsed it from the request params + + Assumes that the signature on the response object has been checked. Maps + the user onto an MXID, registering them if necessary, and returns a response + to the browser. + + Args: + request: the incoming request from the browser. We'll respond to it with an + HTML page or a redirect + saml2_auth: the parsed AuthnResponse object + relay_state: the RelayState query param, which encodes the URI to rediret + back to + """ + for assertion in saml2_auth.assertions: # kibana limits the length of a log field, whereas this is all rather # useful, so split it up.