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

Commit 1b44100

Browse files
committed
Enable the token login type for OIDC.
1 parent e91abfd commit 1b44100

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

changelog.d/7631.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support the `m.login.token` login flow when OpenID Connect is enabled.

synapse/rest/client/v1/login.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,20 @@ def on_GET(self, request):
9999
flows.append({"type": LoginRestServlet.JWT_TYPE})
100100

101101
if self.cas_enabled:
102-
flows.append({"type": LoginRestServlet.SSO_TYPE})
103-
104102
# we advertise CAS for backwards compat, though MSC1721 renamed it
105103
# to SSO.
106104
flows.append({"type": LoginRestServlet.CAS_TYPE})
107105

106+
if self.cas_enabled or self.saml2_enabled or self.oidc_enabled:
107+
flows.append({"type": LoginRestServlet.SSO_TYPE})
108108
# While its valid for us to advertise this login type generally,
109109
# synapse currently only gives out these tokens as part of the
110-
# CAS login flow.
110+
# SSO login flow.
111111
# Generally we don't want to advertise login flows that clients
112112
# don't know how to implement, since they (currently) will always
113113
# fall back to the fallback API if they don't understand one of the
114114
# login flow types returned.
115115
flows.append({"type": LoginRestServlet.TOKEN_TYPE})
116-
elif self.saml2_enabled:
117-
flows.append({"type": LoginRestServlet.SSO_TYPE})
118-
flows.append({"type": LoginRestServlet.TOKEN_TYPE})
119-
elif self.oidc_enabled:
120-
flows.append({"type": LoginRestServlet.SSO_TYPE})
121116

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

0 commit comments

Comments
 (0)