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

Enable the token login type is provided for OpenID connect. #7631

Merged
merged 2 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7631.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Advertise the `m.login.token` login flow when OpenID Connect is enabled.
11 changes: 3 additions & 8 deletions synapse/rest/client/v1/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,20 @@ def on_GET(self, request):
flows.append({"type": LoginRestServlet.JWT_TYPE})

if self.cas_enabled:
flows.append({"type": LoginRestServlet.SSO_TYPE})

# we advertise CAS for backwards compat, though MSC1721 renamed it
# to SSO.
flows.append({"type": LoginRestServlet.CAS_TYPE})

if self.cas_enabled or self.saml2_enabled or self.oidc_enabled:
flows.append({"type": LoginRestServlet.SSO_TYPE})
# While its valid for us to advertise this login type generally,
# synapse currently only gives out these tokens as part of the
# CAS login flow.
# SSO login flow.
# Generally we don't want to advertise login flows that clients
# don't know how to implement, since they (currently) will always
# fall back to the fallback API if they don't understand one of the
# login flow types returned.
flows.append({"type": LoginRestServlet.TOKEN_TYPE})
elif self.saml2_enabled:
flows.append({"type": LoginRestServlet.SSO_TYPE})
flows.append({"type": LoginRestServlet.TOKEN_TYPE})
elif self.oidc_enabled:
flows.append({"type": LoginRestServlet.SSO_TYPE})

flows.extend(
({"type": t} for t in self.auth_handler.get_supported_login_types())
Expand Down