Skip to content

Improve SSO/delegated authentication worker docs#19752

Open
benbz wants to merge 4 commits into
developfrom
bbz/improve-mas-admin-api-docs
Open

Improve SSO/delegated authentication worker docs#19752
benbz wants to merge 4 commits into
developfrom
bbz/improve-mas-admin-api-docs

Conversation

@benbz
Copy link
Copy Markdown
Member

@benbz benbz commented May 5, 2026

Improve SSO/delegated authentication (MSC3861) worker docs

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

Documenting the state of the world as of #18759. It is unclear to me whether these endpoints were excluded from normal delegated auth support as they won't work or just because they weren't needed.

Also the /devices endpoint(s) had the wrong version and were incomplete as per https://github.com/element-hq/synapse/blob/v1.152.0/synapse/rest/admin/devices.py#L47 and https://github.com/element-hq/synapse/blob/v1.152.0/synapse/rest/admin/devices.py#L121

@benbz benbz requested a review from a team as a code owner May 5, 2026 10:16
@benbz benbz changed the title Improve MSC3861 endpoint worker docs Improve SSO/delegated authentication worker docs May 5, 2026
Comment thread docs/workers.md
Additionally, the following endpoints should be included if Synapse is configured
to use SSO (you only need to include the ones for whichever SSO provider you're
using):
using) and delegated authentication isn't enabled:
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.

I've made the assertion here that none of these paths are useful in delegated auth world (be it experimental config or stabilised)

Comment thread docs/workers.md
Comment on lines +293 to +294
# Stabilised Delegated Authentication support (`matrix_authentication_service.enabled: true`)
^/_synapse/mas/
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.

Documented up here rather than next to the experimental_features.msc3861.enabled paths as AFAICT it can be handled by any worker rather than a worker with a single process only

Comment thread changelog.d/19752.doc
@@ -0,0 +1 @@
Improve documentation around endpoints that can be enabled with MSC3861.
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.

Where is this change spawning from? I assume you ran into this foot-gun somewhere

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.

element-hq/ess-helm#1278 and backlinks in both that issue and here

Comment thread docs/workers.md
Comment on lines +351 to +353
Do note that these endpoints can't be handled by workers if the stabilised delegated
authentication support is enabled (`matrix_authentication_service.enabled` set to
`true`).
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.

How do you know?

Why is this the case?

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.

From #19752 (comment), it seems like it doesn't matter whether these are handled. It just isn't necessary.

Which means the phrasing of these updates should change. Or perhaps, isn't necessary to call this out at all. You can handle whatever with workers.

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.

How do you know?

Why is this the case?

https://github.com/element-hq/synapse/pull/18759/changes#diff-21eb1b3b6455b7011ccbffc74b0279d87d5c69752d62d0196479b1bbc0bdbee3R274-R278 and discussion with @sandhose

From #19752 (comment), it seems like it doesn't matter whether these are handled. It just isn't necessary.

Which means the phrasing of these updates should change. Or perhaps, isn't necessary to call this out at all. You can handle whatever with workers.

My comment above is about the main block of paths. I think that the sentence I'm commenting is accurate and the additional assertion I've made (not useful with delegated auth) holds given Synapse won't be receiving any OIDC/SAML/CAS callbacks or doing any of the SSO dance.

These paths here can't be be put on a worker at all if the stabilised MAS configuration is used

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.

These paths here can't be be put on a worker at all if the stabilised MAS configuration is used

I feel like it doesn't matter. As far as I know, when MAS is enabled, it disables all of the relevant endpoints.

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.

https://github.com/element-hq/synapse/blob/v1.153.0/synapse/rest/admin/__init__.py#L391-L401 these still appear enabled on workers with the experimental MAS configuration. Just not with the stable MAS configuration (or without MAS).

Comment thread changelog.d/19752.1.doc
@@ -0,0 +1 @@
Document the paths that can be handled on workers with stabilised delegated authentication.
Copy link
Copy Markdown
Contributor

@MadLittleMods MadLittleMods May 19, 2026

Choose a reason for hiding this comment

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

I think this PR should be reviewed by someone else from @element-hq/mas-maintainers for accuracy.

I can't seem to select the team as a reviewer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants