OAuth Response MetadataNomura Research Institutesakimura@gmail.comGREE, Inc.nov@matake.jphttp://matake.jpCA TechnologiesSascha.Preibisch@gmail.com
Security
OAuth Working GroupThis specification defines an extensible metadata that may be
inserted into the OAuth 2.0 responses to assist the clients to process
those responses. It is expressed either as a link header, or
query parameters. It will allow the
client to learn where the members in the response could be used,
what is the characteristics of the payload is, how it should be processed,
and so on.
Since they are just additional response header/query parameters,
any client that does not understand this
extension should not break and work normally while supporting clients
can utilize the metadata to take the advantage of the extension.Although OAuth 2.0 has been known for
its REST friendliness, OAuth itself is not RESTful, as it heavily relies
on out-of-band information to drive the interactions. This situation can
be eased by hypertext-enabling the endpoint responses through the
introduction of data structure that represents such hypertext and other
metadata. Hyper-text enabling the OAuth responses has many advantages.
For example, The protected resource can tell which authorization servers
it supports. Permissioned resource discovery:
It is possible to tell the client which resource endpoint
it should use. This has a privacy advantage.
The location of the resource by itself may be a sensitive
information as its location may reveal information about the
resource owner. Therefore, it may be sensible to tell the
location only after the user consent. It is possible to give a hint on the processing of the payload.It will be resitant to IdP Mix-up attack. It will be resitant to Code Phishing Attack.This specification defines methods to represent such metadata
in the authorization and token responses. 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 RFC 2119.This specification uses the terms "Access Token", "Authorization Code",
"Authorization Endpoint", "Authorization Grant", "Authorization Server",
"Client", "Client Authentication", "Protected Resource", "Refresh Token",
and "Token Endpoint" defined by OAuth 2.0 [RFC6749].Resource Endpoints that implement this specification returns
the following link relation (rel) and the corresonding URI value as
defined in in the response header.
The response header can be returned in response to
HEAD, GET, or POST request to the endpoint.
The URI of the corresponding authorization server's
discovery document, from which the client can learn
the server capabilities and endpoints.
The URI of the corresponding Authorization Endpoint URI.
A typical example of the use of these header values are
in the case of the Client accessing the protected resource
without a propoer credential. For example, in the case
of an protected resource, the unauthorized
access may result in a response header that includes both
WWW-Authenticate header as well as the Web Linking header
indicating either the Authorization Endpoint URI or
the discovery document URI.
There is no cardinality restriction on relations put in
place by . Therefore, the resource can respond with
multiple Authorization Endpoint URI or Discovery Document URIs
from which the Client may choose the appropriate one.
Token Endpoints that implements this specification returns the following
link relation (rel) and the corresponding URI value as defined in
in the Access Token Response defined in .
Resource URI. The value of this parameter is the URI of the Resource Endpoint
that the Access Token is supposed to be used at.
If this value is present, the client MUST NOT send the Access Token to any other URI.
Token Endpoint URI.
The value of this parameter is the URI of the Token Endpoint that the Refresh Token
can be sent to obtain a new Access Token.
If this value is present, then the client MUST NOT send the refresh token to any other places.
Any other rels that are registered in Link Relation Type Registry defined in
registry can be used.
There is no cardinality restriction on relations put in
place by . Therefore, the Token Endpoing can respond with
multiple Resource Endpoint URI or Discovery Document URIs
from which the Client may choose the appropriate one.
Following is an example of an HTTPS response.Authorization Endpoints that implements this specification returns the following
link relation (rel) and the corresponding URI value as defined in
in the response to the HEAD request. Token Endpoint URI.
The value of this parameter is the URI of the Token Endpoint that
the Authorization Code
can be sent to obtain the Access Token.
The URI of discovery document, from which the client can learn
the server capabilities and endpoints.
Resource URI. The value of this parameter is the URI of the Resource Endpoint
that the Access Token can be used at.
If this parameter is specified, the client MUST NOT send the Access Token to
any other URIs than the value of this parameter.
There is no cardinality restriction on relations put in
place by . Therefore, the Authorization Endpoint
can respond with
multiple Endpoint URIs with a same relation type
from which the Client may choose the appropriate one.
Following is an example of an HTTPS response.While defines a useful way of conveying link relations,
it cannot be utilized for a redirect based communication such as
the authorization response of OAuth 2.0. This section defines
a way to return a limited set of those link relations as query parameters
so that it can be conveyed over the redirection.
The authorization response of the implementation of this specification may return
the following query parameter in the redirect URI.Token Endpoint URI.
The value of this parameter is the URI of the Token Endpoint that
the Authorization Code
can be sent to obtain the Access Token.
If this parameter is specified,
the client MUST check that the value of turi matches exactly
with the pre-registered token endpoint URI of the Authorization Server
that the session recoverd from the state variable points to.
The client MUST NOT send the code to
any other URIs than the value of this parameter.
Resource URI. The value of this parameter is the URI of the Resource Endpoint
that the Access Token can be used at.
If this parameter is specified, the client MUST NOT send the Access Token to
any other URIs than the value of this parameter.
As long as the link relation type string does not collide with the underlying
protocol parameters, they can also be specified as a query parameter. The value MUST
be encoded in application/x-www-form-urlencoded.
The following is an example of such response. Line breaks are for display purposes only.Pursuant to , the following link type
registrations [[will be]] registered by mail to
link-relations@ietf.org.Relation Name: turiDescription: An OAuth 2.0 Token Endpoint specified in
section 3.2 of .Reference: This specificationRelation Name: ruriDescription: An OAuth 2.0 Resource Endpoint specified in
section 3.2 of .Reference: This specificationThe query response parameters may be tampered by the man-in-the-browser.
It can also be tampered by a malicious user.
In general, anything that comes via the browser/user-agent
can be tainted and untrusted. This specification mandates the turi check so that
tamparing of turi by the malicious user will be detected.
It does not mandate ruri check as the user can get the
Access Token and send it to anywhere he wants anyways
when it is returned to the browser.
However, other parameters are not protected.
The Client MUST treat them tainted and implement
its own check rules for each parameters.
To solve this "Tampering by bad user", either
HMAC(concat(params)) need to be sent with them
or have all of them inside the JWS.
Members of OAuth WG helped to form this specification. Notabely:
Hannes tschofenig, John Bradley, Justin Richer, Kaoru Maeda, Masashi Kurabayashi,
Michael B. Jones, Phil Hunt, William Dennis, James Manger,
(add yourselves).
-07Added note that there is no cardinality requirements so that
multiple endpoints can be returned by repeating a same rel. Added resource endpoint response.-06Removed duri description from token response as it is not needed.Made the processing instruction more precise. Added RFC5988 defined link relation type in the example. Swaped the order of the authorization response and token response.
Now, token response gets explained first so that the reader will grasp the
basic concept according to RFC5988 and regards the authorization response
extension as a mapping of RFC5988 into query parameter form.-05Factored out JSON Meta and now using query param and Web Linking.-04Date refresh.-03Date refresh.-02Added Mike Kelly as an author.xref fix.Introduced "operations" as in
draft-ietf-scim-api-00#section-3.5.Updated the informative reference to HAL.Added description to OAuth Token Endpoint hrefs.Added content-type to the example.Added Area and Working Group.-01Some format changes, reference fix, and typo fixes.Changed 'items' to 'elements' to match the JSON terminology.-00Initial DraftJSON Hypermedia API Languagemike@stateless.coLink Type Registrations for OAuth 2wmills_92105@yahoo.com