@@ -148,12 +148,10 @@ def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
148
148
# to SSO.
149
149
flows .append ({"type" : LoginRestServlet .CAS_TYPE })
150
150
151
- if (
152
- self .cas_enabled
153
- or self .saml2_enabled
154
- or self .oidc_enabled
155
- or self ._get_login_token_enabled
156
- ):
151
+ # MSC3882 requires m.login.token to be advertised
152
+ supportLoginTokenFlow = self ._get_login_token_enabled
153
+
154
+ if self .cas_enabled or self .saml2_enabled or self .oidc_enabled :
157
155
flows .append (
158
156
{
159
157
"type" : LoginRestServlet .SSO_TYPE ,
@@ -164,13 +162,10 @@ def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
164
162
}
165
163
)
166
164
167
- # While it's valid for us to advertise this login type generally,
168
- # synapse currently only gives out these tokens as part of the
169
- # SSO login flow.
170
- # Generally we don't want to advertise login flows that clients
171
- # don't know how to implement, since they (currently) will always
172
- # fall back to the fallback API if they don't understand one of the
173
- # login flow types returned.
165
+ # SSO requires a login token to be generated, so we need to advertise that flow
166
+ supportLoginTokenFlow = True
167
+
168
+ if supportLoginTokenFlow :
174
169
tokenTypeFlow : Dict [str , Any ] = {"type" : LoginRestServlet .TOKEN_TYPE }
175
170
# If MSC3882 is enabled we advertise the get_login_token flag.
176
171
if self ._get_login_token_enabled :
0 commit comments