Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Separate supported login types for login and UI Auth.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Mar 27, 2020
1 parent 1ef80be commit f8ce002
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions synapse/handlers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,14 @@ def __init__(self, hs):
for t in provider.get_supported_login_types().keys():
if t not in login_types:
login_types.append(t)
if self._saml2_enabled:
login_types.append(LoginType.SSO)
self._supported_login_types = login_types
# Login types and UI Auth types have a heavy overlap, but are not
# necessarily identical. Login types have SSO (and other login types)
# added in the rest layer, see synapse.rest.client.v1.login.LoginRestServerlet.on_GET.
ui_auth_types = login_types.copy()
if self._saml2_enabled:
ui_auth_types.append(LoginType.SSO)
self._supported_ui_auth_types = ui_auth_types

# Ratelimiter for failed auth during UIA. Uses same ratelimit config
# as per `rc_login.failed_attempts`.
Expand Down Expand Up @@ -214,7 +219,7 @@ def validate_user_via_ui_auth(
)

# build a list of supported flows
flows = [[login_type] for login_type in self._supported_login_types]
flows = [[login_type] for login_type in self._supported_ui_auth_types]

try:
result, params, _ = yield self.check_auth(
Expand Down

0 comments on commit f8ce002

Please sign in to comment.