Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSC3744: Support for flexible authentication #3744

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

cvwright
Copy link

@cvwright cvwright commented Feb 24, 2022

Rendered

This proposal describes changes to the Matrix client-server API to support a more flexible set of authentication mechanisms.

Signed-off-by: Charles Wright <cvwright@futo.org>
Signed-off-by: Charles Wright <cvwright@futo.org>
@turt2live turt2live changed the title Support for flexible authentication MSC3744: Support for flexible authentication Feb 24, 2022
@turt2live turt2live added client-server Client-Server API kind:maintenance MSC which clarifies/updates existing spec 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 proposal-in-review labels Feb 24, 2022
@turt2live
Copy link
Member

@cvwright please don't forget to sign off on your changes, and update the file name/location for your MSC number: 3744

Comment on lines 82 to 97
### New `GET /register` endpoint
The client also needs some way to know which authenticators are supported
by the server.
The proposed approach is to add a new `GET` method for `/register`, similar
to what is already done for `/login`.
The server responds with a list of the supported authentication types.

`GET /register`

```json
{
"auth_types": [
"m.login.password",
]
}
```
Copy link
Member

Choose a reason for hiding this comment

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

Why not just add auth_types to the existing way to discover registration flows? (sending an empty object as the body)

Copy link
Author

Choose a reason for hiding this comment

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

That would make sense. The client already has to do the first empty request anyway, to start the UIA process. Not sure what I was thinking before -- probably too focused on looking at login. Anyway, I can push an update with the suggested change.

Copy link
Author

Choose a reason for hiding this comment

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

On second thought, I'm not sure how this would work. The first empty POST to /register should be intercepted by the UIA layer, right?

My understanding was that the actual endpoint handler wouldn't see a POST request until the client had satisfied all of the required stages of the UIA.

Signed-off-by: Charles Wright <cvwright@futo.org>
Signed-off-by: Charles Wright <cvwright@futo.org>
Comment on lines +211 to +223
**OpenID Connect.**
Rather than implementing more authentication types in the Matrix CS
API, Matrix could switch to using OpenID Connect.
Then all the complexity of handling different authentication mechanisms
is pushed out into the OIDC Provider.

OIDC might be the proper direction to go in the long run.
But for now, as a stop-gap measure, we can build better security using
the building blocks that we have in the existing CS API.
Also, some installations may not want to depend on a third party OIDC
Provider for a foundational thing like authentication; this proposal
provides a way for such homeservers to achieve better security with no
third parties.
Copy link
Member

Choose a reason for hiding this comment

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

+1 to OIDC; the Matrix project see this as this as the correct direction (see matrix-org/matrix-spec#636).

I understand your desire to achieve improvements in a shorter timescale than OIDC can happen, but... given limited resources, I'm hesitant to spend much time on changes that we essentially plan to throw away in the next few months.

Copy link
Author

Choose a reason for hiding this comment

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

I talked to Quentin about OIDC last week. It's very exciting stuff, and good to see Matrix building out capabilities in that direction.

However, IMO making OIDC the only supported option is premature at best, and it's an extreme measure for an open source project to be taking. Frankly it's a weird thing for a consumer chat app to be doing -- imagine DIscord or Signal or Telegram forcing you to hop through a web page to log in.

My own project requires a non-OIDC solution, so that's what I'm building. I'm trying to do it in a way that can be most useful to the rest of the community.

Copy link

@Xnsamtr Xnsamtr Mar 30, 2022

Choose a reason for hiding this comment

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

How would OIDC work with something like Dendrite+Pinecone? Without forcing individual users to auth with centralized server(s) and without making the setup considerably more complicated for them than it would need to be?
It seems problematic for the case of making a client that connects over Tor or similar networks, too.

Copy link

Choose a reason for hiding this comment

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

There seems to be some assumption that federated homeservers in the foreseeable will look much like the current model, with the addition of p2p meaning either just that, or single-user-local-device where auth is either native or non-existant.

@Xnsamtr notes some ways that these assumptions don't necessarily hold. OIDC covers a lot of use-cases (possibly even the majority of users over the coming years) but opening up for alternatives is A Good Thing. I'd even speculate it'll become a necessity for Matrix to fulfill its goals. Identifying least-common denominators (which I see this as a good attempt at) means that people like @cvwright can solve their problems while being as compatible as they can with other implementations.

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:maintenance MSC which clarifies/updates existing spec 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
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants