diff options
author | Richard van der Hoff <richard@matrix.org> | 2019-09-13 15:20:49 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2019-09-13 16:01:46 +0100 |
commit | a8ac40445c98b9e1fc2538d7d4ec49c80b0298ac (patch) | |
tree | e506896dcaa02f826ffe0e5e1c859acabb290626 /synapse/rest/client/v1/login.py | |
parent | Make the sample saml config closer to our standards (diff) | |
download | synapse-a8ac40445c98b9e1fc2538d7d4ec49c80b0298ac.tar.xz |
Record mappings from saml users in an external table
We want to assign unique mxids to saml users based on an incrementing suffix. For that to work, we need to record the allocated mxid in a separate table.
Diffstat (limited to 'synapse/rest/client/v1/login.py')
-rw-r--r-- | synapse/rest/client/v1/login.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/rest/client/v1/login.py b/synapse/rest/client/v1/login.py index 5762b9fd06..eeaa72b205 100644 --- a/synapse/rest/client/v1/login.py +++ b/synapse/rest/client/v1/login.py @@ -29,6 +29,7 @@ from synapse.http.servlet import ( parse_json_object_from_request, parse_string, ) +from synapse.http.site import SynapseRequest from synapse.rest.client.v2_alpha._base import client_patterns from synapse.rest.well_known import WellKnownBuilder from synapse.types import UserID, map_username_to_mxid_localpart @@ -507,6 +508,19 @@ class SSOAuthHandler(object): localpart=localpart, default_display_name=user_display_name ) + self.complete_sso_login(registered_user_id, request, client_redirect_url) + + def complete_sso_login( + self, registered_user_id: str, request: SynapseRequest, client_redirect_url: str + ): + """Having figured out a mxid for this user, complete the HTTP request + + Args: + registered_user_id: + request: + client_redirect_url: + """ + login_token = self._macaroon_gen.generate_short_term_login_token( registered_user_id ) |