mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-14 23:44:10 +01:00
Compare commits
4 commits
f81cea9e45
...
af77090b56
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af77090b56 | ||
|
|
add0f2232c | ||
|
|
8ebf4a4789 | ||
|
|
47cce0ca26 |
1
changelogs/client_server/newsfragments/2234.feature
Normal file
1
changelogs/client_server/newsfragments/2234.feature
Normal file
|
|
@ -0,0 +1 @@
|
|||
Add the `m.oauth` authentication type for User-Interactive Authentication as per [MSC4312](https://github.com/matrix-org/matrix-spec-proposals/pull/4312).
|
||||
|
|
@ -0,0 +1 @@
|
|||
`device_one_time_keys_count` is only optional if no unclaimed one-time keys exist.
|
||||
|
|
@ -0,0 +1 @@
|
|||
In room versions 3 through 12, clarify that when you have the power to redact, it is possible to redact events that you don't have the power to send.
|
||||
|
|
@ -907,6 +907,7 @@ This specification defines the following auth types:
|
|||
- `m.login.dummy`
|
||||
- `m.login.registration_token`
|
||||
- {{% added-in v="1.11" %}} `m.login.terms`
|
||||
- {{% added-in v="1.17" %}} `m.oauth`
|
||||
|
||||
###### Password-based
|
||||
|
||||
|
|
@ -1245,6 +1246,40 @@ user during registration, if applicable.
|
|||
|
||||
{{% definition path="api/client-server/definitions/m.login.terms_params" %}}
|
||||
|
||||
###### OAuth authentication
|
||||
|
||||
{{% added-in v="1.17" %}}
|
||||
|
||||
| Type | Description |
|
||||
|-------------------------------|-------------------------------------------------------------------|
|
||||
| `m.oauth` | Authentication is supported by authorising via the homeserver's OAuth account management web UI. |
|
||||
|
||||
{{% boxes/note %}}
|
||||
The `m.oauth` authentication type is currently only valid on the
|
||||
[`/keys/device_signing/upload`](/client-server-api/#post_matrixclientv3keysdevice_signingupload) endpoint.
|
||||
{{% /boxes/note %}}
|
||||
|
||||
This authentication type provides homeservers the ability to guard access to
|
||||
sensitive actions when the client has authenticated via the
|
||||
[OAuth 2.0 API](/client-server-api/#oauth-20-api), which is otherwise not
|
||||
compatible with User-Interactive Authentication (UIA). To do so, the server
|
||||
returns a 401 response on the respective request, where the response body
|
||||
includes `m.oauth` in the `flows` list, and the `m.oauth` property in the
|
||||
`params` object has the structure [shown below](#definition-moauth-params).
|
||||
|
||||
The client is expected to open the contained URL to let the user confirm the
|
||||
action in the homeserver's account management web UI. Once the user has done
|
||||
so, the client submits an `auth` dict with just the `session`, as follows,
|
||||
to complete the stage:
|
||||
|
||||
```json
|
||||
{
|
||||
"session": "<session ID>"
|
||||
}
|
||||
```
|
||||
|
||||
{{% definition path="api/client-server/definitions/m.oauth_params" %}}
|
||||
|
||||
##### Fallback
|
||||
|
||||
Clients cannot be expected to be able to know how to process every
|
||||
|
|
@ -1591,6 +1626,11 @@ because they don't have access to the user's credentials anymore.
|
|||
The [User-Interactive Authentication API](#user-interactive-authentication-api)
|
||||
is not compatible with the OAuth 2.0 API, so the endpoints that depend on it for
|
||||
authentication can't be used when an access token is obtained with this API.
|
||||
|
||||
The only exception to this is the
|
||||
[`/keys/device_signing/upload`](/client-server-api/#post_matrixclientv3keysdevice_signingupload)
|
||||
endpoint which uses the [`m.oauth`](/client-server-api/#oauth-authentication)
|
||||
authentication type.
|
||||
{{% /boxes/warning %}}
|
||||
|
||||
**Sample flow**
|
||||
|
|
|
|||
|
|
@ -1775,19 +1775,18 @@ property is required for inclusion, though previous versions of the
|
|||
specification did not have it. In addition to `/versions`, this can be
|
||||
a way to identify the server's support for fallback keys.
|
||||
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|----------------------------------|--------------------|------------------------------------------------------------------------------------------------------------------------|
|
||||
| device_lists | DeviceLists | Optional. Information on e2e device updates. Note: only present on an incremental sync. |
|
||||
| device_one_time_keys_count | {string: integer} | Optional. For each key algorithm, the number of unclaimed one-time keys currently held on the server for this device. If an algorithm is unlisted, the count for that algorithm is assumed to be zero. If this entire parameter is missing, the count for all algorithms is assumed to be zero. |
|
||||
| device_unused_fallback_key_types | [string] | **Required.** The unused fallback key algorithms. |
|
||||
| Parameter | Type | Description |
|
||||
|----------------------------------|-------------------|------------------------------------------------------------------------------------------------------------------------|
|
||||
| device_lists | DeviceLists | Optional. Information on e2e device updates. Note: only present on an incremental sync. |
|
||||
| device_one_time_keys_count | {string: integer} | **Required if any unclaimed one-time keys exist.** For each key algorithm, the number of unclaimed one-time keys currently held on the server for this device. If the count for an algorithm is zero, servers MAY omit that algorithm. If the count for all algorithms is zero, servers MAY omit this parameter entirely. |
|
||||
| device_unused_fallback_key_types | [string] | **Required.** The unused fallback key algorithms. |
|
||||
|
||||
`DeviceLists`
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| changed | [string] | List of users who have updated their device identity or cross-signing keys, or who now share an encrypted room with the client since the previous sync response. |
|
||||
| left | [string] | List of users with whom we do not share any encrypted rooms anymore since the previous sync response. |
|
||||
| Parameter | Type | Description |
|
||||
|-----------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| changed | [string] | List of users who have updated their device identity or cross-signing keys, or who now share an encrypted room with the client since the previous sync response. |
|
||||
| left | [string] | List of users with whom we do not share any encrypted rooms anymore since the previous sync response. |
|
||||
|
||||
{{% boxes/note %}}
|
||||
For optimal performance, Alice should be added to `changed` in Bob's
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ is met:
|
|||
2. The domain of the redaction event's `sender` matches that of the
|
||||
original event's `sender`.
|
||||
|
||||
Note that the first condition holds true even when the `sender` doesn't have a
|
||||
high enough power level to send the type of event that they're redacting.
|
||||
|
||||
If the server would apply a redaction, the redaction event is also sent
|
||||
to clients. Otherwise, the server simply waits for a valid partner event
|
||||
to arrive where it can then re-check the above.
|
||||
|
|
|
|||
|
|
@ -40,10 +40,12 @@ paths:
|
|||
makes this endpoint idempotent in the case where the response is lost over the network,
|
||||
which would otherwise cause a UIA challenge upon retry.
|
||||
|
||||
{{% boxes/warning %}}
|
||||
When this endpoint requires User-Interactive Authentication, it cannot be used when the access token was obtained
|
||||
{{% boxes/note %}}
|
||||
When this endpoint requires User-Interactive Authentication,
|
||||
it uses the [`m.oauth`](/client-server-api/#oauth-authentication)
|
||||
authentication type if the access token was obtained
|
||||
via the [OAuth 2.0 API](/client-server-api/#oauth-20-api).
|
||||
{{% /boxes/warning %}}
|
||||
{{% /boxes/note %}}
|
||||
operationId: uploadCrossSigningKeys
|
||||
security:
|
||||
- accessTokenQuery: []
|
||||
|
|
|
|||
29
data/api/client-server/definitions/m.oauth_params.yaml
Normal file
29
data/api/client-server/definitions/m.oauth_params.yaml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Copyright 2025 The Matrix.org Foundation C.I.C.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
type: object
|
||||
title: m.oauth params
|
||||
description: Schema for `m.oauth` entry in the `params` object in a User-Interactive Authentication response.
|
||||
required: ['url']
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
format: uri
|
||||
description: |
|
||||
A URL pointing to the homeserver's OAuth account management web UI
|
||||
where the user can approve the action. MUST be a valid URI with scheme
|
||||
`http://` or `https://`, the latter being RECOMMENDED.
|
||||
example: {
|
||||
"url": "https://example.org/account/reset-cross-signing"
|
||||
}
|
||||
Loading…
Reference in a new issue