Skip to content

MSC4127: Removal of query string auth - #4127

Merged
turt2live merged 1 commit into
mainfrom
travis/msc/remove-qs-auth
Jul 6, 2026
Merged

MSC4127: Removal of query string auth#4127
turt2live merged 1 commit into
mainfrom
travis/msc/remove-qs-auth

Conversation

@turt2live

@turt2live turt2live commented Apr 10, 2024

Copy link
Copy Markdown
Member

Rendered

In line with matrix-org/matrix-spec#1700, the following disclosure applies:

I am Director of Standards Development at The Matrix.org Foundation C.I.C., Matrix Spec Core Team (SCT) member, employed by Element, and operate the t2bot.io service. This proposal is written and published with my role as a member of the SCT.

Requires #4126
Fixes matrix-org/matrix-spec#1780


SCT Stuff:

No MSC checklist

FCP tickyboxes

@turt2live turt2live changed the title MSC: Removal of query string auth MSC4127: Removal of query string auth Apr 10, 2024
@turt2live
turt2live marked this pull request as ready for review April 10, 2024 21:50
@turt2live turt2live added proposal A matrix spec change proposal. Process state. A-Identity Service A-Client Server Client-Server API kind:maintenance MSC which clarifies/updates existing spec labels Apr 10, 2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Implementation requirements:

  • None, in my opinion. The MSC is not feasible to implement beyond what has already been described in the proposal itself.

@tulir tulir Jan 19, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I looked through https://matrix.org/ecosystem/ and found the following projects that seemed to still be using the query parameter:

There are also a bunch of matches on GitHub search, but I'd guess most of them are ad-hoc scripts, unmaintained projects and other such things: https://github.com/search?q=%2F_matrix+access_token%3D++NOT+is%3Aarchived+NOT+is%3Afork&type=code

@tulir tulir Jan 20, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure how GitHub sorts those search results, but when I opened it again, the order had changed and the top result was GitLab. Should probably open an issue or PR for them 🤔 https://gitlab.com/gitlab-org/gitlab/-/blob/v17.8.0-ee/app/models/integrations/matrix.rb#L7

Looked through some of the search results, others that are probably worth notifying:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

libcmatrix, simplematrixbotlib, mxbt, ttm, and hemppa appear to fit a definition of 'maintained', so may be quickly fixed by the pings (hopefully).

I've tried starting a fix for gitlab, but forking the project is taking too long, so will have to be another time if no one else does it :D

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

GitLab seems to have some kind of system where you don't have to make your own fork https://docs.gitlab.com/ee/development/contributing/first_contribution/index.html

