OAuth Working Group | J. Richer |
Internet-Draft | The MITRE Corporation |
Intended status: Standards Track | M.B. Jones |
Expires: August 11, 2014 | Microsoft |
J. Bradley | |
Ping Identity | |
M. Machulak | |
Newcastle University | |
P. Hunt | |
Oracle Corporation | |
February 07, 2014 |
OAuth 2.0 Dynamic Client Registration Core Protocol
draft-ietf-oauth-dyn-reg-16
This specification defines mechanisms used to dynamically register OAuth 2.0 clients at authorization servers.
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 http://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 August 11, 2014.
Copyright (c) 2014 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 (http://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 Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
In order for an OAuth 2.0 client to utilize an OAuth 2.0 authorization server, the client needs specific information to interact with the server, including an OAuth 2.0 Client ID to use at that server. This specification describes how an OAuth 2.0 client can be dynamically registered with an authorization server to obtain this information.
As part of the registration process, this specification also defines a mechanism for the client to present the authorization server with a set of metadata, such as a set of valid redirection URIs. This metadata can either be communicated in a self-asserted fashion or as a set of metadata called a software statement, which can be signed; in the case of a signed software statement, the signer is vouching for the validity of the data about the client.
The mechanisms defined in this specification can be used either for a client to dynamically register itself with authorization servers or for a client developer to programmatically register the client with authorization servers.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this document are to be interpreted as described in [RFC2119].
Unless otherwise noted, all the protocol parameter names and values are case sensitive.
This specification uses the terms "Access Token", "Refresh Token", "Authorization Code", "Authorization Grant", "Authorization Server", "Authorization Endpoint", "Client", "Client Identifier", "Client Secret", "Protected Resource", "Resource Owner", "Resource Server", "Response Type", and "Token Endpoint" defined by OAuth 2.0 [RFC6749] and uses the term "Claim" defined by JSON Web Token (JWT) [JWT].
This specification defines the following terms:
+--------(A)- Initial Access Token (OPTIONAL) | | +----(B)- Software Statement (OPTIONAL) | | v v +-----------+ +---------------+ | |--(C)- Client Registration Request -->| Client | | Client or | | Registration | | Developer |<-(D)- Client Information Response ---| Endpoint | | | +---------------+ +-----------+
Figure 1: Abstract Dynamic Client Registration Flow
The abstract OAuth 2.0 client dynamic registration flow illustrated in Figure 1 describes the interaction between the client or developer and the endpoint defined in this specification. This figure does not demonstrate error conditions. This flow includes the following steps:
Clients have a set of metadata values associated with their unique client identifier at an authorization server, such as the list of valid redirect URIs.
The client metadata values are used in two ways:
These client metadata values are defined by this specification:
Additional values can be defined via the IANA OAuth Token Endpoint Authentication Methods Registry
Section 6.2. Absolute URIs can also be used as values for this parameter without being registered. If unspecified or omitted, the default is client_secret_basic, denoting HTTP Basic Authentication Scheme as specified in Section 2.3.1 of OAuth 2.0.Authorization Servers MAY allow for other values as defined in grant type extensions to OAuth 2.0. The extension process is described in OAuth 2.0 Section 2.5. If the token endpoint is used in the grant type, the value of this parameter MUST be the same as the value of the
grant_type parameter passed to the token endpoint defined in the extension.Authorization servers MAY allow for other values as defined in response type extensions to OAuth 2.0. The extension process is described in OAuth 2.0 Section 2.5. If the authorization endpoint is used by the grant type, the value of this parameter MUST be the same as the value of the
response_type parameter passed to the authorization endpoint defined in the extension.
Authorization servers MUST accept all fields in this list. Extensions and profiles of this specification MAY expand this list. For instance, the [OAuth.Registration.Metadata] specification defines additional client metadata values. The authorization server MUST ignore any client metadata values sent by the Client that it does not understand.
Client metadata values can either be communicated directly in the body of a registration request, as described in Section 4.1, or included as claims in a software statement, as described in Section 3. If the same client metadata name is present in both locations, the value in the software statement SHOULD take precedence.
The grant_types and response_types values described above are partially orthogonal, as they refer to arguments passed to different endpoints in the OAuth protocol. However, they are related in that the grant_types available to a client influence the response_types that the client is allowed to use, and vice versa. For instance, a grant_types value that includes authorization_code implies a response_types value that includes code, as both values are defined as part of the OAuth 2.0 authorization code grant. As such, a server supporting these fields SHOULD take steps to ensure that a client cannot register itself into an inconsistent state.
The correlation between the two fields is listed in the table below.
grant_types value includes: | response_types value includes: |
---|---|
authorization_code | code |
implicit | token |
password | (none) |
client_credentials | (none) |
refresh_token | (none) |
urn:ietf:params:oauth:grant-type:jwt-bearer | (none) |
urn:ietf:params:oauth:grant-type:saml2-bearer | (none) |
Extensions and profiles of this document that introduce new values to either the grant_types or response_types parameter MUST document all correspondences between these two parameter types.
A Software Statement is a JSON Web Token (JWT) [JWT] that asserts metadata values about the client software. The JWT MUST be signed and contain an iss (issuer) claim if its metadata values are being attested to by the issuer; if the metadata values are not being attested to, the JWT MAY be unsigned. This can be used by the registration system to qualify clients for eligibility to register. It may also be accepted by some authorization servers directly as a Client ID value, without prior registration.
To obtain a software statement, a client developer may generate a client specific JWT, or a client developer may register with a software API publisher to obtain a software statement. The statement is typically distributed with all copies of a client application.
The criteria by which authorization servers determine whether to trust and utilize the information in a software statement is beyond the scope of this specification.
If the authorization server determines that the claims in a software statement uniquely identify a piece of software, the same Client ID value MAY be returned for all dynamic registrations using that software statement. However, authorization servers MAY alternatively return a unique Client ID value for each dynamic registration of a piece of software.
In some cases, authorization servers MAY choose to accept a software statement value directly as a Client ID in an authorization request, without a prior dynamic client registration having been performed. The circumstances under which an authorization server would do so, and the specific software statement characteristics required in this case, are beyond the scope of this specification.
The client registration endpoint is an OAuth 2.0 endpoint defined in this document that is designed to allow a client to be registered with the authorization server. The client registration endpoint MUST accept HTTP POST messages with request parameters encoded in the entity body using the application/json format. The client registration endpoint MUST be protected by a transport-layer security mechanism, and the server MUST support TLS 1.2 RFC 5246 [RFC5246] and/or TLS 1.0 [RFC2246] and MAY support additional transport-layer mechanisms meeting its security requirements. When using TLS, the Client MUST perform a TLS/SSL server certificate check, per RFC 6125 [RFC6125].
The client registration endpoint MAY be an OAuth 2.0 protected resource and accept an initial access token in the form of an OAuth 2.0 [RFC6749] access token to limit registration to only previously authorized parties. The method by which the initial access token is obtained by the registrant is generally out-of-band and is out of scope for this specification. The method by which the initial access token is verified and validated by the client registration endpoint is out of scope for this specification.
To support open registration and facilitate wider interoperability, the client registration endpoint SHOULD allow initial registration requests with no authorization (which is to say, with no OAuth 2.0 access token in the request). These requests MAY be rate-limited or otherwise limited to prevent a denial-of-service attack on the client registration endpoint.
The client registration endpoint MUST ignore all parameters it does not understand.
This operation registers a new client to the authorization server. The authorization server assigns this client a unique client identifier, optionally assigns a client secret, and associates the metadata given in the request with the issued client identifier. The request includes any client metadata parameters being specified for the client during the registration. The authorization server MAY provision default values for any items omitted in the client metadata.
Client metadata values may also be provided in a software statement, as described in Section 3. Software statements are included in registration requests using this registration parameter:
To register, the client or developer sends an HTTP POST to the client registration endpoint with a content type of application/json. The HTTP Entity Payload is a JSON [RFC4627] document consisting of a JSON object and all parameters as top-level members of that JSON object.
For example, if the server supports open registration (with no initial access token), the client could send the following registration request to the client registration endpoint:
The following is a non-normative example request not using an initial access token (with line wraps within values for display purposes only):
POST /register HTTP/1.1 Content-Type: application/json Accept: application/json Host: server.example.com { "redirect_uris":[ "https://client.example.org/callback", "https://client.example.org/callback2"], "token_endpoint_auth_method":"client_secret_basic", "example_extension_parameter": "example_value" }
Alternatively, if the server supports authorized registration, the developer or the client will be provisioned with an initial access token (the method by which the initial access token is obtained is out of scope for this specification). The developer or client sends the following authorized registration request to the client registration endpoint. Note that the initial access token sent in this example as an OAuth 2.0 Bearer Token [RFC6750], but any OAuth 2.0 token type could be used by an authorization server.
The following is a non-normative example request using an initial access token (with line wraps within values for display purposes only):
POST /register HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Bearer ey23f2.adfj230.af32-developer321 Host: server.example.com { "redirect_uris":["https://client.example.org/callback", "https://client.example.org/callback2"], "token_endpoint_auth_method":"client_secret_basic", "example_extension_parameter": "example_value" }
In the following example, some registration parameters are conveyed as claims in a software statement (with line wraps within values for display purposes only):
POST /register HTTP/1.1 Content-Type: application/json Accept: application/json Host: server.example.com { "redirect_uris":[ "https://client.example.org/callback", "https://client.example.org/callback2" ], "software_statement":"eyJhbGciOiJFUzI1NiJ9. eyJpc3Mi[...omitted for brevity...]. J9l-ZhwP[...omitted for brevity...]", "extension_parameter":"foo" }
Upon successful registration, the authorization server generates a new client identifier for the client. This client identifier MUST be unique at the server and MUST NOT be in use by any other client. The server responds with an HTTP 201 Created code and a body of type application/json with content as described in Section 5.1.
Upon an unsuccessful registration, the authorization server responds with an error, as described in Section 5.2.
The following responses are sent in response to registration requests.
The response contains the client identifier as well as the client secret, if the client is a confidential client. The response MAY contain additional fields as specified by extensions to this specification.
Additionally, the Authorization Server MUST return all registered metadata about this client, including any fields provisioned by the authorization server itself. The authorization server MAY reject or replace any of the client's requested metadata values submitted during the registration or update requests and substitute them with suitable values.
The response is an application/json document with all parameters as top-level members of a JSON object [RFC4627].
If a software statement was used as part of the registration, its value SHOULD be returned in the response and its value MUST be returned if the authorization server supports registration management operations [OAuth.Registration.Management] that would require its presence in subsequent operations. Client metadata elements used from the software statement MUST also be returned directly as top-level client metadata values in the registration response (possibly with different values, since the values requested and the values used may differ).
Following is a non-normative example response:
HTTP/1.1 200 OK Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "client_id":"s6BhdRkqt3", "client_secret": "cf136dc3c1fc93f31185e5885805d", "client_id_issued_at":2893256800, "client_secret_expires_at":2893276800, "redirect_uris":[ "https://client.example.org/callback", "https://client.example.org/callback2"], "grant_types": ["authorization_code", "refresh_token"], "token_endpoint_auth_method": "client_secret_basic", "example_extension_parameter": "example_value" }
When an OAuth 2.0 error condition occurs, such as the client presenting an invalid initial access token, the authorization server returns an error response appropriate to the OAuth 2.0 token type.
When a registration error condition occurs, the authorization server returns an HTTP 400 status code (unless otherwise specified) with content type application/json consisting of a JSON object [RFC4627] describing the error in the response body.
The JSON object contains two members:
This specification defines the following error codes:
Following is a non-normative example of an error response (with line wraps for display purposes only):
HTTP/1.1 400 Bad Request Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "error":"invalid_redirect_uri", "error_description":"The redirect URI http://sketchy.example.com is not allowed for this server." }
This specification establishes the OAuth Registration Client Metadata registry.
OAuth registration client metadata values are registered with a Specification Required ([RFC5226]) after a two-week review period on the oauth-ext-review@ietf.org mailing list, on the advice of one or more Designated Experts. However, to allow for the allocation of values prior to publication, the Designated Expert(s) may approve registration once they are satisfied that such a specification will be published.
Registration requests must be sent to the oauth-ext-review@ietf.org mailing list for review and comment, with an appropriate subject (e.g., "Request to register OAuth Registration Client Metadata name: example").
Within the review period, the Designated Expert(s) will either approve or deny the registration request, communicating this decision to the review list and IANA. Denials should include an explanation and, if applicable, suggestions as to how to make the request successful.
IANA must only accept registry updates from the Designated Expert(s) and should direct all requests for registration to the review mailing list.
The initial contents of the OAuth Registration Client Metadata registry are:
This specification establishes the OAuth Token Endpoint Authentication Methods registry.
Additional values for use as token_endpoint_auth_method metadata values are registered with a Specification Required ([RFC5226]) after a two-week review period on the oauth-ext-review@ietf.org mailing list, on the advice of one or more Designated Experts. However, to allow for the allocation of values prior to publication, the Designated Expert(s) may approve registration once they are satisfied that such a specification will be published.
Registration requests must be sent to the oauth-ext-review@ietf.org mailing list for review and comment, with an appropriate subject (e.g., "Request to register token_endpoint_auth_method value: example").
Within the review period, the Designated Expert(s) will either approve or deny the registration request, communicating this decision to the review list and IANA. Denials should include an explanation and, if applicable, suggestions as to how to make the request successful.
IANA must only accept registry updates from the Designated Expert(s) and should direct all requests for registration to the review mailing list.
The initial contents of the OAuth Token Endpoint Authentication Methods registry are:
Since requests to the client registration endpoint result in the transmission of clear-text credentials (in the HTTP request and response), the Authorization Server MUST require the use of a transport-layer security mechanism when sending requests to the registration endpoint. The server MUST support TLS 1.2 RFC 5246 [RFC5246] and/or TLS 1.0 [RFC2246] and MAY support additional transport-layer mechanisms meeting its security requirements. When using TLS, the Client MUST perform a TLS/SSL server certificate check, per RFC 6125 [RFC6125].
For clients that use redirect-based grant types such as authorization_code and implicit, authorization servers SHOULD require clients to register their redirect_uris. Requiring clients to do so can help mitigate attacks where rogue actors inject and impersonate a validly registered client and intercept its authorization code or tokens through an invalid redirect URI.
Public clients MAY register with an authorization server using this protocol, if the authorization server's policy allows them. Public clients use a none value for the token_endpoint_auth_method metadata field and are generally used with the implicit grant type. Often these clients will be short-lived in-browser applications requesting access to a user's resources and access is tied to a user's active session at the authorization server. Since such clients often do not have long-term storage, it's possible that such clients would need to re-register every time the browser application is loaded. Additionally, such clients may not have ample opportunity to unregister themselves using the delete action before the browser closes. To avoid the resulting proliferation of dead client identifiers, an authorization server MAY decide to expire registrations for existing clients meeting certain criteria after a period of time has elapsed.
Since different OAuth 2.0 grant types have different security and usage parameters, an authorization server MAY require separate registrations for a piece of software to support multiple grant types. For instance, an authorization server might require that all clients using the authorization_code grant type make use of a client secret for the token_endpoint_auth_method, but any clients using the implicit grant type do not use any authentication at the token endpoint. In such a situation, a server MAY disallow clients from registering for both the authorization_code and implicit grant types simultaneously. Similarly, the authorization_code grant type is used to represent access on behalf of an end user, but the client_credentials grant type represents access on behalf of the client itself. For security reasons, an authorization server could require that different scopes be used for these different use cases, and as a consequence it MAY disallow these two grant types from being registered together by the same client. In all of these cases, the authorization server would respond with an invalid_client_metadata error response.
[OAuth.Registration.Metadata] | Richer, J., Jones, M.B., Bradley, J., Machulak, M. and P. Hunt, "OAuth 2.0 Dynamic Client Registration Metadata", Internet-Draft draft-ietf-oauth-dyn-reg-metadata, February 2014. |
This appendix describes different ways that this specification can be utilized, including describing some of the choices that may need to be made. Some of the choices are independent and can be used in combination, whereas some of the choices are interrelated.
Authorization servers that support open registration allow registrations to be made with no initial access token. This allows all client software to register with the authorization server.
Authorization servers that support protected registration require that an initial access token be used when making registration requests. While the method by which a client or developer receives this initial access token and the method by which the authorization server validates this initial access token are out of scope for this specification, a common approach is for the developer to use a manual pre-registration portal at the authorization server that issues an initial access token to the developer.
When a software statement is not used in the registration request, the authorization server must be willing to use client metadata values without them being signed (and thereby attested to) by any authority. (Note that this choice is independent of the Open versus Protected choice, and that an initial access token is another possible form of attestation.)
A software statement can be used in a registration request to provide attestation for a set of client metadata values for a piece of client software by an authority. This can be useful when the authorization server wants to restrict registration to client software attested to by a set of authorities or when it wants to know that multiple registration requests refer to the same piece of client software.
In some use cases, client software will dynamically register itself with an authorization server to obtain a Client ID and other information needed to interact with the authorization server. In this case, no Client ID for the authorization server is packaged with the client software.
In some cases, the developer (or development software being used by the developer) will pre-register the client software with the authorization server or a set of authorization servers. In this case, the Client ID value(s) for the authorization server(s) can be packaged with the client software.
In some cases, each deployed instance of a piece of client software will dynamically register and obtain distinct Client ID values. This can be advantageous, for instance, if the code flow is being used, as it also enables each client instance to have its own client secret. This can be useful for native clients, which cannot maintain the secrecy of a client secret value packaged with the software, but which may be able to maintain the secrecy of a per-instance client secret.
In some cases, each deployed instance of a piece of client software will share a common Client ID value. For instance, this is often the case for native client using implicit flow, when no client secret is involved. Particular authorization servers might choose, for instance, to maintain a mapping between software statement values and Client ID values, and return the same Client ID value for all registration requests for a particular piece of software. The circumstances under which an authorization server would do so, and the specific software statement characteristics required in this case, are beyond the scope of this specification.
In some cases, authorization servers will maintain state about registered clients, typically indexing this state using the Client ID value. This state would typically include the client metadata values associated with the client registration, and possibly other state specific to the authorization server's implementation. When stateful registration is used, operations to support retrieving and/or updating this state may be supported, as described in the [OAuth.Registration.Management] specification.
In some cases, authorization servers will be implemented in a manner the enables them to not maintain any local state about registered clients. One means of doing this is to encode all the registration state in the returned Client ID value, and possibly encrypting the state to the authorization server to maintain the confidentiality and integrity of the state.
The authors thank the OAuth Working Group, the User-Managed Access Working Group, and the OpenID Connect Working Group participants for their input to this document. In particular, the following individuals have been instrumental in their review and contribution to various versions of this document: Amanda Anganes, Derek Atkins, Tim Bray, Domenico Catalano, Donald Coffin, Vladimir Dzhuvinov, George Fletcher, Thomas Hardjono, Phil Hunt, William Kim, Torsten Lodderstedt, Eve Maler, Josh Mandel, Nov Matake, Tony Nadalin, Nat Sakimura, Christian Scholz, and Hannes Tschofenig.
[[ to be removed by the RFC editor before publication as an RFC ]]
-16
-15
-14
-13
-12
-11
-10
-09
-08
-07
-06
-05
-04
-03
-02
-01
-00