Internet-Draft | Client ID Document | July 2024 |
Parecki & Smith | Expires 3 January 2025 | [Page] |
This specification defines a mechanism through which an OAuth client can
identify itself to authorization servers, without prior dynamic client
registration or other existing registration. This is through the usage of a URL
as a client_id
in an OAuth flow, where the URL refers to a document containing
the necessary client metadata, enabling the authorization server to fetch the
metadata about the client as needed.¶
This note is to be removed before publishing as an RFC.¶
The latest revision of this draft can be found at https://aaronpk.github.io/draft-parecki-oauth-client-id-metadata-document/draft-parecki-oauth-client-id-metadata-document.html. Status information for this document may be found at https://datatracker.ietf.org/doc/draft-parecki-oauth-client-id-metadata-document/.¶
Discussion of this document takes place on the Web Authorization Protocol Working Group mailing list (mailto:oauth@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/oauth/. Subscribe at https://www.ietf.org/mailman/listinfo/oauth/.¶
Source for this draft and an issue tracker can be found at https://github.com/aaronpk/draft-parecki-oauth-client-id-metadata-document.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 3 January 2025.¶
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
In order for an OAuth 2.0 [RFC6749] client to utilize an OAuth 2.0 authorization server, the client needs to establish a unique identifier, and needs to to provide the server with metadata about the application, such as the application name, icon and redirect URIs. In cases where a client is interacting with authorization servers that it has no relationship with, manual registration is impossible.¶
While Dynamic Client Registration [RFC7591] can provide a method for a previously unknown client to establish itself at an authorization server and obtain a client identifier, this is not always practical in some deployments and can create additional challenges around management of the registration data and cleanup of inactive clients.¶
This specification describes how an OAuth 2.0 client can publish its own registration information and avoid the need for pre-registering at each authorization server.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This specification defines the client identifier as a URL with the following restrictions. Client identifier URLs MUST have an "https" scheme, MUST contain a path component, MUST NOT contain single-dot or double-dot path segments, MUST NOT contain a fragment component and MUST NOT contain a username or password component. Client identifier URLs MAY contain a query string component and MAY contain a port.¶
This specification places no restrictions on what URL is used as a client identifier. A short URL is RECOMMENDED, since the URL may be displayed to the end user in the authorization interface or in management interfaces. Usage of a stable URL that does not frequently change for the client is also RECOMMENDED.¶
One purpose of registering clients at the authorization server is so that the authorization server has additional information about the client that can be used during an OAuth flow, such as presenting information about the client to the user in an authorization consent screen, for example the client name and logo.¶
The authorization server SHOULD fetch the document indicated by the client_id
to retrieve the client registration information.¶
The client metadata document URL is a JSON document containing the metadata of the client. The client metadata values are the values defined in OAuth Dynamic Client Registration ([RFC7591]) section 2.¶
The client metadata document MUST contain a client_id
property whose value
MUST compare and match the URL of the document using simple string comparison as
defined in [RFC3986] Section 6.2.1.¶
The client metadata document MAY define additional properties in the response.
The client metadata document MAY also be served with more specific content types
as long as the response is JSON and conforms to application/<AS-defined>+json
.¶
The token_endpoint_auth_method
property MUST NOT include client_secret_post
or client_secret_basic
, as there is no way to establish a shared secret to be
used with these authentication methods. See Section 6.1 for more details.¶
Other specifications MAY place additional restrictions on the contents of the
client metadata document accepted by authorization servers implementing their
specification, for instance, preventing the registration of confidential clients
by requiring the token_endpoint_auth_method
property be set to "none"
.¶
If fetching the metadata document fails, the authorization server SHOULD abort the authorization request.¶
The authorization server MAY cache the client metadata it discovers at the client metadata document URL.¶
TBD: recommend a cache lifetime? considerations about stale data?¶
The authorization server MUST NOT cache error responses. The authorization server also MUST NOT cache documents which are invalid or malformed.¶
TBD: Do we want to define an endpoint through which a document can be validated by an authorization server, such that a developer can assert that their document is valid?¶
According to [I-D.draft-ietf-oauth-security-topics], the authorization server MUST require registration of redirect URIs, and MUST ensure that the redirect URI in a request is an exact match of a registered redirect URI.¶
This method of client information discovery establishes a registered redirect URI with the authorization server which is used when comparing the redirect URI in an authorization request against the registered redirect URIs.¶
Authorization servers that publish Authorization Server Metadata [RFC8414] MUST include the following property to signal support for client metadata documents as described in this specification.¶
client_id_metadata_document_supported
:OPTIONAL. Boolean value specifying whether the authorization server supports retrieving client metadata from a client_id
URL as described in this specification.¶
This enables clients to avoid sending the user to a dead end, by only redirecting the user to an authorization server that supports this specification. Otherwise, the client would redirect the user and the user would be met with an error about an invalid client as described by Section 4.1.2.1 of [RFC6749].¶
In addition to the security considerations in OAuth 2.0 Core [RFC6749], and OAuth 2.0 Threat Model and Security Considerations [RFC6819], and [I-D.draft-ietf-oauth-security-topics] the additional considerations apply.¶
Since the client establishes its own registration data at the authorization server, prior coordination of client credentials is not possible. However, clients MAY establish credentials at the authorization server by using authentication methods that use public/private key pairs, by publishing the public key in their metadata document.¶
For example, the client MAY include the following properties in its metadata document
to establish a public key and the private_key_jwt
authentication method defined in [OpenID]:¶
{ ... "token_endpoint_auth_method": "private_key_jwt", "jwks_uri": "https://client.example.com/jwks.json" ... }¶
This establishes this client as a confidential client, and any communication with the authorization server MUST include client authentication of the registered type.¶
Authorization servers SHOULD fetch the client_id
metadata document provided in the authorization request in order to provide users with additional information about the request, such as the application name and logo. If the server does not fetch the client metadata document, then it SHOULD take additional measures to ensure the user is provided with as much information as possible about the request.¶
The authorization server SHOULD display the hostname of the client_id
on the authorization interface, in addition to displaying the fetched client information if any. Displaying the hostname helps users know that they are authorizing the expected application.¶
If fetching the client metadata document fails for any reason, the client_id
URL is the only piece of information the user has as an indication of which application they are authorizing.¶
Authorization servers fetching the client metadata document and resolving URLs located in the metadata document should be aware of possible SSRF attacks. Authorization servers SHOULD avoid fetching any URLs using private or loopback addresses and consider network policies or other measures to prevent making requests to these addresses. Authorization servers SHOULD also be aware of the possibility that URLs might be non-http-based URI schemes which can lead to other possible SSRF attack vectors.¶
The idea of using URIs as the client_id
in OAuth based authorization requests is not new, and has previously been specified in varying ways by [IndieAuth], [Solid-OIDC], and [OpenID.Federation]. This specification is largely inspired by the work of Aaron Coburn, elf Pavlik, and Dmitri Zagidulin in their [Solid-OIDC] specification which defined dereferenceable Client Identifier Documents.¶
The authors would like to thank the following people for their contributions and reviews of this specification: Matthieu Sieben.¶
[[ To be removed from the final specification ]]¶
-00¶
Initial draft¶