diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2021-01-12 17:38:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 17:38:03 +0000 |
commit | 789d9ebad3043b54a7c70cfadb41af7a20ce3877 (patch) | |
tree | 70893f4b2e00bb4e72beec47650c0d9b6ffd5fcf /synapse/handlers/ui_auth | |
parent | Handle bad JSON data being returned from the federation API. (#9070) (diff) | |
download | synapse-789d9ebad3043b54a7c70cfadb41af7a20ce3877.tar.xz |
UI Auth via SSO: redirect the user to an appropriate SSO. (#9081)
If we have integrations with multiple identity providers, when the user does a UI Auth, we need to redirect them to the right one. There are a few steps to this. First of all we actually need to store the userid of the user we are trying to validate in the UIA session, since the /auth/sso/fallback/web request is unauthenticated. Then, once we get the /auth/sso/fallback/web request, we can fish the user id out of the session, and use it to look up the external id mappings, and hence pick an SSO provider for them.
Diffstat (limited to 'synapse/handlers/ui_auth')
-rw-r--r-- | synapse/handlers/ui_auth/__init__.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/synapse/handlers/ui_auth/__init__.py b/synapse/handlers/ui_auth/__init__.py index 824f37f8f8..a68d5e790e 100644 --- a/synapse/handlers/ui_auth/__init__.py +++ b/synapse/handlers/ui_auth/__init__.py @@ -20,3 +20,18 @@ TODO: move more stuff out of AuthHandler in here. """ from synapse.handlers.ui_auth.checkers import INTERACTIVE_AUTH_CHECKERS # noqa: F401 + + +class UIAuthSessionDataConstants: + """Constants for use with AuthHandler.set_session_data""" + + # used during registration and password reset to store a hashed copy of the + # password, so that the client does not need to submit it each time. + PASSWORD_HASH = "password_hash" + + # used during registration to store the mxid of the registered user + REGISTERED_USER_ID = "registered_user_id" + + # used by validate_user_via_ui_auth to store the mxid of the user we are validating + # for. + REQUEST_USER_ID = "request_user_id" |