OAuth Working Group | M. Jones |
Internet-Draft | Microsoft |
Intended status: Standards Track | N. Sakimura |
Expires: July 31, 2016 | NRI |
J. Bradley | |
Ping Identity | |
January 28, 2016 |
OAuth 2.0 Discovery
draft-jones-oauth-discovery-01
This specification defines a mechanism for an OAuth 2.0 client to discover the resource owner's OAuth 2.0 authorization server and obtain information needed to interact with it, including its OAuth 2.0 endpoint locations and authorization server capabilities.
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 July 31, 2016.
Copyright (c) 2016 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.
This specification generalizes the discovery mechanisms defined by "OpenID Connect Discovery 1.0" [OpenID.Discovery] in a way that is compatible with OpenID Connect Discovery, while being applicable to a wider set of OAuth 2.0 use cases. This is intentionally parallel to the way that the "OAuth 2.0 Dynamic Client Registration Protocol" [RFC7591] specification generalized the dynamic client registration mechanisms defined by "OpenID Connect Dynamic Client Registration 1.0" [OpenID.Registration] in a way that was compatible with it.
In order for an OAuth client to utilize OAuth 2.0 services for a resource owner, the client needs to know where the OAuth 2.0 authorization server is. This specification uses WebFinger [RFC7033] to locate the authorization server for an resource owner. This process is described in Section 2.
Once the authorization server has been identified, the configuration information for that authorization server is retrieved from a well-known location as a JSON [RFC7159] document, including its OAuth 2.0 endpoint locations and authorization server capabilities. This process is described in Section 4.
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 RFC 2119 [RFC2119].
All uses of JSON Web Signature (JWS) [JWS] and JSON Web Encryption (JWE) [JWE] data structures in this specification utilize the JWS Compact Serialization or the JWE Compact Serialization; the JWS JSON Serialization and the JWE JSON Serialization are not used.
This specification uses the terms "Access Token", "Authorization Code", "Authorization Endpoint", "Authorization Grant", "Authorization Server", "Client", "Client Authentication", "Client Identifier", "Client Secret", "Grant Type", "Protected Resource", "Redirection URI", "Refresh Token", "Resource Owner", "Resource Server", "Response Type", and "Token Endpoint" defined by OAuth 2.0 [RFC6749], the terms "Claim Name", "Claim Value", and "JSON Web Token (JWT)" defined by JSON Web Token (JWT) [JWT], and the term "Response Mode" defined by OAuth 2.0 Multiple Response Type Encoding Practices [OAuth.Responses].
This specification also defines the following terms:
Authorization server WebFinger discovery is a means of determining the location of the authorization server's configuration information.
WebFinger discovery is OPTIONAL; if a client knows the authorization server's configuration information location through an out-of-band mechanism, it can skip this step and proceed to Section 4.
WebFinger discovery requires the following information to make a discovery request:
OAuth discovery uses the following rel value in WebFinger [RFC7033]:
Rel Type | URI |
---|---|
OAuth 2.0 Configuration Information Location URL | http://openid.net/specs/connect/1.0/issuer |
To start discovery of OAuth 2.0 configuration information, the resource owner supplies a URI to the client that can be used to discover the corresponding authorization server. In some cases, the client may know this URI without involvement of the resource owner. This URI might, for instance, be an e-mail address, an account identifier, a profile URL, or a service or tenant URL.
The host to which the WebFinger request will be made is obtained from the URI. The client then makes an HTTP GET request to the host's WebFinger [RFC7033] endpoint using the URI as the resource parameter value and the rel value http://openid.net/specs/connect/1.0/issuer to obtain the authorization server's configuration information location.
The configuration information location MUST be returned in the WebFinger response as the value of the href member of a links array element with rel member value http://openid.net/specs/connect/1.0/issuer. As described in Section 6, despite the identifier http://openid.net/specs/connect/1.0/issuer appearing to be OpenID-specific, its usage in this specification is actually referring to a general OAuth 2.0 feature that is not specific to OpenID Connect. (Per Section 7 of WebFinger [RFC7033], obtaining the WebFinger response may first involve following some redirects.)
The returned configuration information location MUST be a URI RFC 3986 [RFC3986] with a scheme component that MUST be https, a host component, and optionally, port and path components and no query or fragment components. Note that the WebFinger response can return a configuration information location value using a completely different scheme, host, port, and path from any contained in the input URI, and no relationship can be assumed between the input URI and the resulting configuration information location.
An example WebFinger discovery request follows. To find the authorization server's configuration information location for the account identified using the e-mail address syntax joe@example.com and corresponding account URI acct:joe@example.com, the WebFinger parameters are as follows:
WebFinger Parameter | Value |
---|---|
resource | acct:joe@example.com |
host | example.com |
rel | http://openid.net/specs/connect/1.0/issuer |
The client would make the following WebFinger request to discover the authorization server's configuration information location (with line wraps within lines for display purposes only):
GET /.well-known/webfinger ?resource=acct%3Ajoe%40example.com &rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer HTTP/1.1 Host: example.com HTTP/1.1 200 OK Content-Type: application/jrd+json { "subject": "acct:joe@example.com", "links": [ { "rel": "http://openid.net/specs/connect/1.0/issuer", "href": "https://server.example.com" } ] }
The discovered authorization server configuration information location is https://server.example.com.
Authorization servers can have metadata describing their configuration. These authorization server metadata values are used by this specification:
Additional authorization server metadata parameters MAY also be used. Some are defined by other specifications, such as OpenID Connect Discovery 1.0 [OpenID.Discovery].
Using the configuration information location discovered as described in Section 2 or by other means, the authorization server's configuration information can be retrieved.
Authorization servers supporting discovery MUST make a JSON document available at the path formed by concatenating the string /.well-known/openid-configuration to the configuration information location. The syntax and semantics of .well-known are defined in RFC 5785 [RFC5785] and apply to the configuration information location value when it contains no path component. openid-configuration MUST point to a JSON document compliant with this specification and MUST be returned using the application/json content type. As described in Section 6, despite the identifier /.well-known/openid-configuration, appearing to be OpenID-specific, its usage in this specification is actually referring to a general OAuth 2.0 feature that is not specific to OpenID Connect.
An authorization server configuration information document MUST be queried using an HTTP GET request at the previously specified path.
The client would make the following request to the configuration information location https://example.com to obtain its configuration information, since the configuration information location contains no path component:
GET /.well-known/openid-configuration HTTP/1.1 Host: example.com
If the configuration information location value contains a path component, any terminating / MUST be removed before appending /.well-known/openid-configuration. The client would make the following request to the configuration information location https://example.com/issuer1 to obtain its configuration information, since the configuration information location contains a path component:
GET /issuer1/.well-known/openid-configuration HTTP/1.1 Host: example.com
Using path components enables supporting multiple issuers per host. This is required in some multi-tenant hosting configurations. This use of .well-known is for supporting multiple issuers per host; unlike its use in RFC 5785 [RFC5785], it does not provide general information about the host.
The response is a set of claims about the authorization server's configuration, including all necessary endpoints and public key location information. A successful response MUST use the 200 OK HTTP status code and return a JSON object using the application/json content type that contains a set of claims as its members that are a subset of the metadata values defined in Section 3. Other claims MAY also be returned.
Claims that return multiple values are represented as JSON arrays. Claims with zero elements MUST be omitted from the response.
An error response uses the applicable HTTP status code value.
The following is a non-normative example response:
HTTP/1.1 200 OK Content-Type: application/json { "issuer": "https://server.example.com", "authorization_endpoint": "https://server.example.com/connect/authorize", "token_endpoint": "https://server.example.com/connect/token", "token_endpoint_auth_methods_supported": ["client_secret_basic", "private_key_jwt"], "token_endpoint_auth_signing_alg_values_supported": ["RS256", "ES256"], "userinfo_endpoint": "https://server.example.com/connect/userinfo", "jwks_uri": "https://server.example.com/jwks.json", "registration_endpoint": "https://server.example.com/connect/register", "scopes_supported": ["openid", "profile", "email", "address", "phone", "offline_access"], "response_types_supported": ["code", "code token"], "service_documentation": "http://server.example.com/connect/service_documentation.html", "ui_locales_supported": ["en-US", "en-GB", "en-CA", "fr-FR", "fr-CA"] }
If any of the validation procedures defined in this specification fail, any operations requiring the information that failed to correctly validate MUST be aborted and the information that failed to validate MUST NOT be used.
The issuer value returned MUST be identical to the configuration information location URL that was directly used to retrieve the configuration information.
Processing some OAuth 2.0 messages requires comparing values in the messages to known values. For example, the member names in the configuration information response might be compared to specific member names such as issuer. Comparing Unicode [UNICODE] strings, however, has significant security implications.
Therefore, comparisons between JSON strings and other Unicode strings MUST be performed as specified below:
The identifiers /.well-known/openid-configuration, http://openid.net/specs/connect/1.0/issuer, op_policy_uri, and op_tos_uri contain strings referring to the OpenID Connect [OpenID.Core] family of specifications that were originally defined by "OpenID Connect Discovery 1.0" [OpenID.Discovery]. Despite the reuse of these identifiers that appear to be OpenID-specific, their usage in this specification is actually referring to general OAuth 2.0 features that are not specific to OpenID Connect.
Implementations MUST support TLS. Which version(s) ought to be implemented will vary over time, and depend on the widespread deployment and known security vulnerabilities at the time of implementation. The authorization server MUST support TLS version 1.2 [RFC5246] and MAY support additional transport-layer security mechanisms meeting its security requirements. When using TLS, the client MUST perform a TLS/SSL server certificate check, per RFC 6125 [RFC6125]. Implementation security considerations can be found in Recommendations for Secure Use of TLS and DTLS [BCP195].
To protect against information disclosure and tampering, confidentiality protection MUST be applied using TLS with a ciphersuite that provides confidentiality and integrity protection.
TLS certificate checking MUST be performed by the client, as described in Section 7.1, when making an authorization server configuration information request. Checking that the server certificate is valid for the configuration information location URL prevents man-in-middle and DNS-based attacks. These attacks could cause a client to be tricked into using an attacker's keys and endpoints, which would enable impersonation of the legitimate authorization server. If an attacker can accomplish this, they can access the resources that the affected client has access to using the authorization server that they are impersonating.
An attacker may also attempt to impersonate an authorization server by publishing a discovery document that contains an issuer claim using the configuration information location URL of the authorization server being impersonated, but with its own endpoints and signing keys. This would enable it to impersonate that authorization server, if accepted by the client. To prevent this, RPs MUST ensure that the configuration information location URL they are using for the configuration information request exactly matches the value of the issuer metadata value in the authorization server configuration information document received by the client.
The following registration procedure is used for the registry established by this specification.
Values are registered on a Specification Required [RFC5226] basis 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 Experts may approve registration once they are satisfied that such a specification will be published.
Registration requests sent to the mailing list for review should use an appropriate subject (e.g., "Request to register OAuth Discovery Metadata: example").
Within the review period, the Designated Experts 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. Registration requests that are undetermined for a period longer than 21 days can be brought to the IESG's attention (using the iesg@ietf.org mailing list) for resolution.
Criteria that should be applied by the Designated Experts includes determining whether the proposed registration duplicates existing functionality, determining whether it is likely to be of general applicability or whether it is useful only for a single application, and whether the registration makes sense.
IANA must only accept registry updates from the Designated Experts and should direct all requests for registration to the review mailing list.
It is suggested that multiple Designated Experts be appointed who are able to represent the perspectives of different applications using this specification, in order to enable broadly-informed review of registration decisions. In cases where a registration decision could be perceived as creating a conflict of interest for a particular Expert, that Expert should defer to the judgment of the other Experts.
This specification establishes the IANA "OAuth Discovery Metadata" registry for OAuth 2.0 authorization server metadata names. The registry records the authorization server metadata member and a reference to the specification that defines it.
This specification adds to the instructions for the Designated Experts of the following IANA registries, both of which are in the "OAuth Parameters" registry [IANA.OAuth.Parameters]:
IANA has added a link to this specification in the Reference sections of these registries. [[ RFC Editor: The above sentence is written in the past tense as it would appear in the final specification, even though these links won't actually be created until after the IESG has requested publication of the specification. Please delete this note after the links are in place. ]]
For these registries, the designated experts must reject registration requests in one registry for values already occurring in the other registry. This is necessary because the introspection_endpoint_auth_methods_supported parameter allows for the use of values from either registry. That way, because the values in the two registries will continue to be mutually exclusive, no ambiguities will arise.
[OpenID.Core] | Sakimura, N., Bradley, J., Jones, M., de Medeiros, B. and C. Mortimore, "OpenID Connect Core 1.0", November 2014. |
[OpenID.Discovery] | Sakimura, N., Bradley, J., Jones, M. and E. Jay, "OpenID Connect Discovery 1.0", November 2014. |
[OpenID.Registration] | Sakimura, N., Bradley, J. and M. Jones, "OpenID Connect Dynamic Client Registration 1.0", November 2014. |
This specification is based on the OpenID Connect Discovery 1.0 specification, which was produced by the OpenID Connect working group of the OpenID Foundation.
[[ to be removed by the RFC Editor before publication as an RFC ]]
-01
-00