OAuth Working Group | J. Richer, Ed. |
Internet-Draft | The MITRE Corporation |
Intended status: Standards Track | J. Bradley |
Expires: November 06, 2013 | Ping Identity |
M.B. Jones | |
Microsoft | |
M. Machulak | |
Newcastle University | |
May 05, 2013 |
OAuth 2.0 Dynamic Client Registration Protocol
draft-ietf-oauth-dyn-reg-10
This specification defines an endpoint and protocol for dynamic registration of OAuth 2.0 Clients at an Authorization Server and methods for the dynamically registered client to manage its registration.
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 November 06, 2013.
Copyright (c) 2013 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 some use-case scenarios, it is desirable or necessary to allow OAuth 2.0 clients to obtain authorization from an OAuth 2.0 authorization server without requiring the two parties to interact beforehand. Nevertheless, in order for the authorization server to accurately and securely represent to end-users which client is seeking authorization to access the end-user's resources, a method for automatic and unique registration of clients is needed. The OAuth 2.0 authorization framework does not define how the relationship between the Client and the Authorization Server is initialized, or how a given client is assigned a unique Client Identifier. Historically, this has happened out-of-band from the OAuth 2.0 protocol. This draft provides a mechanism for a client to register itself with the Authorization Server, which can be used to dynamically provision a Client Identifier, and optionally a Client Secret.
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 display name and icon to be presented to the user during the authorization step. This draft also provides a mechanism for the Client to read and update this information after the initial registration action.
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", and "Token Endpoint" defined by OAuth 2.0 [RFC6749].
This specification defines the following additional terms:
Clients generally have an array of metadata associated with their unique Client Identifier at the Authorization Server. These can range from human-facing display strings, such as a client name, to items that impact the security of the protocol, such as the list of valid redirect URIs.
The client metadata values serve two parallel purposes in the overall OAuth 2.0 Dynamic Client Registration protocol:
An Authorization Server MAY override any value that a Client requests during the registration process (including any omitted values) and replace the requested value with a default at the server's discretion. The Authorization Server SHOULD provide documentation for any fields that it requires to be filled in by the client or to have particular values or formats.
Extensions and profiles of this specification MAY expand this list, but Authorization Servers MUST accept or ignore all parameters on this list. The Authorization Server MUST ignore any additional parameters sent by the Client that it does not understand.
Other authentication methods may be defined by extension. 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. Other authentication methods MAY be supported by using an absolute URI as the value of this parameter.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, and 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, and 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.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) |
Extensions and profiles of this document that introduce new values to either the grant_types or response_types parameter MUST document all correspondences between the parameter types.
Human-readable Client Metadata values and Client Metadata values that reference human-readable values MAY be represented in multiple languages and scripts. For example, the values of fields such as client_name, tos_uri, policy_uri, logo_uri, and client_uri might have multiple locale-specific values in some Client registrations.
To specify the languages and scripts, BCP47 [RFC5646] language tags are added to Client Metadata member names, delimited by a # character. Since JSON member names are case sensitive, it is RECOMMENDED that language tag values used in Claim Names be spelled using the character case with which they are registered in the IANA Language Subtag Registry [IANA.Language]. In particular, normally language names are spelled with lowercase characters, region names are spelled with uppercase characters, and languages are spelled with mixed case characters. However, since BCP47 language tag values are case insensitive, implementations SHOULD interpret the language tag values supplied in a case insensitive manner. Per the recommendations in BCP47, language tag values used in Metadata member names should only be as specific as necessary. For instance, using fr might be sufficient in many contexts, rather than fr-CA or fr-FR.
For example, a Client could represent its name in English as "client_name#en": "My Client" and its name in Japanese as "client_name#ja-Jpan-JP": "クライアント名" within the same registration request. The Authorization Server MAY display any or all of these names to the Resource Owner during the authorization step, choosing which name to display based on system configuration, user preferences or other factors.
If any human-readable field is sent without a language tag, parties using it MUST NOT make any assumptions about the language, character set, or script of the string value, and the string value MUST be used as-is wherever it is presented in a user interface. To facilitate interoperability, it is RECOMMENDED that clients and servers use a human-readable field without any language tags in addition to any language-specific fields, and it is RECOMMENDED that any human-readable fields sent without language tags contain values suitable for display on a wide variety of systems.
Implementer's Note: Many JSON libraries make it possible to reference members of a JSON object as members of an Object construct in the native programming environment of the library. However, while the # character is a valid character inside of a JSON object's member names, it is not a valid character for use in an object member name in many programming environments. Therefore, implementations will need to use alternative access forms for these claims. For instance, in JavaScript, if one parses the JSON as follows, var j = JSON.parse(json);, then the member client_name#en-us can be accessed using the JavaScript syntax j["client_name#en-us"].
The Client Registration Endpoint is an OAuth 2.0 Endpoint defined in this document that is designed to allow a Client to register itself 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 accept an initial authorization credential in the form of an OAuth 2.0 [RFC6749] access token in order to limit registration to only previously authorized parties. The method by which this access token is obtained by the registrant is generally out-of-band and is out of scope of this specification.
In order to support open registration and facilitate wider interoperability, the Client Registration Endpoint SHOULD allow initial registration requests with no authentication. These requests MAY be rate-limited or otherwise limited to prevent a denial-of-service attack on the Client Registration Endpoint.
In order to facilitate registered clients updating their information, the Client Registration Endpoint issues a Request Access Token for clients to securely identify themselves in future connections to the Client Configuration Endpoint [AccessEndpoint]. As such, the Client Configuration Endpoint MUST accept requests with OAuth 2.0 Bearer Tokens [RFC6750] for these operations, whether or not the initial registration call requires authentication of some form.
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 parameters described in Client Metadata [client-metadata] that the client wishes to specify for itself during the registration. The Authorization Server MAY provision default values for any items omitted in the Client Metadata.
The Client 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, a client could send the following open registration request to the Client Registration Endpoint:
Following is a non-normative example request (with line wraps 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"] "client_name":"My Example Client", "token_endpoint_auth_method":"client_secret_basic", "scope":"read write dolphin", "logo_uri":"https://client.example.org/logo.png", "jwks_uri":"https://client.example.org/my_public_keys.jwks" }
Alternatively, if the client has been provisioned with an initial authorization credential, it could send the following registration request to the Client Registration Endpoint:
Following is a non-normative example request (with line wraps 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"] "client_name":"My Example Client", "token_endpoint_auth_method":"client_secret_basic", "scope":"read write dolphin", "logo_uri":"https://client.example.org/logo.png", "jwks_uri":"https://client.example.org/my_public_keys.jwks" }
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 described in Client Information Response [client-info-response].
Upon an unsuccessful registration, the Authorization Server responds with an error as described in Client Registration Error [client-registration-error].
The Client Configuration Endpoint is an OAuth 2.0 protected endpoint that is provisioned by the server for a specific client to be able to view and update its registered information. The Client MUST include its Registration Access Token in all calls to this endpoint as an OAuth 2.0 Bearer Token [RFC6750].
Operations on this endpoint are switched through the use of different HTTP methods [RFC2616].
The Authorization Server MUST provide the client with the fully qualified URL in the registration_client_uri element of the Client Information Response [client-info-response]. The Authorization Server MUST NOT expect the client to construct or discover this URL on its own. The Client MUST use the URL as given by the server and MUST NOT construct this URL from component pieces.
Depending on deployment characteristics, the Client Configuration Endpoint URL may take any number of forms. It is RECOMMENDED that this endpoint URL be formed through the use of a server-constructed URL string which combines the Client Registration Endpoint's URL and the issued client_id for this Client, with the latter as either a path parameter or a query parameter. For example, a Client with the Client ID s6BhdRkqt3 could be given a Client Configuration Endpoint URL of https://server.example.com/register/s6BhdRkqt3 (path parameter) or of https://server.example.com/register?client_id=s6BhdRkqt3 (query parameter). In both of these cases, the client simply follows the URL as given.
These common patterns can help the Server to more easily determine the client to which the request pertains, which MUST be matched against the client to which the Registration Access Token was issued. If desired, the server MAY simply return the Client Registration Endpoint URL as the Client Configuration Endpoint URL and change behavior based on the authentication context provided by the Registration Access Token.
In order to read the current configuration of the Client on the Authorization Server, the Client makes an HTTP GET request to the Client Configuration Endpoint, authenticating with its Registration Access Token.
Following is a non-normative example request (with line wraps for display purposes only):
GET /register/s6BhdRkqt3 HTTP/1.1 Accept: application/json Host: server.example.com Authorization: Bearer reg-23410913-abewfq.123483
Upon successful read of the information for a currently active Client, the Authorization Server responds with an HTTP 200 OK with content type of application/json and a payload as described in Client Information Response [client-info-response].
If the client does not exist on this server, the server MUST respond with HTTP 401 Unauthorized and the Registration Access Token used to make this request SHOULD be immediately revoked.
If the Client does not have permission to read its record, the server MUST return an HTTP 403 Forbidden.
This operation updates a previously-registered client with new metadata at the Authorization Server. This request is authenticated by the Registration Access Token issued to the client.
The Client sends an HTTP PUT to the Client Configuration 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.
This request MUST include all fields described in Client Metadata [client-metadata] as returned to the Client from a previous register, read, or update operation. The Client MUST NOT include the registration_access_token, registration_client_uri, expires_at, or issued_at fields described in Client Information Response [client-info-response].
Valid values of Client Metadata fields in this request MUST replace, not augment, the values previously associated with this Client. Omitted fields MUST be treated as null or empty values by the server.
The Client MUST include its client_id field in the request, and it MUST be the same as its currently-issued Client Identifier. If the client includes the client_secret field in the request, the value of this field MUST match the currently-issued Client Secret for that Client. The Client MUST NOT be allowed to overwrite its existing Client Secret with its own chosen value.
For all metadata fields, the Authorization Server MAY replace any invalid values with suitable default values, and it MUST return any such fields to the Client in the response.
For example, a client could send the following request to the Client Registration Endpoint to update the client registration in the above example with new information:
Following is a non-normative example request (with line wraps for display purposes only):
PUT /register/s6BhdRkqt3 HTTP/1.1 Accept: application/json Host: server.example.com Authorization: Bearer reg-23410913-abewfq.123483 { "client_id":"s6BhdRkqt3", "client_secret": "cf136dc3c1fc93f31185e5885805d", "redirect_uris":["https://client.example.org/callback", "https://client.example.org/alt"], "scope": "read write dolphin", "grant_types": ["authorization_code", "refresh_token"] "token_endpoint_auth_method": "client_secret_basic", "jwks_uri": "https://client.example.org/my_public_keys.jwks" "client_name":"My New Example", "logo_uri":"https://client.example.org/newlogo.png" }
Upon successful update, the Authorization Server responds with an HTTP 200 OK Message with content type application/json and a payload as described in Client Information Response [client-info-response]. The Authorization Server MAY include a new Client Secret and/or Registration Access Token in its response. If so, the Client MUST immediately discard its previous Client Secret and/or Registration Access Token.
If the client does not exist on this server, the server MUST respond with HTTP 401 Unauthorized, and the Registration Access Token used to make this request SHOULD be immediately revoked.
If the Client is not allowed to update its records, the server MUST respond with HTTP 403 Forbidden.
If the Client attempts to set an invalid metadata field and the Authorization Server does not set a default value, the Authorization Server responds with an error as described in Client Registration Error Response [client-registration-error].
In order to deprovision itself on the Authorization Server, the Client makes an HTTP DELETE request to the Client Configuration Endpoint. This request is authenticated by the Registration Access Token issued to the client.
Following is a non-normative example request (with line wraps for display purposes only):
DELETE /register/s6BhdRkqt3 HTTP/1.1 Accept: application/json Host: server.example.com Authorization: Bearer reg-23410913-abewfq.123483
A successful delete action will invalidate the client_id, client_secret, and registration_access_token for this client, thereby preventing the client_id from being used at either the Authorization Endpoint or Token Endpoint of the Authorization Server. The Authorization Server SHOULD immediately invalidate all existing authorization grants and currently-active tokens associated with this Client.
If a Client has been successfully deprovisioned, the Authorization Server responds with an HTTP 204 No Content message.
If the server does not support the delete method, the server MUST respond with an HTTP 405 Not Supported.
If the client does not exist on this server, the server MUST respond with HTTP 401 Unauthorized and the Registration Access Token used to make this request SHOULD be immediately revoked.
If the client is not allowed to delete itself, the server MUST respond with HTTP 403 Forbidden.
Following is a non-normative example response:
HTTP/1.1 204 No Content Cache-Control: no-store Pragma: no-cache
In response to certain requests from the Client to either the Client Registration Endpoint or the Client Configuration Endpoint as described in this specification, the Authorization Server sends the following response bodies.
The response contains the Client Identifier as well as the Client Secret, if the Client is a confidential Client. The response also contains the fully qualified URL to the Client Configuration Endpoint for this specific client that the client may use to obtain and update information about itself. The response also contains a Registration Access Token that is to be used by the client to perform subsequent operations at the Client Configuration Endpoint.
Additionally, the Authorization Server MUST return all registered metadata [client-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].
Following is a non-normative example response:
HTTP/1.1 200 OK Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "registration_access_token": "reg-23410913-abewfq.123483", "registration_client_uri": "https://server.example.com/register/s6BhdRkqt3", "client_id":"s6BhdRkqt3", "client_secret": "cf136dc3c1fc93f31185e5885805d", "expires_at":2893276800 "redirect_uris":["https://client.example.org/callback", "https://client.example.org/callback2"] "scope": "read write dolphin", "grant_types": ["authorization_code", "refresh_token"] "token_endpoint_auth_method": "client_secret_basic", "logo_uri": "https://client.example.org/logo.png", "jwks_uri": "https://client.example.org/my_public_keys.jwks" }
When an OAuth 2.0 error condition occurs, such as the client presenting an invalid Registration Access Token, the Authorization Server returns an Error Response as defined in Section 5.2 of the OAuth 2.0 specification.
When a registration error condition occurs, the Authorization Server returns an HTTP 400 status code 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 of http://sketchy.example.com is not allowed for this server." }
This document makes no requests of IANA.
Since requests to the Client Registration Endpoint result in the transmission of clear-text credentials (in the HTTP request and response), the 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].
As this endpoint is an OAuth 2.0 Protected Resource, requests to the Registration Endpoint SHOULD have some rate limiting on failures to prevent the Registration Access Token from being disclosed though repeated access attempts.
For clients that use redirect-based grant types such as Authorization Code and Implicit, Authorization Servers SHOULD require clients to pre-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.
The authorization server MUST treat all client metadata as self-asserted. A rogue Client might use the name and logo for the legitimate Client, which it is trying to impersonate. An Authorization Server needs to take steps to mitigate this phishing risk, since the logo could confuse users into thinking they're logging in to the legitimate Client. For instance, an Authorization Server could warn if the domain/site of the logo doesn't match the domain/site of redirect URIs. An Authorization Server can also present warning messages to end users about untrusted Clients in all cases, especially if such clients have been dynamically registered and have not been trusted by any users at the Authorization Server before.
In a situation where the Authorization Server is supporting open Client registration, it must be extremely careful with any URL provided by the Client that will be displayed to the user (e.g. logo_uri and policy_uri). A rogue Client could specify a registration request with a reference to a drive-by download in the policy_uri. The Authorization Server should check to see if the logo_uri and policy_uri have the same host as the hosts defined in the array of redirect_uris.
While the Client Secret can expire, the Registration Access Token should not expire while a client is still actively registered. If this token were to expire, a Client could be left in a situation where it has no means of updating itself and must register itself anew. As the Registration Access Tokens are long-term credentials, and since the Registration Access Token is a Bearer token and acts as the sole authentication for use at the Client Configuration Endpoint, it MUST be protected by the Client as described in OAuth 2.0 Bearer [RFC6750].
If a Client is deprovisioned from a server, any outstanding Registration Access Tokens for that client MUST be invalidated at the same time. Otherwise, this can lead to an inconsistent state wherein a Client could make requests to the Client Configuration Endpoint where the authentication would succeed but the action would fail because the Client is no longer valid.
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, Tim Bray, Domenico Catalano, George Fletcher, Torsten Lodderstedt, Eve Maler, Nov Matake, Thomas Hardjono, Nat Sakimura, and Christian Scholz.
[[ to be removed by the RFC editor before publication as an RFC ]]
-10
-09
-08
-07
-06
-05
-04
-03
-02
-01
-00