It automatically sent an access request without further prompting when I clicked the link in the second bullet point, so I guess I'll try making a patch too :D

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment on lines +8 to +9
Query string authentication becomes *removed* from the [Client-Server API](https://spec.matrix.org/v1.10/client-server-api/#using-access-tokens)
and [Identity Service API](https://spec.matrix.org/v1.10/identity-service-api/#authentication).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

An issue that Synapse ran into with MSC2832 which removed query parameter auth for app services is that we did not want to drop support for old spec versions, but did want to follow this guidance. (matrix-org/synapse#15379 has some of the discussion.)

We ended up saying Synapse was still compatible with 1.4, but had a configuration flag for re-enabling the old behavior (disabling it by default in the name of secure defaults).


I'm not sure if I have a recommendation, but wanting to be both backwards compatible and secure by default was difficult in this situation. I guess one option would have been to only declare support for the older versions if the config flag was flipped, but I think various clients would have stopped working if we did that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We've run into a number of cases over the last few years where the spec tries to remove a feature, but implementations can't meaningfully do that without dropping support for old spec versions (which they don't want to do).

I do feel it's important we figure out how we can remove things without dropping old spec version support, but I also feel like it's important to at least clean up the spec for newer implementations to start from. A future, different, proposal can address the removal concerns more broadly, in my opinion.

@agx

agx commented Jan 20, 2025

Copy link
Copy Markdown

libcmatrix, simplematrixbotlib, mxbt, ttm, and hemppa appear to fit a definition of 'maintained', so may be quickly fixed by the pings (hopefully).

I'm more of a drive by contributor to libcmatrix but put out a patch here: https://source.puri.sm/Librem5/libcmatrix/-/merge_requests/104 . Is there a recommendation for falling back to the query parameter for older (pre 1.4? versions)?

@tulir

tulir commented Jan 20, 2025

Copy link
Copy Markdown
Member

No need for fallbacks, the Authorization header has been supported since r0.3.0 (released in 2017) https://spec.matrix.org/legacy/client_server/r0.3.0.html#client-authentication

@imbev

imbev commented Jan 20, 2025

Copy link
Copy Markdown

tulir added a commit to tulir/sitespeed.io that referenced this pull request Mar 13, 2026
Switched:

* Deprecated `access_token` query param -> `Authorization` header
* Undocumented/non-standard POST endpoint -> standard PUT with a transaction ID
* Old /r0 -> new /v3

References:
* matrix-org/matrix-spec-proposals#4127
* https://spec.matrix.org/v1.17/client-server-api/#put_matrixclientv3roomsroomidsendeventtypetxnid
@turt2live

Copy link
Copy Markdown
Member Author

This got stuck a couple of years ago due to concerns about not actually being able to "remove" something from the spec. Mentioned in #4127 (comment) though, I'd like to see us clean up the spec and (continue to) punt the removal problem down the road to a future MSC.

I'll commit to thinking about the removal problem, but can't promise any particular timeline or MSCs will result from it.

@mscbot fcp merge

@mscbot

mscbot commented May 14, 2026

Copy link
Copy Markdown
Collaborator

Team member @turt2live has proposed to merge this. The next step is review by the rest of the tagged people:

Once at least 75% of reviewers approve (and there are no outstanding concerns), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for information about what commands tagged team members can give me.

@mscbot mscbot added proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the FCP. Process state. disposition-merge Process state. labels May 14, 2026
@github-project-automation github-project-automation Bot moved this to Tracking for review in Spec Core Team Workflow May 14, 2026
@turt2live turt2live moved this from Tracking for review to Ready for FCP ticks in Spec Core Team Workflow May 14, 2026
@turt2live turt2live added the 00-weekly-pings Tracking for weekly pings in the SCT office. 00 to make it first in the labels list. label May 14, 2026
@mscbot

mscbot commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@mscbot mscbot added final-comment-period Process state to accept, reject, or postpone an MSC. and removed proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the FCP. Process state. labels Jul 1, 2026
@turt2live turt2live moved this from Ready for FCP ticks to In FCP in Spec Core Team Workflow Jul 1, 2026
@turt2live turt2live removed the 00-weekly-pings Tracking for weekly pings in the SCT office. 00 to make it first in the labels list. label Jul 1, 2026
@mscbot

mscbot commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

The final comment period, with a disposition to merge, as per the review above, is now complete.

@mscbot mscbot added finished-final-comment-period FCP has finished. Process state. and removed disposition-merge Process state. final-comment-period Process state to accept, reject, or postpone an MSC. labels Jul 6, 2026
@turt2live
turt2live merged commit c92a9af into main Jul 6, 2026
@turt2live turt2live added spec-pr-missing MSC is accepted, but missing spec PR. Process state. and removed finished-final-comment-period FCP has finished. Process state. labels Jul 6, 2026
@turt2live turt2live moved this from In FCP to Requires spec writing in Spec Core Team Workflow Jul 6, 2026
@turt2live

Copy link
Copy Markdown
Member Author

Spec PR: matrix-org/matrix-spec#2408

@turt2live turt2live added spec-pr-in-review A proposal which has been PR'd against the spec and is in review and removed spec-pr-missing MSC is accepted, but missing spec PR. Process state. labels Jul 10, 2026
@turt2live turt2live moved this from Requires spec writing to Requires spec PR review in Spec Core Team Workflow Jul 10, 2026
@turt2live
turt2live deleted the travis/msc/remove-qs-auth branch July 14, 2026 01:37
@turt2live

Copy link
Copy Markdown
Member Author

Merged 🎉

@turt2live turt2live moved this from Requires spec PR review to Merged/Done in Spec Core Team Workflow Jul 21, 2026
@turt2live turt2live added merged A proposal whose PR has merged into the spec! Process state. and removed spec-pr-in-review A proposal which has been PR'd against the spec and is in review labels Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Client Server Client-Server API A-Identity Service kind:maintenance MSC which clarifies/updates existing spec merged A proposal whose PR has merged into the spec! Process state. proposal A matrix spec change proposal. Process state.

Projects

Status: Merged/Done

Development

Successfully merging this pull request may close these issues.

Passing access tokens as query parameters should be deprecated

6 participants