From bf45bf8ce0726255cc7cca5fb44da623ebaafd01 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Tue, 14 Apr 2026 16:00:18 -0500 Subject: [PATCH] Better docs on `m.login.sso` compat flow --- docs/development/contributing.md | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/docs/development/contributing.md b/docs/development/contributing.md index 0f629a3b8..d8ac29e86 100644 --- a/docs/development/contributing.md +++ b/docs/development/contributing.md @@ -147,7 +147,7 @@ grant*](../topics/authorization.html#client-credentials-grant) for more info. #### Compatibility login flows -This is a bit of a [re-hash of the Matrix spec around +This section is a bit of a [re-hash of the Matrix spec around logins](https://spec.matrix.org/v1.18/client-server-api/#legacy-login) but to more clearly break-down how to more immediately jump in and test things, here's a quick guide. @@ -157,8 +157,8 @@ the same Matrix API's that a homeserver traditionally provided. See the docs on [*Compatibility sessions*](../topics/authorization.html#compatibility-sessions) for more info. -You can check the list of available login flows at the `/login` endpoint that MAS has -available with the following compatibility Matrix endpoint: +You can check the list of available login flows by calling the +`/_matrix/client/v3/login` compatibility endpoint exposed by MAS: `GET http://localhost:8080/_matrix/client/v3/login` ```json @@ -197,24 +197,21 @@ request](https://spec.matrix.org/v1.18/client-server-api/#post_matrixclientv3log } ``` -##### Test compatibility token login (non-interactive) - -To generate a token, TODO - -`POST http://localhost:8080/_matrix/client/v3/login` -```json -{ - "type": "m.login.token", - "token": "" -} -``` - ##### Test compatibility SSO login (interactive) To test the login flow, it's the same process as described in the [Matrix spec](https://spec.matrix.org/v1.18/client-server-api/#client-login-via-sso). -Visit http://localhost:8080/_matrix/client/v3/login/sso/redirect?redirectUrl=http%3A%2F%2Ftest-success%2F + 1. Visit http://localhost:8080/_matrix/client/v3/login/sso/redirect?redirectUrl=http%3A%2F%2Ftest-success%2F + 1. You will be redirected back to a URL like `http://test-success/?loginToken=XXX`. + 1. Take the `loginToken` value and use the compatibility token login flow: + `POST http://localhost:8080/_matrix/client/v3/login` + ```json + { + "type": "m.login.token", + "token": "" + } + ``` ### Debug policies