diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-04-09 13:28:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 13:28:13 -0400 |
commit | b85d7652ff084fee997e0bb44ecd46c2789abbdd (patch) | |
tree | 52f493a687c4a5b8a580c8bea4a8c66fda4723b1 /synapse/module_api | |
parent | Unblacklist /upgrade creates a new room (#7228) (diff) | |
download | synapse-b85d7652ff084fee997e0bb44ecd46c2789abbdd.tar.xz |
Do not allow a deactivated user to login via SSO. (#7240)
Diffstat (limited to 'synapse/module_api')
-rw-r--r-- | synapse/module_api/__init__.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/synapse/module_api/__init__.py b/synapse/module_api/__init__.py index c7fffd72f2..afc3598e11 100644 --- a/synapse/module_api/__init__.py +++ b/synapse/module_api/__init__.py @@ -220,6 +220,26 @@ class ModuleApi(object): want their access token sent to `client_redirect_url`, or redirect them to that URL with a token directly if the URL matches with one of the whitelisted clients. + This is deprecated in favor of complete_sso_login_async. + + Args: + registered_user_id: The MXID that has been registered as a previous step of + of this SSO login. + request: The request to respond to. + client_redirect_url: The URL to which to offer to redirect the user (or to + redirect them directly if whitelisted). + """ + self._auth_handler._complete_sso_login( + registered_user_id, request, client_redirect_url, + ) + + async def complete_sso_login_async( + self, registered_user_id: str, request: SynapseRequest, client_redirect_url: str + ): + """Complete a SSO login by redirecting the user to a page to confirm whether they + want their access token sent to `client_redirect_url`, or redirect them to that + URL with a token directly if the URL matches with one of the whitelisted clients. + Args: registered_user_id: The MXID that has been registered as a previous step of of this SSO login. @@ -227,6 +247,6 @@ class ModuleApi(object): client_redirect_url: The URL to which to offer to redirect the user (or to redirect them directly if whitelisted). """ - self._auth_handler.complete_sso_login( + await self._auth_handler.complete_sso_login( registered_user_id, request, client_redirect_url, ) |