diff --git a/changelogs/client_server/newsfragments/2151.feature b/changelogs/client_server/newsfragments/2151.feature new file mode 100644 index 000000000..6eff5607c --- /dev/null +++ b/changelogs/client_server/newsfragments/2151.feature @@ -0,0 +1 @@ +Add the OAuth 2.0 based authentication API, as per [MSC3861](https://github.com/matrix-org/matrix-spec-proposals/pull/3861) and its sub-proposals. diff --git a/content/client-server-api/_index.md b/content/client-server-api/_index.md index d1f9654de..922f40124 100644 --- a/content/client-server-api/_index.md +++ b/content/client-server-api/_index.md @@ -2024,6 +2024,84 @@ The client MUST handle access token refresh failures as follows: - If the refresh fails due to a `4xx` HTTP status code from the server, the client should consider the session logged out. +#### Token revocation + +When a user wants to log out from a client, the client SHOULD use OAuth 2.0 +token revocation as defined in [RFC 7009](https://datatracker.ietf.org/doc/html/rfc7009). + +The client makes a `POST` request to the `revocation_endpoint` that can be found +in the [authorization server metadata](#server-metadata-discovery). + +The body of the request includes the following parameters, encoded as +`application/x-www-form-urlencoded`: + +
Parameter | +Value | +
---|---|
token |
+ + Required. MUST contain either the access token or the + refresh token to be revoked. + | +
token_type_hint |
+
+ Optional. If present, MUST have a value of either
+ access_token or refresh_token . The server MAY
+ use this value to optimize the token lookup process.
+ |
+
client_id |
+
+ + Optional. The client identifier obtained during + client registration. + +
+ If the |
+