Skip to content

Conversation

@hughns
Copy link
Member

@hughns hughns commented Feb 22, 2024

Rendered

Dependencies:

Video demo:

MSC4108 Element X-Web iOS demo


The authors are employed by Element to write this MSC.


Major revisions

The is an older version of this proposal (referred to as "2024") that has some significant differences from the current proposal.

To help avoid confusion on the status, the following is hopefully helpful:

Version name Status Proposal revision Supported by Discovery of support Proof-of-MSC implementation status
2024 Feature complete, but will be superseded by a new version 87f8317 Experimental feature in Synapse. Supported by Element Web/Desktop to generate QR. Supported by Element X to scan QR to login. unstable_features.org.matrix.msc4108 is true in /versions response from homeserver Fully implemented (see below)
To be decided WIP - some parts are updated, but more to come. Diff latest No production implementations unstable_features.io.element.msc4108 is true in /versions response from homeserver In progress

The high-level to-do list for the latest version:

  • Update rendezvous session API to avoid issues with ETags
  • Update rendezvous session API so that stylistically it fits better with C-S API
  • Allow rendezvous session creation to require authentication
  • Replace ECIES with HPKE in secure channel
  • Revisit QR code format
  • Proof-of-MSC implementations for all of above

Proof-of-MSC implementations

2024 version

Implementations for 2024 version:

Latest version

@hughns hughns changed the title Mechanism to allow OIDC sign in and E2EE set up via QR code MSC4108: Mechanism to allow OIDC sign in and E2EE set up via QR code Feb 22, 2024
@turt2live turt2live added proposal A matrix spec change proposal client-server Client-Server API kind:core MSC which is critical to the protocol's success needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Feb 22, 2024
@cyrneko
Copy link

cyrneko commented Feb 22, 2024

finally, it is no longer just an idea presented at FOSDEM 🥳

@ara4n
Copy link
Member

ara4n commented Feb 22, 2024

tbf there was already MSC3906 - which this will presumably replace, by making it play nice with native OIDC (MSC3861) :)

@hughns hughns force-pushed the element-hq/oidc-qr-login branch from 5cd815f to 177a2db Compare April 3, 2024 15:58
@turt2live turt2live removed matrix-2.0 Required for Matrix 2.0 00-weekly-pings Tracking for weekly pings in the SCT office. 00 to make it first in the labels list. labels Sep 24, 2025
@turt2live turt2live moved this from Ready for general review to Proposed for FCP readiness in Spec Core Team Workflow Sep 24, 2025
data-wardenb6ym added a commit to data-wardenb6ym/vodozemac that referenced this pull request Sep 29, 2025
This commits adds a Elliptic Curve Encryption Scheme, this scheme can be
used in ephemeral situations where a full 3DH-based Olm session might be
overkill or too hard to set up.

The canonical example where this can be used is the QR code login
feature in Matrix[1].

Co-authored-by: Denis Kasak <[email protected]>
Co-authored-by: Hugh Nimmo-Smith <[email protected]>

[1]: matrix-org/matrix-spec-proposals#4108
Comment on lines +1096 to +1102
If no existing device was found then the existing device opens the `verification_uri_complete` - falling back to the
`verification_uri`, if `verification_uri_complete` isn't present - in a system browser.

Ideally this is in a trusted/secure environment where the cookie jar and password manager features are available. e.g.
on iOS this could be a `ASWebAuthenticationSession`

The existing device then sends an acknowledgement message to let the other device know that the consent process is in progress:
Copy link
Contributor

Choose a reason for hiding this comment

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

When implementing this in matrix-rust-sdk, @poljar raised the question of whether the order of opening the browser on the existing device and sending the m.login.protocol_accepted message to the new device matters. Should we first send the acknowledgment so that the new device can start polling and only then open the browser to let the user consent?

I think it doesn't make a huge difference but wanted to double check it here.

(Full discussion in matrix-org/matrix-rust-sdk#5801 (comment))

Copy link
Member Author

Choose a reason for hiding this comment

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

I have some recollection on this topic:

On receipt of the verification URI the existing device might not be able to open it. Perhaps the operating system denies the request, or it turns out that the isn't a system browser available.

As such I think the intention was that m.login.protocol_accepted is only sent after the device knows that it can proceed with showing the URI.

But the MSC doesn't say this, and nor does the seem to be a suitable m.login.failure reason code defined.

If this was defined then I don't think it matters if the new device starts polling before it has received the m.login.protocol_accepted. But, it would need to stop and do something sensible if it received a m.login.failure instead of m.login.protocol_accepted.

The byte immediately following the `MATRIX` prefix is repurposed as a type which gives a more sensible way to namespace in future.

This also means that we can call the second byte the "intent" very clearly rather than having to call it "mode" to match the existing cross verification QR spec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client-server Client-Server API kind:core MSC which is critical to the protocol's success needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal

Projects

Status: Proposed for FCP readiness

Development

Successfully merging this pull request may close these issues.