Skip to content

Support MSC4450: Identity Provider selection for User-Interactive Authentication with Legacy Single Sign-On.#19693

Open
reivilibre wants to merge 5 commits intodevelopfrom
rei/msc4450_legacy_sso_idp_id_uia
Open

Support MSC4450: Identity Provider selection for User-Interactive Authentication with Legacy Single Sign-On.#19693
reivilibre wants to merge 5 commits intodevelopfrom
rei/msc4450_legacy_sso_idp_id_uia

Conversation

@reivilibre
Copy link
Copy Markdown
Contributor

Closes: #19688

Part of: MSC4450 whose Experimental Feature tracking issue is #19691

Base: develop

This pull request is intended for whole-diff review.

  1. Add an unstable, namespaced idp_id query parameter to fallback/web
    This allows clients to specify the identity provider they'd like to log
    in with for SSO when they have multiple upstream IdPs associated with
    their account.

    Previously, Synapse would just pick one arbitrarily. But this was
    undesirable as you may want to use a different one at that point in
    time. When logging in, the user is able to choose when IdP they use -
    during UIA (which uses fallback auth mechanism) they should be able to
    do the same.

  2. Cosmetic tweaks

  3. Add MSC4450 experimental feature flag

anoadragon453 and others added 4 commits April 14, 2026 17:37
This allows clients to specify the identity provider they'd like to log
in with for SSO when they have multiple upstream IdPs associated with
their account.

Previously, Synapse would just pick one arbitrarily. But this was
undesirable as you may want to use a different one at that point in
time. When logging in, the user is able to choose when IdP they use -
during UIA (which uses fallback auth mechanism) they should be able to
do the same.
Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
@reivilibre reivilibre changed the title Support [MSC4450: Identity Provider selection for User-Interactive Authentication with Legacy Single Sign-On](https://github.com/matrix-org/matrix-spec-proposals/pull/4450). Support MSC4450: Identity Provider selection for User-Interactive Authentication with Legacy Single Sign-On. Apr 14, 2026
@reivilibre reivilibre marked this pull request as ready for review April 15, 2026 19:44
@reivilibre reivilibre requested a review from a team as a code owner April 15, 2026 19:44
self.msc4354_enabled: bool = experimental.get("msc4354_enabled", False)

# MSC4450: Identity Provider selection for User-Interactive Authentication
# with Legacy Single Sign-On
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# with Legacy Single Sign-On
# with Legacy Single Sign-On (`m.login.sso`)

Comment thread synapse/handlers/auth.py
if sso_auth_provider is None:
raise SynapseError(
400,
f"Unknown Identity Provider: '{preferred_idp_id}'",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f"Unknown Identity Provider: '{preferred_idp_id}'",
f"Unknown preferred Identity Provider: '{preferred_idp_id}'",

Comment on lines +627 to +630
self.assertIn(
f"Continue with {provider_config['idp_name']}",
channel.text_body,
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should at-least note where this comes from synapse/res/templates/sso_auth_confirm.html

flows, [{"stages": ["m.login.sso"]}, {"stages": ["m.login.password"]}]
)

for idp_id, provider_config in (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain why we try with both (comment)

self.assertEqual(
channel.code,
HTTPStatus.OK,
f"Attempted /auth with {idp_id} : {channel.text_body}",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current message about be confusing if encoutered.

Perhaps:

Suggested change
f"Attempted /auth with {idp_id} : {channel.text_body}",
f"Failed to use the {endpoint} endpoint as part of the UIA flow for idp_id={idp_id} : response_body={channel.text_body}",

@MadLittleMods MadLittleMods added A-SSO A-Legacy-Auth relates to legacy, non-MAS-based, authentication labels Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Legacy-Auth relates to legacy, non-MAS-based, authentication A-SSO X-Release-Blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement MSC4450: Identity Provider selection for User-Interactive Authentication with Legacy Single Sign-On

3 participants