From 5becde67e1182ad8f0c5b81532f947a9191eff9f Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Wed, 3 Dec 2025 12:06:02 +0000 Subject: [PATCH] Support for stable `m.oauth` UIA stage for MSC4312 --- synapse/rest/client/auth.py | 3 ++- synapse/rest/client/keys.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/synapse/rest/client/auth.py b/synapse/rest/client/auth.py index 600bb51a7e..c3644c12ce 100644 --- a/synapse/rest/client/auth.py +++ b/synapse/rest/client/auth.py @@ -67,7 +67,8 @@ class AuthRestServlet(RestServlet): if not session: raise SynapseError(400, "No session supplied") - if stagetype == "org.matrix.cross_signing_reset": + # We support the unstable (`org.matrix.cross_signing_reset`) name from MSC4312 until enough clients have adopted the stable name (`m.oauth`). + if stagetype == "m.oauth" or stagetype == "org.matrix.cross_signing_reset": if self.hs.config.mas.enabled: assert isinstance(self.auth, MasDelegatedAuth) diff --git a/synapse/rest/client/keys.py b/synapse/rest/client/keys.py index 5f488674b4..502c5d495a 100644 --- a/synapse/rest/client/keys.py +++ b/synapse/rest/client/keys.py @@ -560,9 +560,14 @@ class SigningKeyUploadServlet(RestServlet): { "session": "dummy", "flows": [ + {"stages": ["m.oauth"]}, + # The unstable name from MSC4312 should be supported until enough clients have adopted the stable (`m.oauth`) name: {"stages": ["org.matrix.cross_signing_reset"]}, ], "params": { + "m.oauth": { + "url": url, + }, "org.matrix.cross_signing_reset": { "url": url, }, @@ -594,9 +599,14 @@ class SigningKeyUploadServlet(RestServlet): { "session": "dummy", "flows": [ + {"stages": ["m.oauth"]}, + # The unstable name from MSC4312 should be supported until enough clients have adopted the stable (`m.oauth`) name: {"stages": ["org.matrix.cross_signing_reset"]}, ], "params": { + "m.oauth": { + "url": url, + }, "org.matrix.cross_signing_reset": { "url": url, },