mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-20 16:38:37 +01:00
Final tweaks for the OAuth 2.0 API (#2164)
* Clarify that SSO login applies to the legacy authentication API Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr> * Do not point to specific authentication API for obtaining access token Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr> * Add warnings about incompatibility with OAuth 2.0 to endpoints that use UIA Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr> * Add changelog Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr> * Add note about API standards not applying to OAuth 2.0 Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr> * Apply suggestions from code review --------- Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr> Co-authored-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
6353b46add
commit
1c06ed9cf7
1
changelogs/client_server/newsfragments/2164.feature
Normal file
1
changelogs/client_server/newsfragments/2164.feature
Normal file
|
|
@ -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.
|
||||||
|
|
@ -12,6 +12,12 @@ clients which maintain a full local persistent copy of server state.
|
||||||
|
|
||||||
## API Standards
|
## API Standards
|
||||||
|
|
||||||
|
{{% boxes/note %}}
|
||||||
|
These standards only apply to the APIs defined in the Matrix specification. APIs
|
||||||
|
used by this specification but defined in other specifications, like the [OAuth
|
||||||
|
2.0 API](#oauth-20-api), use their own rules.
|
||||||
|
{{% /boxes/note %}}
|
||||||
|
|
||||||
The mandatory baseline for client-server communication in Matrix is
|
The mandatory baseline for client-server communication in Matrix is
|
||||||
exchanging JSON objects over HTTP APIs. More efficient transports may be
|
exchanging JSON objects over HTTP APIs. More efficient transports may be
|
||||||
specified in future as optional extensions.
|
specified in future as optional extensions.
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,10 @@ allow users to log into applications via a single web-based
|
||||||
authentication portal. Examples include OpenID Connect, "Central
|
authentication portal. Examples include OpenID Connect, "Central
|
||||||
Authentication Service" (CAS) and SAML.
|
Authentication Service" (CAS) and SAML.
|
||||||
|
|
||||||
This module allows a Matrix homeserver to delegate user authentication
|
This module allows a Matrix homeserver that supports the [legacy authentication
|
||||||
to an external authentication server supporting one of these protocols.
|
API](#legacy-api) to delegate user authentication to an external authentication
|
||||||
In this process, there are three systems involved:
|
server supporting one of these protocols. In this process, there are three
|
||||||
|
systems involved:
|
||||||
|
|
||||||
- A Matrix client, using the APIs defined in this specification, which
|
- A Matrix client, using the APIs defined in this specification, which
|
||||||
is seeking to authenticate a user to a Matrix homeserver.
|
is seeking to authenticate a user to a Matrix homeserver.
|
||||||
|
|
@ -24,7 +25,7 @@ used to communicate with the authentication server. Different Matrix
|
||||||
homeserver implementations might support different SSO protocols.
|
homeserver implementations might support different SSO protocols.
|
||||||
|
|
||||||
Clients and homeservers implementing the SSO flow will need to consider
|
Clients and homeservers implementing the SSO flow will need to consider
|
||||||
both [login](#login) and [user-interactive authentication](#user-interactive-authentication-api). The flow is
|
both [login](#legacy-login) and [user-interactive authentication](#user-interactive-authentication-api). The flow is
|
||||||
similar in both cases, but there are slight differences.
|
similar in both cases, but there are slight differences.
|
||||||
|
|
||||||
Typically, SSO systems require a single "callback" URI to be configured
|
Typically, SSO systems require a single "callback" URI to be configured
|
||||||
|
|
|
||||||
|
|
@ -201,6 +201,11 @@ paths:
|
||||||
|
|
||||||
Homeservers should prevent the caller from adding a 3PID to their account if it has
|
Homeservers should prevent the caller from adding a 3PID to their account if it has
|
||||||
already been added to another user's account on the homeserver.
|
already been added to another user's account on the homeserver.
|
||||||
|
|
||||||
|
{{% boxes/warning %}}
|
||||||
|
Since this endpoint uses User-Interactive Authentication, it cannot be used when the access token was obtained
|
||||||
|
via the [OAuth 2.0 API](/client-server-api/#oauth-20-api).
|
||||||
|
{{% /boxes/warning %}}
|
||||||
operationId: add3PID
|
operationId: add3PID
|
||||||
security:
|
security:
|
||||||
- accessTokenQuery: []
|
- accessTokenQuery: []
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ paths:
|
||||||
Publishes cross-signing keys for the user.
|
Publishes cross-signing keys for the user.
|
||||||
|
|
||||||
This API endpoint uses the [User-Interactive Authentication API](/client-server-api/#user-interactive-authentication-api).
|
This API endpoint uses the [User-Interactive Authentication API](/client-server-api/#user-interactive-authentication-api).
|
||||||
|
|
||||||
User-Interactive Authentication MUST be performed, except in these cases:
|
User-Interactive Authentication MUST be performed, except in these cases:
|
||||||
- there is no existing cross-signing master key uploaded to the homeserver, OR
|
- there is no existing cross-signing master key uploaded to the homeserver, OR
|
||||||
- there is an existing cross-signing master key and it exactly matches the
|
- there is an existing cross-signing master key and it exactly matches the
|
||||||
|
|
@ -34,11 +34,16 @@ paths:
|
||||||
keys provided in the request (self-signing key, user-signing key) they MUST also
|
keys provided in the request (self-signing key, user-signing key) they MUST also
|
||||||
match the existing keys stored on the server. In other words, the request contains
|
match the existing keys stored on the server. In other words, the request contains
|
||||||
no new keys.
|
no new keys.
|
||||||
|
|
||||||
This allows clients to freely upload one set of keys, but not modify/overwrite keys if
|
This allows clients to freely upload one set of keys, but not modify/overwrite keys if
|
||||||
they already exist. Allowing clients to upload the same set of keys more than once
|
they already exist. Allowing clients to upload the same set of keys more than once
|
||||||
makes this endpoint idempotent in the case where the response is lost over the network,
|
makes this endpoint idempotent in the case where the response is lost over the network,
|
||||||
which would otherwise cause a UIA challenge upon retry.
|
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
|
||||||
|
via the [OAuth 2.0 API](/client-server-api/#oauth-20-api).
|
||||||
|
{{% /boxes/warning %}}
|
||||||
operationId: uploadCrossSigningKeys
|
operationId: uploadCrossSigningKeys
|
||||||
security:
|
security:
|
||||||
- accessTokenQuery: []
|
- accessTokenQuery: []
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@
|
||||||
accessTokenQuery:
|
accessTokenQuery:
|
||||||
type: apiKey
|
type: apiKey
|
||||||
description: |-
|
description: |-
|
||||||
**Deprecated.** The `access_token` returned by a call to `/login` or `/register`, as a query
|
**Deprecated.** The `access_token` obtained during [account registration](/client-server-api/#account-registration)
|
||||||
parameter.
|
or [login](/client-server-api/#login), as a query parameter.
|
||||||
|
|
||||||
It can also be the `as_token` of an application service.
|
It can also be the `as_token` of an application service.
|
||||||
name: access_token
|
name: access_token
|
||||||
|
|
@ -23,11 +23,11 @@ accessTokenQuery:
|
||||||
accessTokenBearer:
|
accessTokenBearer:
|
||||||
type: http
|
type: http
|
||||||
description: |-
|
description: |-
|
||||||
The `access_token` returned by a call to `/login` or `/register`, using the
|
The `access_token` obtained during [account registration](/client-server-api/#account-registration)
|
||||||
`Authorization: Bearer` header.
|
or [login](/client-server-api/#login), using the `Authorization: Bearer` header.
|
||||||
|
|
||||||
It can also be the `as_token` of an application service.
|
It can also be the `as_token` of an application service.
|
||||||
|
|
||||||
This is the preferred method.
|
This is the preferred method.
|
||||||
scheme: bearer
|
scheme: bearer
|
||||||
appserviceAccessTokenQuery:
|
appserviceAccessTokenQuery:
|
||||||
|
|
@ -42,6 +42,6 @@ appserviceAccessTokenBearer:
|
||||||
description: |-
|
description: |-
|
||||||
The `as_token` of an application service, using the `Authorization: Bearer`
|
The `as_token` of an application service, using the `Authorization: Bearer`
|
||||||
header.
|
header.
|
||||||
|
|
||||||
This is the preferred method.
|
This is the preferred method.
|
||||||
scheme: bearer
|
scheme: bearer
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,11 @@ paths:
|
||||||
This API endpoint uses the [User-Interactive Authentication API](/client-server-api/#user-interactive-authentication-api).
|
This API endpoint uses the [User-Interactive Authentication API](/client-server-api/#user-interactive-authentication-api).
|
||||||
|
|
||||||
Deletes the given device, and invalidates any access token associated with it.
|
Deletes the given device, and invalidates any access token associated with it.
|
||||||
|
|
||||||
|
{{% boxes/warning %}}
|
||||||
|
Since this endpoint uses User-Interactive Authentication, it cannot be used when the access token was obtained
|
||||||
|
via the [OAuth 2.0 API](/client-server-api/#oauth-20-api).
|
||||||
|
{{% /boxes/warning %}}
|
||||||
operationId: deleteDevice
|
operationId: deleteDevice
|
||||||
security:
|
security:
|
||||||
- accessTokenQuery: []
|
- accessTokenQuery: []
|
||||||
|
|
@ -189,6 +194,11 @@ paths:
|
||||||
This API endpoint uses the [User-Interactive Authentication API](/client-server-api/#user-interactive-authentication-api).
|
This API endpoint uses the [User-Interactive Authentication API](/client-server-api/#user-interactive-authentication-api).
|
||||||
|
|
||||||
Deletes the given devices, and invalidates any access token associated with them.
|
Deletes the given devices, and invalidates any access token associated with them.
|
||||||
|
|
||||||
|
{{% boxes/warning %}}
|
||||||
|
Since this endpoint uses User-Interactive Authentication, it cannot be used when the access token was obtained
|
||||||
|
via the [OAuth 2.0 API](/client-server-api/#oauth-20-api).
|
||||||
|
{{% /boxes/warning %}}
|
||||||
operationId: deleteDevices
|
operationId: deleteDevices
|
||||||
security:
|
security:
|
||||||
- accessTokenQuery: []
|
- accessTokenQuery: []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue