diff --git a/lib/pages/homeserver_picker/homeserver_picker.dart b/lib/pages/homeserver_picker/homeserver_picker.dart index 81b33aa00..af486aee5 100644 --- a/lib/pages/homeserver_picker/homeserver_picker.dart +++ b/lib/pages/homeserver_picker/homeserver_picker.dart @@ -134,7 +134,16 @@ class HomeserverPickerController extends State { bool isDefaultPlatform = (PlatformInfos.isMobile || PlatformInfos.isWeb || PlatformInfos.isMacOS); - bool get supportsPasswordLogin => _supportsFlow('m.login.password'); + bool get supportsPasswordLogin => + _supportsFlow('m.login.password') && + // OIDC Aware client we should hide password login if + // "delegated_oidc_compatibility" is `true`. + // https://github.com/matrix-org/matrix-spec-proposals/blob/hughns/sso-redirect-action/proposals/3824-oidc-aware-clients.md + loginFlows?.any( + (flow) => + flow.type == 'm.login.sso' && flow.delegateOidcCompatibility, + ) == + false; void ssoLoginAction() async { final redirectUrl = kIsWeb @@ -241,3 +250,11 @@ class IdentityProvider { brand: json['brand'], ); } + +extension on LoginFlow { + bool get delegateOidcCompatibility => + additionalProperties.tryGet('delegated_oidc_compatibility') ?? + additionalProperties + .tryGet('org.matrix.msc3824.delegated_oidc_compatibility') ?? + false; +}