RFC 9101 | OAuth JAR | August 2021 |
Sakimura, et al. | Standards Track | [Page] |
The authorization request in OAuth 2.0 described in RFC 6749 utilizes query parameter serialization, which means that authorization request parameters are encoded in the URI of the request and sent through user agents such as web browsers. While it is easy to implement, it means that a) the communication through the user agents is not integrity protected and thus, the parameters can be tainted, b) the source of the communication is not authenticated, and c) the communication through the user agents can be monitored. Because of these weaknesses, several attacks to the protocol have now been put forward.¶
This document introduces the ability to send request parameters in a JSON Web Token (JWT) instead, which allows the request to be signed with JSON Web Signature (JWS) and encrypted with JSON Web Encryption (JWE) so that the integrity, source authentication, and confidentiality properties of the authorization request are attained. The request can be sent by value or by reference.¶
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained athttps://www.rfc-editor.org/info/rfc9101.¶
Copyright (c) 2021 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 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.¶
The authorization request inOAuth 2.0 [RFC6749] utilizes query parameter serialization and is typically sent through user agents such as web browsers.¶
For example, the parametersresponse_type
,client_id
,state
, andredirect_uri
are encoded in the URI of the request:¶
GET /authorize?response_type=code&client_id=s6BhdRkqt3&state=xyz &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/1.1 Host: server.example.com¶
While it is easy to implement, the encoding in the URI does not allow application-layer security to be used to provide confidentiality and integrity protection. While TLS is used to offer communication security between the client and the user agent as well as the user agent and the authorization server, TLS sessions are terminated in the user agent. In addition, TLS sessions may be terminated prematurely at some middlebox (such as a load balancer).¶
As a result, the authorization request of[RFC6749] has shortcomings in that:¶
Due to these inherent weaknesses, several attacks against the protocol, such as redirection URI rewriting, have been identified.¶
The use of application-layer security mitigates these issues.¶
The use of application-layer security allows requests to be prepared by a trusted third party so that a client application cannot request more permissions than previously agreed upon.¶
Furthermore, passing the request by reference allows the reduction of over-the-wire overhead.¶
TheJWT [RFC7519] encoding has been chosen because of:¶
The parametersrequest
andrequest_uri
are introduced as additional authorization request parameters for theOAuth 2.0 [RFC6749] flows. Therequest
parameter is aJSON Web Token (JWT) [RFC7519] whose JWT Claims Set holds the JSON-encoded OAuth 2.0 authorization request parameters. Note that, in contrast to RFC 7519, the elements of the Claims Set are encoded OAuth request parameters[IANA.OAuth.Parameters], supplemented with only a few of the IANA-managed JSON Web Token Claims[IANA.JWT.Claims], in particular,iss
andaud
. The JWT in therequest
parameter is integrity protected and source authenticated using JWS.¶
TheJWT [RFC7519] can be passed to the authorization endpoint by reference, in which case the parameterrequest_uri
is used instead ofrequest
.¶
UsingJWT [RFC7519] as the request encoding instead of query parameters has several advantages:¶
There are a few cases where request by reference is useful, such as:¶
This capability is in use by OpenID Connect[OpenID.Core].¶
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.¶
For the purposes of this specification, the following terms and definitions apply in addition to what is defined inOAuth 2.0 Framework [RFC6749],JSON Web Signature [RFC7515], andJSON Web Encryption [RFC7516].¶
A Request Object is aJSON Web Token (JWT) [RFC7519] whose JWT Claims Set holds the JSON-encoded OAuth 2.0 authorization request parameters.¶
A Request Object URI is an absolute URI that references the set of parameters comprising an OAuth 2.0 authorization request. The content of the resource referenced by the URI is aRequest Object (Section 2.1), unless the URI was provided to the client by the same authorization server, in which case the content is an implementation detail at the discretion of the authorization server. The content being a Request Object is to ensure interoperability in cases where the provider of therequest_uri
is a separate entity from the consumer, such as when a client provides a URI referencing a Request Object stored on the client's backend service that is made accessible via HTTPS. In the latter case, where the authorization server is both provider and consumer of the URI, such as when it offers an endpoint that provides a URI in exchange for a Request Object, this interoperability concern does not apply.¶
The following abbreviations are common to this specification.¶
ARequest Object (Section 2.1) is used to provide authorization request parameters for an OAuth 2.0 authorization request. ItMUST contain all the parameters (including extension parameters) used to process theOAuth 2.0 [RFC6749] authorization request except therequest
andrequest_uri
parameters that are defined in this document. The parameters are represented as the JWT Claims of the object. Parameter names and string valuesMUST be included as JSON strings. Since Request Objects are handled across domains and potentially outside of a closed ecosystem, perSection 8.1 of [RFC8259], these JSON stringsMUST be encoded using UTF-8[RFC3629]. Numerical valuesMUST be included as JSON numbers. The Request ObjectMAY include any extension parameters. ThisJSON [RFC8259] object constitutes the JWT Claims Set defined inJWT [RFC7519]. The JWT Claims Set is then signed or signed and encrypted.¶
To sign,JSON Web Signature (JWS) [RFC7515] is used. The result is a JWS-signedJWT [RFC7519]. If signed, the Authorization Request ObjectSHOULD contain the Claimsiss
(issuer) andaud
(audience) as members with their semantics being the same as defined in theJWT [RFC7519] specification. The value ofaud
should be the value of the authorization server (AS)issuer
, as defined inRFC 8414 [RFC8414].¶
To encrypt,JWE [RFC7516] is used. When both signature and encryption are being applied, the JWTMUST be signed, then encrypted, as described inSection 11.2 of [RFC7519]. The result is a Nested JWT, as defined in[RFC7519].¶
The client determines the algorithms used to sign and encrypt Request Objects. The algorithms chosen need to be supported by both the client and the authorization server. The client can inform the authorization server of the algorithms that it supports in its dynamic client registration metadata[RFC7591], specifically, the metadata valuesrequest_object_signing_alg
,request_object_encryption_alg
, andrequest_object_encryption_enc
. Likewise, the authorization server can inform the client of the algorithms that it supports in its authorization server metadata[RFC8414], specifically, the metadata valuesrequest_object_signing_alg_values_supported
,request_object_encryption_alg_values_supported
, andrequest_object_encryption_enc_values_supported
.¶
The Request ObjectMAY be sent by value, as described inSection 5.1, or by reference, as described inSection 5.2.request
andrequest_uri
parametersMUST NOT be included in Request Objects.¶
ARequest Object (Section 2.1) has the media type[RFC2046]application/oauth-authz-req+jwt
. Note that some existing deployments may alternatively be using the typeapplication/jwt
.¶
The following is an example of the Claims in a Request Object before base64url[RFC7515] encoding and signing. Note that it includes the extension parametersnonce
andmax_age
.¶
{ "iss": "s6BhdRkqt3", "aud": "https://server.example.com", "response_type": "code id_token", "client_id": "s6BhdRkqt3", "redirect_uri": "https://client.example.org/cb", "scope": "openid", "state": "af0ifjsldkj", "nonce": "n-0S6_WzA2Mj", "max_age": 86400 }¶
Signing it with theRS256
algorithm[RFC7518] results in this Request Object value (with line wraps within values for display purposes only):¶
eyJhbGciOiJSUzI1NiIsImtpZCI6ImsyYmRjIn0.ewogICAgImlzcyI6ICJzNkJoZF JrcXQzIiwKICAgICJhdWQiOiAiaHR0cHM6Ly9zZXJ2ZXIuZXhhbXBsZS5jb20iLAog ICAgInJlc3BvbnNlX3R5cGUiOiAiY29kZSBpZF90b2tlbiIsCiAgICAiY2xpZW50X2 lkIjogInM2QmhkUmtxdDMiLAogICAgInJlZGlyZWN0X3VyaSI6ICJodHRwczovL2Ns aWVudC5leGFtcGxlLm9yZy9jYiIsCiAgICAic2NvcGUiOiAib3BlbmlkIiwKICAgIC JzdGF0ZSI6ICJhZjBpZmpzbGRraiIsCiAgICAibm9uY2UiOiAibi0wUzZfV3pBMk1q IiwKICAgICJtYXhfYWdlIjogODY0MDAKfQ.Nsxa_18VUElVaPjqW_ToI1yrEJ67BgK b5xsuZRVqzGkfKrOIX7BCx0biSxYGmjK9KJPctH1OC0iQJwXu5YVY-vnW0_PLJb1C2 HG-ztVzcnKZC2gE4i0vgQcpkUOCpW3SEYXnyWnKzuKzqSb1wAZALo5f89B_p6QA6j6 JwBSRvdVsDPdulW8lKxGTbH82czCaQ50rLAg3EYLYaCb4ik4I1zGXE4fvim9FIMs8O CMmzwIB5S-ujFfzwFjoyuPEV4hJnoVUmXR_W9typPf846lGwA8h9G9oNTIuX8Ft2jf pnZdFmLg3_wr3Wa5q3a-lfbgF3S9H_8nN3j1i7tLR_5Nz-g¶
The following RSA public key, represented in JSON Web Key (JWK) format, can be used to validate the Request Object signature in this and subsequent Request Object examples (with line wraps within values for display purposes only):¶
{ "kty":"RSA", "kid":"k2bdc", "n":"x5RbkAZkmpRxia65qRQ1wwSMSxQUnS7gcpVTV_cdHmfmG2ltd2yabEO9XadD8 pJNZubINPpmgHh3J1aD9WRwS05ucmFq3CfFsluLt13_7oX5yDRSKX7poXmT_5 ko8k4NJZPMAO8fPToDTH7kHYbONSE2FYa5GZ60CUsFhSonI-dcMDJ0Ary9lxI w5k2z4TAdARVWcS7sD07VhlMMshrwsPHBQgTatlkxyIHXbYdtak8fqvNAwr7O lVEvM_Ipf5OfmdB8Sd-wjzaBsyP4VhJKoi_qdgSzpC694XZeYPq45Sw-q51iF UlcOlTCI7z6jltUtnR6ySn6XDGFnzH5Fe5ypw", "e":"AQAB" }¶
The client constructs the authorization request URI by adding the following parameters to the query component of the authorization endpoint URI using theapplication/x-www-form-urlencoded
format:¶
request_uri
is specified. TheRequest Object (Section 2.1) that holds authorization request parameters stated inSection 4 of [RFC6749] (OAuth 2.0). If this parameter is present in the authorization request,request_uri
MUST NOT be present.¶request
is specified. The absolute URI, as defined byRFC 3986 [RFC3986], that is theRequest Object URI (Section 2.2) referencing the authorization request parameters stated inSection 4 of [RFC6749] (OAuth 2.0). If this parameter is present in the authorization request,request
MUST NOT be present.¶client_id
. The valueMUST match therequest
orrequest_uri
Request Object's (Section 2.1)client_id
.¶The client directs the resource owner to the constructed URI using an HTTP redirection response or by other means available to it via the user agent.¶
For example, the client directs the end user's user agent to make the following HTTPS request:¶
GET /authz?client_id=s6BhdRkqt3&request=eyJhbG..AlMGzw HTTP/1.1Host: server.example.com¶
The value for the request parameter is abbreviated for brevity.¶
The Authorization Request ObjectMUST be one of the following:¶
The clientMAY send the parameters included in the Request Object duplicated in the query parameters as well for backward compatibility, etc. However, the authorization server supporting this specificationMUST only use the parameters included in the Request Object.¶
The client sends the authorization request as a Request Object to the authorization endpoint as therequest
parameter value.¶
The following is an example of an authorization request using therequest
parameter (with line wraps within values for display purposes only):¶
https://server.example.com/authorize?client_id=s6BhdRkqt3& request=eyJhbGciOiJSUzI1NiIsImtpZCI6ImsyYmRjIn0.ewogICAgImlzcyI6 ICJzNkJoZFJrcXQzIiwKICAgICJhdWQiOiAiaHR0cHM6Ly9zZXJ2ZXIuZXhhbXBs ZS5jb20iLAogICAgInJlc3BvbnNlX3R5cGUiOiAiY29kZSBpZF90b2tlbiIsCiAg ICAiY2xpZW50X2lkIjogInM2QmhkUmtxdDMiLAogICAgInJlZGlyZWN0X3VyaSI6 ICJodHRwczovL2NsaWVudC5leGFtcGxlLm9yZy9jYiIsCiAgICAic2NvcGUiOiAi b3BlbmlkIiwKICAgICJzdGF0ZSI6ICJhZjBpZmpzbGRraiIsCiAgICAibm9uY2Ui OiAibi0wUzZfV3pBMk1qIiwKICAgICJtYXhfYWdlIjogODY0MDAKfQ.Nsxa_18VU ElVaPjqW_ToI1yrEJ67BgKb5xsuZRVqzGkfKrOIX7BCx0biSxYGmjK9KJPctH1OC 0iQJwXu5YVY-vnW0_PLJb1C2HG-ztVzcnKZC2gE4i0vgQcpkUOCpW3SEYXnyWnKz uKzqSb1wAZALo5f89B_p6QA6j6JwBSRvdVsDPdulW8lKxGTbH82czCaQ50rLAg3E YLYaCb4ik4I1zGXE4fvim9FIMs8OCMmzwIB5S-ujFfzwFjoyuPEV4hJnoVUmXR_W 9typPf846lGwA8h9G9oNTIuX8Ft2jfpnZdFmLg3_wr3Wa5q3a-lfbgF3S9H_8nN3 j1i7tLR_5Nz-g¶
Therequest_uri
authorization request parameter enables OAuth authorization requests to be passed by reference rather than by value. This parameter is used identically to therequest
parameter, except that the Request Object value is retrieved from the resource identified by the specified URI rather than passed by value.¶
The entire Request URISHOULD NOT exceed 512 ASCII characters. There are two reasons for this restriction:¶
The contents of the resource referenced by therequest_uri
MUST be a Request Object andMUST be reachable by the authorization server unless the URI was provided to the client by the authorization server. In the first case, therequest_uri
MUST be anhttps
URI, as specified inSection 2.7.2 of [RFC7230]. In the second case, itMUST be a URN, as specified in[RFC8141].¶
The following is an example of the contents of a Request Object resource that can be referenced by arequest_uri
(with line wraps within values for display purposes only):¶
eyJhbGciOiJSUzI1NiIsImtpZCI6ImsyYmRjIn0.ewogICAgImlzcyI6ICJzNkJoZF JrcXQzIiwKICAgICJhdWQiOiAiaHR0cHM6Ly9zZXJ2ZXIuZXhhbXBsZS5jb20iLAog ICAgInJlc3BvbnNlX3R5cGUiOiAiY29kZSBpZF90b2tlbiIsCiAgICAiY2xpZW50X2 lkIjogInM2QmhkUmtxdDMiLAogICAgInJlZGlyZWN0X3VyaSI6ICJodHRwczovL2Ns aWVudC5leGFtcGxlLm9yZy9jYiIsCiAgICAic2NvcGUiOiAib3BlbmlkIiwKICAgIC JzdGF0ZSI6ICJhZjBpZmpzbGRraiIsCiAgICAibm9uY2UiOiAibi0wUzZfV3pBMk1q IiwKICAgICJtYXhfYWdlIjogODY0MDAKfQ.Nsxa_18VUElVaPjqW_ToI1yrEJ67BgK b5xsuZRVqzGkfKrOIX7BCx0biSxYGmjK9KJPctH1OC0iQJwXu5YVY-vnW0_PLJb1C2 HG-ztVzcnKZC2gE4i0vgQcpkUOCpW3SEYXnyWnKzuKzqSb1wAZALo5f89B_p6QA6j6 JwBSRvdVsDPdulW8lKxGTbH82czCaQ50rLAg3EYLYaCb4ik4I1zGXE4fvim9FIMs8O CMmzwIB5S-ujFfzwFjoyuPEV4hJnoVUmXR_W9typPf846lGwA8h9G9oNTIuX8Ft2jf pnZdFmLg3_wr3Wa5q3a-lfbgF3S9H_8nN3j1i7tLR_5Nz-g¶
The client stores the Request Object resource either locally or remotely at a URI the authorization server can access. Such a facility may be provided by the authorization server or a trusted third party. For example, the authorization server may provide a URL to which the client POSTs the Request Object and obtains the Request URI. This URI is the Request Object URI,request_uri
.¶
It is possible for the Request Object to include values that are to be revealed only to the authorization server. As such, therequest_uri
MUST have appropriate entropy for its lifetime so that the URI is not guessable if publicly retrievable. For the guidance, refer toSection 5.1.4.2.2 of [RFC6819] and "Good Practices for Capability URLs"[CapURLs]. It isRECOMMENDED that therequest_uri
be removed after a reasonable timeout unless access control measures are taken.¶
The following is an example of a Request Object URI value (with line wraps within values for display purposes only). In this example, a trusted third-party service hosts the Request Object.¶
https://tfp.example.org/request.jwt/ GkurKxf5T0Y-mnPFCHqWOMiZi4VS138cQO_V7PZHAdM¶
The client sends the authorization request to the authorization endpoint.¶
The following is an example of an authorization request using therequest_uri
parameter (with line wraps within values for display purposes only):¶
https://server.example.com/authorize? client_id=s6BhdRkqt3 &request_uri=https%3A%2F%2Ftfp.example.org%2Frequest.jwt %2FGkurKxf5T0Y-mnPFCHqWOMiZi4VS138cQO_V7PZHAdM¶
Upon receipt of the Request, the authorization serverMUST send an HTTPGET
request to therequest_uri
to retrieve the referenced Request Object unless the Request Object is stored in a way so that the server can retrieve it through other mechanisms securely and parse it to recreate the authorization request parameters.¶
The following is an example of this fetch process. In this example, a trusted third-party service hosts the Request Object.¶
GET /request.jwt/GkurKxf5T0Y-mnPFCHqWOMiZi4VS138cQO_V7PZHAdM HTTP/1.1Host: tfp.example.org¶
The following is an example of the fetch response:¶
HTTP/1.1 200 OK Date: Thu, 20 Aug 2020 23:52:39 GMT Server: Apache/2.4.43 (tfp.example.org) Content-type: application/oauth-authz-req+jwt Content-Length: 797 Last-Modified: Wed, 19 Aug 2020 23:52:32 GMT eyJhbGciOiJSUzI1NiIsImtpZCI6ImsyYmRjIn0.ewogICAgImlzcyI6ICJzNkJoZF JrcXQzIiwKICAgICJhdWQiOiAiaHR0cHM6Ly9zZXJ2ZXIuZXhhbXBsZS5jb20iLAog ICAgInJlc3BvbnNlX3R5cGUiOiAiY29kZSBpZF90b2tlbiIsCiAgICAiY2xpZW50X2 lkIjogInM2QmhkUmtxdDMiLAogICAgInJlZGlyZWN0X3VyaSI6ICJodHRwczovL2Ns aWVudC5leGFtcGxlLm9yZy9jYiIsCiAgICAic2NvcGUiOiAib3BlbmlkIiwKICAgIC JzdGF0ZSI6ICJhZjBpZmpzbGRraiIsCiAgICAibm9uY2UiOiAibi0wUzZfV3pBMk1q IiwKICAgICJtYXhfYWdlIjogODY0MDAKfQ.Nsxa_18VUElVaPjqW_ToI1yrEJ67BgK b5xsuZRVqzGkfKrOIX7BCx0biSxYGmjK9KJPctH1OC0iQJwXu5YVY-vnW0_PLJb1C2 HG-ztVzcnKZC2gE4i0vgQcpkUOCpW3SEYXnyWnKzuKzqSb1wAZALo5f89B_p6QA6j6 JwBSRvdVsDPdulW8lKxGTbH82czCaQ50rLAg3EYLYaCb4ik4I1zGXE4fvim9FIMs8O CMmzwIB5S-ujFfzwFjoyuPEV4hJnoVUmXR_W9typPf846lGwA8h9G9oNTIuX8Ft2jf pnZdFmLg3_wr3Wa5q3a-lfbgF3S9H_8nN3j1i7tLR_5Nz-g¶
If the Request Object is encrypted, the authorization serverMUST decrypt the JWT in accordance with theJSON Web Encryption [RFC7516] specification.¶
The result is a signed Request Object.¶
If decryption fails, the authorization serverMUST return aninvalid_request_object
error to the client in response to the authorization request.¶
The authorization serverMUST validate the signature of the JWS-signed[RFC7515] Request Object. If akid
Header Parameter is present, the key identifiedMUST be the key used andMUST be a key associated with the client. The signatureMUST be validated using a key associated with the client and the algorithm specified in thealg
Header Parameter. Algorithm verificationMUST be performed, as specified in Sections3.1 and3.2 of[RFC8725].¶
If the key is not associated with the client or if signature validation fails, the authorization serverMUST return aninvalid_request_object
error to the client in response to the authorization request.¶
The authorization serverMUST extract the set of authorization request parameters from the Request Object value. The authorization serverMUST only use the parameters in the Request Object, even if the same parameter is provided in the query parameter. The client ID values in theclient_id
request parameter and in the Request Objectclient_id
claimMUST be identical. The authorization server then validates the request, as specified inOAuth 2.0 [RFC6749].¶
If the Client ID check or the request validation fails, then the authorization serverMUST return an error to the client in response to the authorization request, as specified inSection 5.2 of [RFC6749] (OAuth 2.0).¶
The authorization server response is created and sent to the client as inSection 4 of [RFC6749] (OAuth 2.0).¶
In addition, this document uses these additional error values:¶
request_uri
in the authorization request returns an error or contains invalid data.¶request
parameter.¶request_uri
parameter.¶Client implementations supporting the Request Object URI methodMUST support TLS, following"Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)" [RFC7525].¶
To protect against information disclosure and tampering, confidentiality protectionMUST be applied using TLS with a cipher suite that provides confidentiality and integrity protection.¶
HTTP clientsMUST also verify the TLS server certificate, using DNS-ID[RFC6125], to avoid man-in-the-middle attacks. The rules and guidelines defined in[RFC6125] apply here, with the following considerations:¶
*
.¶Since the Request Object is a JWT, the core JWT claims cannot be used for any purpose in the Request Object other than for what JWT dictates. Thus, they have been registered as OAuth authorization request parameters to avoid future OAuth extensions using them with different meanings.¶
This specification adds the following values to the "OAuth Parameters" registry[IANA.OAuth.Parameters] established by[RFC6749].¶
iss
¶sub
¶aud
¶exp
¶nbf
¶This specification adds the following value to the "OAuth Authorization Server Metadata" registry[IANA.OAuth.Parameters] established by[RFC8414].¶
require_signed_request_object
¶request
orrequest_uri parameter
.¶This specification adds the following value to the "OAuth Dynamic Client Registration Metadata" registry[IANA.OAuth.Parameters] established by[RFC7591].¶
require_signed_request_object
¶request
orrequest_uri parameter
.¶ This section registers theapplication/oauth-authz-req+jwt
media type[RFC2046] in the "Media Types" registry[IANA.MediaTypes] in the manner described in[RFC6838]. It can be used to indicate that the content is a JWT containing Request Object claims.¶
.
) characters.¶In addition to all thesecurity considerations discussed in OAuth 2.0 [RFC6819], the security considerations in[RFC7515],[RFC7516],[RFC7518], and[RFC8725] need to be considered. Also, there are several academic papers such as[BASIN] that provide useful insight into the security properties of protocols like OAuth.¶
In consideration of the above, this document advises taking the following security considerations into account.¶
When sending the Authorization Request Object through therequest
parameter, itMUST be either signed usingJWS [RFC7515] or signed and then encrypted usingJWS [RFC7515] andJWE [RFC7516], respectively, with algorithms considered appropriate at the time.¶
The source of the authorization requestMUST always be verified. There are several ways to do it:¶
Although this specification does not require them, research such as[BASIN] points out that it is a good practice to explicitly state the intended interaction endpoints and the message position in the sequence in a tamper-evident manner so that the intent of the initiator is unambiguous. It isRECOMMENDED by this specification to use this practice for the following endpoints defined in[RFC6749],[RFC6750], and[RFC8414]:¶
protected_resources
)¶authorization_endpoint
)¶redirect_uri
)¶token_endpoint
)¶Further, if dynamic discovery is used, then this practice also applies to the discovery-related endpoints.¶
In[RFC6749], while the redirection URI is included in the authorization request, others are not. As a result, the same applies to the Authorization Request Object.¶
The introduction ofrequest_uri
introduces several attack possibilities. Consult the security considerations inSection 7 of [RFC3986] for more information regarding risks associated with URIs.¶
A set of malicious clients can launch a DoS attack to the authorization server by pointing therequest_uri
to a URI that returns extremely large content or is extremely slow to respond. Under such an attack, the server may use up its resource and start failing.¶
Similarly, a malicious client can specify arequest_uri
value that itself points to an authorization request URI that usesrequest_uri
to cause the recursive lookup.¶
To prevent such an attack from succeeding, the server should a) check that the value of therequest_uri
parameter does not point to an unexpected location, b) check that the media type of the response isapplication/oauth-authz-req+jwt
, c) implement a timeout for obtaining the content ofrequest_uri
, and d) not perform recursive GET on therequest_uri
.¶
The value ofrequest_uri
is not signed; thus, it can be tampered with by a man-in-the-browser attacker. Several attack possibilities arise because of this. For example, a) an attacker may create another file that the rewritten URI points to, making it possible to request extra scope, or b) an attacker may launch a DoS attack on a victim site by setting the value ofrequest_uri
to be that of the victim.¶
To prevent such an attack from succeeding, the server should a) check that the value of therequest_uri
parameter does not point to an unexpected location, b) check that the media type of the response isapplication/oauth-authz-req+jwt
, and c) implement a timeout for obtaining the content ofrequest_uri
.¶
Unless the protocol used by the client and the server is locked down to use an OAuth JWT-Secured Authorization Request (JAR), it is possible for an attacker to use RFC 6749 requests to bypass all the protection provided by this specification.¶
To prevent this kind of attack, this specification defines new client metadata and server metadata values, both namedrequire_signed_request_object
, whose values are both booleans.¶
When the value of it as client metadata istrue
, then the serverMUST reject the authorization request from the client that does not conform to this specification. ItMUST also reject the request if the Request Object uses analg
value ofnone
when this server metadata value istrue
. If omitted, the default value isfalse
.¶
When the value of it as server metadata istrue
, then the serverMUST reject the authorization request from any client that does not conform to this specification. ItMUST also reject the request if the Request Object uses analg
value ofnone
. If omitted, the default value isfalse
.¶
Note that even ifrequire_signed_request_object
metadata values are not present, the clientMAY use signed Request Objects, provided that there are signing algorithms mutually supported by the client and the server. Use of signing algorithm metadata is described inSection 4.¶
Current security considerations can be found in "Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)"[RFC7525]. This supersedes the TLS version recommendations inOAuth 2.0 [RFC6749].¶
Given that OAuth parameter values are being sent in two different places, as normal OAuth parameters and as Request Object claims, implementations must guard against attacks that could use mismatching parameter values to obtain unintended outcomes. That is the reason that the two client ID valuesMUST match, the reason that only the parameter values from the Request Object are to be used, and the reason that neitherrequest
norrequest_uri
can appear in a Request Object.¶
As described inSection 2.8 of [RFC8725], attackers may attempt to use a JWT issued for one purpose in a context that it was not intended for. The mitigations described for these attacks can be applied to Request Objects.¶
One way that an attacker might attempt to repurpose a Request Object is to try to use it as a client authentication JWT, as described inSection 2.2 of [RFC7523]. A simple way to prevent this is to never use the client ID as thesub
value in a Request Object.¶
Another way to prevent cross-JWT confusion is to use explicit typing, as described inSection 3.11 of [RFC8725]. One would explicitly type a Request Object by including atyp
Header Parameter with the valueoauth-authz-req+jwt
(which is registered inSection 9.4.1). Note, however, that requiring explicitly typed Request Objects at existing authorization servers will break most existing deployments, as existing clients are already commonly using untyped Request Objects, especially with OpenID Connect[OpenID.Core]. However, requiring explicit typing would be a good idea for new OAuth deployment profiles where compatibility with existing deployments is not a consideration.¶
Finally, yet another way to prevent cross-JWT confusion is to use a key management regime in which keys used to sign Request Objects are identifiably distinct from those used for other purposes. Then, if an adversary attempts to repurpose the Request Object in another context, a key mismatch will occur, thwarting the attack.¶
When the client is being granted access to a protected resource containing personal data, both the client and the authorization server need to adhere to Privacy Principles. "Privacy Considerations for Internet Protocols"[RFC6973] gives excellent guidance on the enhancement of protocol design and implementation. The provisions listed in it should be followed.¶
Most of the provisions would apply to "The OAuth 2.0 Authorization Framework"[RFC6749] and "The OAuth 2.0 Authorization Framework: Bearer Token Usage"[RFC6750] and are not specific to this specification. In what follows, only the provisions specific to this specification are noted.¶
When the client is being granted access to a protected resource containing personal data, the clientSHOULD limit the collection of personal data to that which is within the bounds of applicable law and strictly necessary for the specified purpose(s).¶
It is often hard for the user to find out if the personal data asked for is strictly necessary. A trusted third-party service can help the user by examining the client request, comparing it to the proposed processing by the client, and certifying the request. After the certification, the client, when making an authorization request, can submit an authorization request to the trusted third-party service to obtain the Request Object URI. This process has two steps:¶
request_uri
.¶request_uri
. The trusted third-party service also verifies that the Request Object is consistent with the claims that the client is eligible for, per the prior step.¶ Upon receiving such a Request Object URI in the authorization request, the authorization server first verifies that the authority portion of the Request Object URI is a legitimate one for the trusted third-party service. Then, the authorization server issues an HTTP GET request to the Request Object URI. Upon connecting, the authorization serverMUST verify that the server identity represented in the TLS certificate is legitimate for the Request Object URI. Then, the authorization server can obtain the Request Object, which includes theclient_id
representing the client.¶
The Consent screenMUST indicate the client andSHOULD indicate that the request has been vetted by the trusted third-party service for the adherence to the collection limitation principle.¶
This specification allows extension parameters. These may include potentially sensitive information. Since URI query parameters may leak through various means but most notably through referrer and browser history, if the authorization request contains a potentially sensitive parameter, the clientSHOULD encrypt the Request Object usingJWE [RFC7516].¶
Where the Request Object URI method is being used, if the Request Object contains personally identifiable or sensitive information, therequest_uri
SHOULD be used only once and have a short validity period, and itMUST have sufficient entropy for the applicable security policies unless the Request Object itself is encrypted usingJWE [RFC7516]. The adequate shortness of the validity and the entropy of the Request Object URI depends on the risk calculation based on the value of the resource being protected. A general guidance for the validity time would be less than a minute, and the Request Object URI is to include a cryptographic random value of 128 bits or more at the time of the writing of this specification.¶
Even if the protected resource does not include personally identifiable information, it is sometimes possible to identify the user through the Request Object URI if persistent static per-user Request Object URIs are used. A third party may observe it through browser history, etc. and start correlating the user's activity using it. In a way, it is a data disclosure as well and should be avoided.¶
Therefore, per-user persistent Request Object URIs should be avoided. Single-use Request Object URIs are one alternative.¶
The following people contributed to the creation of this document in the OAuth Working Group and other IETF roles. (Affiliations at the time of the contribution are used.)¶
Annabelle Backman (Amazon),Dirk Balfanz (Google),Sergey Beryozkin,Ben Campbell (as AD),Brian Campbell (Ping Identity),Roman Danyliw (as AD),Martin Duke (as AD),Vladimir Dzhuvinov (Connect2id),Lars Eggert (as AD),Joel Halpern (as GENART),Benjamin Kaduk (as AD),Stephen Kent (as SECDIR),Murray Kucherawy (as AD),Warren Kumari (as OPSDIR),Watson Ladd (as SECDIR),Torsten Lodderstedt (yes.com),Jim Manico,James H. Manger (Telstra),Kathleen Moriarty (as AD),Axel Nennker (Deutsche Telecom),John Panzer (Google),Francesca Palombini (as AD),David Recordon (Facebook),Marius Scurtescu (Google),Luke Shepard (Facebook),Filip Skokan (Auth0),Hannes Tschofenig (ARM),Éric Vyncke (as AD), andRobert Wilton (as AD).¶
The following people contributed to creating this document through theOpenID Connect Core 1.0 [OpenID.Core].¶
Brian Campbell (Ping Identity),George Fletcher (AOL),Ryo Itou (Mixi),Edmund Jay (Illumila),Breno de Medeiros (Google),Hideki Nara (TACT), andJustin Richer (MITRE).¶