draft-ietf-oauth-v2-http-mac-02.txt   draft-ietf-oauth-v2-http-mac-03.txt 
OAuth J. Richer, Ed. Network Working Group Richer
Internet-Draft The MITRE Corporation Internet-Draft The MITRE Corporation
Intended status: Standards Track W. Mills, Ed. Intended status: Standards Track W. Mills
Expires: May 30, 2013 Yahoo! Inc. Expires: August 29, 2013 Yahoo! Inc.
H. Tschofenig, Ed. H. Tschofenig, Ed.
Nokia Siemens Networks Nokia Siemens Networks
November 28, 2012 February 25, 2013
OAuth 2.0 Message Authentication Code (MAC) Tokens OAuth 2.0 Message Authentication Code (MAC) Tokens
draft-ietf-oauth-v2-http-mac-02 draft-ietf-oauth-v2-http-mac-03
Abstract Abstract
This document specifies the HTTP MAC access authentication scheme, an This specification describes how to use MAC Tokens in HTTP requests
HTTP authentication method using a message authentication code (MAC) to access OAuth 2.0 protected resources. An OAuth client willing to
algorithm to provide cryptographic verification of portions of HTTP access a protected resource needs to demonstrate possession of a
requests. The document also defines an OAuth 2.0 binding for use as crytographic key by using it with a keyed message digest function to
an access token type. the request.
NOTE: This document (and other OAuth 2.0 security documents, such as The document also defines a key distribution protocol for obtaining a
[I-D.tschofenig-oauth-hotk]) are still work in progress in the OAuth fresh session key.
working group. As such, the content of this document may change.
For a discussion about security requirements please consult [I-D
.tschofenig-oauth-security]. Your input on the detailed security
requirements is highly appreciated.
Status of this Memo Status of this Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on May 30, 2013. This Internet-Draft will expire on August 29, 2013.
Copyright Notice Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the Copyright (c) 2013 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (http://trustee.ietf.org/ Provisions Relating to IETF Documents
license-info) in effect on the date of publication of this document. (http://trustee.ietf.org/license-info) in effect on the date of
Please review these documents carefully, as they describe your rights publication of this document. Please review these documents
and restrictions with respect to this document. Code Components carefully, as they describe your rights and restrictions with respect
extracted from this document must include Simplified BSD License text to this document. Code Components extracted from this document must
as described in Section 4.e of the Trust Legal Provisions and are include Simplified BSD License text as described in Section 4.e of
provided without warranty as described in the Simplified BSD License. the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. Example . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2. Notational Conventions . . . . . . . . . . . . . . . . . . 5 3. Architecture . . . . . . . . . . . . . . . . . . . . . . . . . 5
2. Issuing MAC Credentials . . . . . . . . . . . . . . . . . . . 5 4. Key Distribution . . . . . . . . . . . . . . . . . . . . . . . 7
3. Making Requests . . . . . . . . . . . . . . . . . . . . . . . 6 4.1. Session Key Transport to Client . . . . . . . . . . . . . 7
3.1. The "Authorization" Request Header . . . . . . . . . . . . 6 4.2. Session Key Transport to Resource Server . . . . . . . . . 9
3.2. Request MAC . . . . . . . . . . . . . . . . . . . . . . . 7 5. The Authenticator . . . . . . . . . . . . . . . . . . . . . . 10
3.2.1. Normalized Request String . . . . . . . . . . . . . . 7 5.1. The Authenticator . . . . . . . . . . . . . . . . . . . . 10
3.2.2. hmac-sha-1 . . . . . . . . . . . . . . . . . . . . . . 8 5.2. MAC Input String . . . . . . . . . . . . . . . . . . . . . 13
3.2.3. hmac-sha-256 . . . . . . . . . . . . . . . . . . . . . 9 5.3. Keyed Message Digest Algorithms . . . . . . . . . . . . . 14
4. Verifying Requests . . . . . . . . . . . . . . . . . . . . . . 9 5.3.1. hmac-sha-1 . . . . . . . . . . . . . . . . . . . . . . 14
4.1. Timestamp Verification . . . . . . . . . . . . . . . . . . 9 5.3.2. hmac-sha-256 . . . . . . . . . . . . . . . . . . . . . 14
4.2. The "WWW-Authenticate" Response Header Field . . . . . . . 10 6. Verifying the Authenticator . . . . . . . . . . . . . . . . . 15
5. Use with OAuth 2.0 . . . . . . . . . . . . . . . . . . . . . . 11 6.1. Timestamp Verification . . . . . . . . . . . . . . . . . . 15
5.1. Issuing MAC-Type Access Tokens . . . . . . . . . . . . . . 11 6.2. Error Handling . . . . . . . . . . . . . . . . . . . . . . 16
6. Security Considerations . . . . . . . . . . . . . . . . . . . 12 7. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.1. MAC Keys Transmission . . . . . . . . . . . . . . . . . . 12 8. Security Considerations . . . . . . . . . . . . . . . . . . . 17
6.2. Confidentiality of Requests . . . . . . . . . . . . . . . 12 8.1. Key Distribution . . . . . . . . . . . . . . . . . . . . . 17
6.3. Spoofing by Counterfeit Servers . . . . . . . . . . . . . 12 8.2. Offering Confidentiality Protection for Access to
6.4. Plaintext Storage of Credentials . . . . . . . . . . . . . 12 Protected Resources . . . . . . . . . . . . . . . . . . . 17
6.5. Entropy of MAC Keys . . . . . . . . . . . . . . . . . . . 13 8.3. Authentication of Resource Servers . . . . . . . . . . . . 18
6.6. Denial of Service / Resource Exhaustion Attacks . . . . . 13 8.4. Plaintext Storage of Credentials . . . . . . . . . . . . . 18
6.7. Timing Attacks . . . . . . . . . . . . . . . . . . . . . . 14 8.5. Entropy of Session Keys . . . . . . . . . . . . . . . . . 18
6.8. CSRF Attacks . . . . . . . . . . . . . . . . . . . . . . . 14 8.6. Denial of Service / Resource Exhaustion Attacks . . . . . 19
6.9. Coverage Limitations . . . . . . . . . . . . . . . . . . . 14 8.7. Timing Attacks . . . . . . . . . . . . . . . . . . . . . . 19
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 8.8. CSRF Attacks . . . . . . . . . . . . . . . . . . . . . . . 19
7.1. The HTTP MAC Authentication Scheme Algorithm Registry . . 15 8.9. Protecting HTTP Header Fields . . . . . . . . . . . . . . 20
7.1.1. Registration Template . . . . . . . . . . . . . . . . 15 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20
7.1.2. Initial Registry Contents . . . . . . . . . . . . . . 16 9.1. JSON Web Token Claims . . . . . . . . . . . . . . . . . . 20
7.2. OAuth Access Token Type Registration . . . . . . . . . . . 16 9.2. MAC Token Algorithm Registry . . . . . . . . . . . . . . . 20
7.2.1. The "mac" OAuth Access Token Type . . . . . . . . . . 16 9.2.1. Registration Template . . . . . . . . . . . . . . . . 21
7.3. OAuth Parameters Registration . . . . . . . . . . . . . . 17 9.2.2. Initial Registry Contents . . . . . . . . . . . . . . 21
7.3.1. The "mac_key" OAuth Parameter . . . . . . . . . . . . 17 9.3. OAuth Access Token Type Registration . . . . . . . . . . . 22
7.3.2. The "mac_algorithm" OAuth Parameter . . . . . . . . . 17 9.3.1. The "mac" OAuth Access Token Type . . . . . . . . . . 22
8. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 17 9.4. OAuth Parameters Registration . . . . . . . . . . . . . . 22
9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 17 9.4.1. The "mac_key" OAuth Parameter . . . . . . . . . . . . 22
10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 17 9.4.2. The "mac_algorithm" OAuth Parameter . . . . . . . . . 22
10.1. Normative References . . . . . . . . . . . . . . . . . . 17 9.4.3. The "kid" OAuth Parameter . . . . . . . . . . . . . . 23
10.2. Informative References . . . . . . . . . . . . . . . . . 18 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 23
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 19 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 23
11.1. Normative References . . . . . . . . . . . . . . . . . . . 23
11.2. Informative References . . . . . . . . . . . . . . . . . . 25
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 25
1. Introduction 1. Introduction
This specification defines the HTTP MAC access authentication scheme,
providing a method for making authenticated HTTP requests with
partial cryptographic verification of the request, covering the HTTP
method, request URI, and host.
Similar to the HTTP Basic access authentication scheme [RFC2617], the This specification describes how to use MAC Tokens in HTTP requests
MAC scheme utilizes a set of client credentials which include an and responses to access protected resources via the OAuth 2.0
identifier and key. However, in contrast with the Basic scheme, the protocol [RFC6749]. An OAuth client willing to access a protected
key is never included in authenticated requests but is used to resource needs to demonstrate possession of a symmetric key by using
calculate the request MAC value which is included instead. it with a keyed message digest function to the request. The keyed
message digest function is computed over a flexible set of parameters
from the HTTP message.
The MAC scheme requires the establishment of a shared symmetric key The MAC Token mechanism requires the establishment of a shared
between the client and the server. This specification offers one symmetric key between the client and the resource server. This
such method for issuing a set of MAC credentials to the client using specification defines a three party key distribution protocol to
OAuth 2.0 in the form of a MAC-type access token. dynamically distribute this session key from the authorization server
to the client and the resource server.
The primary design goal of this mechanism is to simplify and improve The design goal for this mechanism is to support the requirements
HTTP authentication for services that are unwilling or unable to outlined in [I-D.tschofenig-oauth-security]. In particular, when a
employ TLS for every request. In particular, this mechanism leverage server uses this mechanism, a passive attacker will be unable to use
an initial TLS setup phase to establish a shared secret between the an eavesdropped access token exchanged between the client and the
client and the server. The shared secret is then used over an resource server. In addition, this mechanism helps secure the access
insecure channel to provide protection against a passive network token against leakage when sent over a secure channel to the wrong
attacker. resource server if the client provided information about the resource
server it wants to interact with in the request to the authorization
server.
In particular, when a server uses this mechanism, a passive network Since a keyed message digest only provides integrity protection and
attacker will be unable to "steal" the user's session token, as is data-origin authentication confidentiality protection can only be
possible today with cookies and other bearer tokens. In addition, added by the usage of Transport Layer Security (TLS). This
this mechanism helps secure the session token against leakage when specification provides a mechanism for channel binding is included to
sent over a secure channel to the wrong server. For example, when ensure that a TLS channel is not terminated prematurely and indeed
the client uses some form of dynamic configuration to determine where covers the entire end-to-end communication.
to send an authenticated request, or when the client fails to
properly validate the server's identity as part of its TLS handshake.
Unlike the HTTP Digest authentication scheme, this mechanism does not 2. Terminology
require interacting with the server to prevent replay attacks.
Instead, the client provides both a nonce and a timestamp, which the
server can use to prevent replay attacks using a bounded amount of
storage. Also unlike Digest, this mechanism is not intended to
protect the user's password itself because the client and server both
have access to the key material in the clear. Instead, servers
should issue a short-lived derivative credential for this mechanism
during the initial TLS setup phase.
1.1. Example The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT',
'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this
specification are to be interpreted as described in [RFC2119].
The client attempts to access a protected resource without This specification uses the Augmented Backus-Naur Form (ABNF)
authentication, making the following HTTP request to the resource notation of [I-D.ietf-httpbis-p1-messaging]. Additionally, the
server: following rules are included from [RFC2617]: auth-param.
GET /resource/1?b=1&a=2 HTTP/1.1 Session Key:
Host: example.com
The resource server returns the following authentication challenge: The terms mac key, session key, and symmetric key are used
interchangably and refer to the cryptographic keying material
established between the client and the resource server. This
temporary key used between the client and the resource server,
with a lifetime limited to the lifetime of the access token. This
session key is generated by the authorization server.
HTTP/1.1 401 Unauthorized Authenticator:
WWW-Authenticate: MAC
The client has previously obtained a set of MAC credentials for A record containing information that can be shown to have been
accessing resources on the "http://example.com/" server. The MAC recently generated using the session key known only by the client
credentials issued to the client include the following attributes: and the resource server.
MAC key identifier: h480djs93hd8 Message Authentication Code (MAC):
MAC key: 489dks293j39 Message authentication codes (MACs) are hash functions that take
two distinct inputs, a message and a secret key, and produce a
fixed-size output. The design goal is that it is
practically infeasible to produce the same output without
knowledge of the key. The terms keyed message digest functions
and MACs are used interchangably.
MAC algorithm: hmac-sha-1 3. Architecture
The client constructs the authentication header by calculating a The architecture of the proposal described in this document assumes
timestamp (e.g. the number of seconds since January 1, 1970 00:00:00 that the authorization server acts as a trusted third party that
GMT) and generating a random string used as a nonce: provides session keys to clients and to resource servers. These
session keys are used by the client and the resource server as input
to a MAC. In order to obtain the session key the client interacts
with the authorization server as part of the a normal grant exchange.
This is shown in an abstract way in Figure 1. Together with the
access token the authorization server returns a session key (in the
mac_key parameter) and several other parameters. The resource server
obtains the session key via the access token. Both of these two key
distribution steps are described in more detail in Section 4.
Timestamp: 1336363200 +---------------+
^| | AS-RS Key
// | Authorization |<*******
/ | Server | *
// | | *
/ | | *
(I) // /+---------------+ *
Access / // *
Token / / *
Request// // (II) Access Token *
/ / +Session Key (SK) *
// // *
/ v v
+-----------+ +------------+
| | | |
| | | Resource |
| Client | | Server |
| | | |
| | | |
+-----------+ +------------+
Nonce: dj83hs9s ****: Out-of-Band Long-Term Key Establishment
----: Dynamic Session Key Distribution
The client constructs the normalized request string (the new line Figure 1: Architecture: Interaction between the Client and the
separator character is represented by "\n" for display purposes only; Authorization Server.
the trailing new line separator signify that no extension value is
included with the request, explained below):
1336363200\n Once the client has obtained the necessary access token and the
dj83hs9s\n session key (including parameters) it can start to interact with the
GET\n resource server. To demonstrate possession of the session key it
/resource/1?b=1&a=2\n computes a MAC and adds various fields to the outgoing request
example.com\n message. We call this structure the "Authenticator". The server
80\n evaluates the request, includes an Authenticator and returns a
\n response back to the client. Since the access token is valid for a
period of time the resource server may decide to cache it so that it
does not need to be provided in every request from the client. This
interaction is shown in Figure 2.
The request MAC is calculated using the specified MAC algorithm +---------------+
"hmac-sha-1" and the MAC key over the normalized request string. The | |
result is base64-encoded to produce the request MAC: | Authorization |
| Server |
| |
| |
+---------------+
bhCQXTVyfj5cmA9uKkPFx1zeOXM= +-----------+ Authenticator (a) +------------+
| |---------------------->| |
| | [+Access Token] | Resource |
| Client | | Server |
| | Authenticator (b) | |
| |<----------------------| |
+-----------+ +------------+
The client includes the MAC key identifier, nonce, and request MAC ^ ^
with the request using the "Authorization" request header field: | |
| |
SK SK
+param +param
GET /resource/1?b=1&a=2 HTTP/1.1 Figure 2: Architecture: Interaction between the Client and the
Host: example.com Resource Server.
Authorization: MAC id="h480djs93hd8",
ts="1336363200",
nonce="dj83hs9s",
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
The server validates the request by calculating the request MAC again 4. Key Distribution
based on the request received and verifies the validity and scope of
the MAC credentials. If valid, the server responds with the
requested resource representation.
1.2. Notational Conventions For this scheme to function a session key must be available to the
client and the resource server, which is then used as a parameter in
the keyed message digest function. This document describes the key
distribution mechanism that uses the authorization server as a
trusted third party, which ensures that the session key is
transported from the authorization server to the client and the
resource server.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 4.1. Session Key Transport to Client
'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this
specification are to be interpreted as described in [RFC2119].
This specification uses the Augmented Backus-Naur Form (ABNF) Authorization servers issue MAC Tokens based on requests from
notation of [I-D.ietf-httpbis-p1-messaging]. Additionally, the clients. The request MUST include the audience parameter defined in
following rules are included from [RFC2617]: auth-param. [I-D.tschofenig-oauth-audience], which indicates the resource server
the client wants to interact with. This specification assumes use of
the 'Authorization Code' grant. If the request is processed
successfully by the authorization server it MUST return at least the
following parameters to the client:
2. Issuing MAC Credentials kid
This specification provides one method for issuing MAC credentials The name of the key (key id), which is an identifier generated
using OAuth 2.0 as described in Section 5. This specification does by the resource server. It is RECOMMENDED that the
not mandate servers to support any particular method for issuing MAC authorization server generates this key id by computing a hash
credentials, and other methods MAY be defined and used. Whenever MAC over the access_token, for example using SHA-1, and to encode
credentials are issued, the credentials MUST include the following it in a base64 format.
attributes:
MAC key identifier access_token
A string identifying the MAC key used to calculate the request
MAC. The string is usually opaque to the client. The server
typically assigns a specific scope and lifetime to each set of
MAC credentials. The identifier MAY denote a unique value used
to retrieve the authorization information (e.g. from a
database), or self-contain the authorization information in a
verifiable manner (i.e. a string consisting of some data and a
signature).
MAC key The OAuth 2.0 access token.
A shared symmetric secret used as the MAC algorithm key. The
server MUST NOT reissue a previously issued MAC key and MAC key
identifier combination.
MAC algorithm mac_key
A MAC algorithm used to calculate the request MAC. Value MUST
be one of "hmac-sha-1", "hmac-sha-256", or a registered
extension algorithm name as described in Section 7.1.
Algorithm names are case-sensitive. If the MAC algorithm is
not understood by the client, the client MUST NOT use the MAC
credentials and continue as if no MAC credentials were issued.
The MAC key identifier, MAC key, MAC algorithm strings MUST NOT The session key generated by the authorization server. Note
include characters other than: that the lifetime of the session key is equal to the lifetime
of the access token.
%x20-21 / %x23-5B / %x5D-7E mac_algorithm
; Any printable ASCII character except for <"> and <\>
3. Making Requests The MAC algorithm used to calculate the request MAC. The value
MUST be one of "hmac-sha-1", "hmac-sha-256", or a registered
extension algorithm name as described in Section 9.2. The
authorization server is assumed to know the set of algorithms
supported by the client and the resource server. It selects an
algorithm that meets the security policies and is supported by
both nodes.
To make authenticated requests, the client must be in the possession For example:
of a valid set of MAC credentials accepted by the server. The client
constructs the request by calculating a set of attributes, and adding
them to the HTTP request using the "Authorization" request header
field as described in Section 3.1.
3.1. The "Authorization" Request Header HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"access_token":
"eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDK0hTMjU2In0.
pwaFh7yJPivLjjPkzC-GeAyHuy7AinGcS51AZ7TXnwkC80Ow1aW47kcT_UV54ubo
nONbeArwOVuR7shveXnwPmucwrk_3OCcHrCbE1HR-Jfme2mF_WR3zUMcwqmU0RlH
kwx9txo_sKRasjlXc8RYP-evLCmT1XRXKjtY5l44Gnh0A84hGvVfMxMfCWXh38hi
2h8JMjQHGQ3mivVui5lbf-zzb3qXXxNO1ZYoWgs5tP1-T54QYc9Bi9wodFPWNPKB
kY-BgewG-Vmc59JqFeprk1O08qhKQeOGCWc0WPC_n_LIpGWH6spRm7KGuYdgDMkQ
bd4uuB0uPPLx_euVCdrVrA.
AxY8DCtDaGlsbGljb3RoZQ.
7MI2lRCaoyYx1HclVXkr8DhmDoikTmOp3IdEmm4qgBThFkqFqOs3ivXLJTku4M0f
laMAbGG_X6K8_B-0E-7ak-Olm_-_V03oBUUGTAc-F0A.
OwWNxnC-BMEie-GkFHzVWiNiaV3zUHf6fCOGTwbRckU",
"token_type":"mac",
"expires_in":3600,
"refresh_token":"8xLOxBtZp8",
"kid":"22BIjxU93h/IgwEb4zCRu5WF37s=",
"mac_key":"adijq39jdlaska9asud",
"mac_algorithm":"hmac-sha-256"
}
4.2. Session Key Transport to Resource Server
The transport of the mac_key from the authorization server to the
resource server is accomplished by conveying the encrypting mac_key
inside the access token. At the time of writing only one
standardized format for carrying the access token is defined: the
JSON Web Token (JWT) [I-D.ietf-oauth-json-web-token]. Note that the
header of the JSON Web Encryption (JWE) structure
[I-D.ietf-jose-json-web-encryption], which is a JWT with encrypted
content, MUST contain a key id (kid) in the header to allow the
resource server to select the appropriate keying material for
decryption. This keying material is a symmetric or an asymmetric
long-term key established between the resource server and the
authorization server, as shown in Figure 1 as AS-RS key. The
establishment of this long-term key is outside the scope of this
specification.
This document defines two new claims to be carried in the JWT:
mac_key, kid. These two parameters match the content of the mac_key
and the kid conveyed to the client, as shown in Section 4.1.
kid
The name of the key (key id), which is an identifier generated
by the resource server.
mac_key
The session key generated by the authorization server.
This example shows a JWT claim set without header and without
encryption:
{"iss":"authorization-server.example.com",
"exp":1300819380,
"kid":"22BIjxU93h/IgwEb4zCRu5WF37s=",
"mac_key":"adijq39jdlaska9asud",
"aud":"apps.example.com"
}
QUESTIONS: An alternative to the use of a JWT to convey the access
token with the encrypted mac_key is use the token introspect
[I-D.richer-oauth-introspection]. What mechanism should be
described? What should be mandatory to implement?
QUESTIONS: The above description assumes that the entire access
token is encrypted but it would be possible to only encrypt the
session key and to only apply integrity protection to other
fields. Is this desireable?
5. The Authenticator
To access a protected resource the client must be in the possession
of a valid set of session key provided by the authorization server.
The client constructs the authenticator, as described in Section 5.1.
5.1. The Authenticator
The client constructs the authenticator and adds the resulting fields
to the HTTP request using the "Authorization" request header field.
The "Authorization" request header field uses the framework defined The "Authorization" request header field uses the framework defined
by [RFC2617] as follows: by [RFC2617]. To include the authenticator in a subsequent response
from the authorization server to the client the WWW-Authenticate
header is used. For further exchanges a new, yet-to-be-defined
header will be used.
credentials = "MAC" 1*SP #params authenticator = "MAC" 1*SP #params
params = id / ts / nonce / ext / mac params = id / ts / seq-nr / access_token / mac / h / cb
id = "id" "=" string-value kid = "kid" "=" string-value
ts = "ts" "=" ( <"> timestamp <"> ) / timestamp ts = "ts" "=" ( <"> timestamp <"> ) / timestamp
nonce = "nonce" "=" string-value seq-nr = "seq-nr" "=" string-value
ext = "ext" "=" string-value access_token = "access_token" "=" b64token
mac = "mac" "=" string-value mac = "mac" "=" string-value
cb = "cb" "=" token
h = "h" "=" h-tag
h-tag = %x68 [FWS] "=" [FWS] hdr-name
*( [FWS] ":" [FWS] hdr-name )
hdr-name = token
timestamp = 1*DIGIT timestamp = 1*DIGIT
string-value = ( <"> plain-string <"> ) / plain-string string-value = ( <"> plain-string <"> ) / plain-string
plain-string = 1*( %x20-21 / %x23-5B / %x5D-7E ) plain-string = 1*( %x20-21 / %x23-5B / %x5D-7E )
b64token = 1*( ALPHA / DIGIT /
"-" / "." / "_" / "~" / "+" / "/" ) *"="
The header attributes are set as follows: The header attributes are set as follows:
id kid
REQUIRED. The MAC key identifier.
REQUIRED. The key identifier.
ts ts
REQUIRED. The request timestamp. The value MUST be a positive
integer set by the client when making each request to the
number of seconds elapsed from a fixed point in time (e.g.
January 1, 1970 00:00:00 GMT). The value MUST NOT include
leading zeros (e.g. "000273154346").
nonce REQUIRED. The timestamp. The value MUST be a positive integer
REQUIRED. A unique string generated by the client. The value set by the client when making each request to the number of
MUST be unique across all requests with the same timestamp and milliseconds since 1 January 1970.
MAC key identifier combination.
ext The JavaScript getTime() function or the Java
OPTIONAL. A string used to include additional information which System.currentTimeMillis() function, for example, produce such
is covered by the request MAC. The content and format of the a timestamp.
string is beyond the scope of this specification.
mac seq-nr
REQUIRED. The HTTP request MAC as described in Section 3.2.
Attributes MUST NOT appear more than once. Attribute values are OPTIONAL. This optional field includes the initial sequence
limited to a subset of ASCII, which does not require escaping, as number to be used by the messages exchange between the client
defined by the plain-string ABNF. and the server when the replay protection provided by the
timestamp is not sufficient enough replay protection. This
field specifies the initial sequence number for messages from
the client to the server. When included in the response
message, the initial sequence number is that for messages from
the server to the client. Sequence numbers fall in the range 0
through 2^64 - 1 and wrap to zero following the value 2^64 - 1.
3.2. Request MAC The initial sequence number SHOULD be random and uniformly
distributed across the full space of possible sequence numbers,
so that it cannot be guessed by an attacker and so that it and
the successive sequence numbers do not repeat other sequences.
In the event that more than 2^64 messages are to be generated
in a series of messages, rekeying MUST be performed before
sequence numbers are reused. Rekeying requires a new access
token to be requested.
The client uses the MAC algorithm and the MAC key to calculate the access_token
request MAC. This specification defines two algorithms: "hmac-sha-1"
and "hmac-sha-256", and provides an extension registry for additional
algorithms.
3.2.1. Normalized Request String CONDITIONAL. The access_token MUST be included in the first
request from the client to the server but MUST NOT be included
in a subsequent response and in a further protocol exchange.
The normalized request string is a consistent, reproducible mac
concatenation of several of the HTTP request elements into a single
string. By normalizing the request into a reproducible string, the
client and server can both calculate the request MAC over the exact
same value.
The string is constructed by concatenating together, in order, the REQUIRED. The result of the keyed message digest computation,
following HTTP request elements, each followed by a new line as described in Section 5.3.
character (%x0A):
1. The timestamp value calculated for the request. cb
2. The nonce value generated for the request. OPTIONAL. This field carries the channel binding value from
RFC 5929 [RFC5929] in the following format: cb= channel-
binding-type ":" channel-binding-content. RFC 5929 offers two
types of channel bindings for TLS. First, there is the 'tls-
server-end-point' channel binding, which uses a hash of the TLS
server's certificate as it appears, octet for octet, in the
server's Certificate message. The second channel binding is
'tls-unique', which uses the first TLS Finished message sent
(note: the Finished struct, not the TLS record layer message
containing it) in the most recent TLS handshake of the TLS
connection being bound to. As an example, the cb field may
contain cb=tls-unique:9382c93673d814579ed1610d3
h
3. The HTTP request method in upper case. For example: "HEAD", OPTIONAL. This field contains a colon-separated list of header
"GET", "POST", etc. field names that identify the header fields presented to the
keyed message digest algorithm. If the 'h' header field is
absent then the following value is set by default: h="host".
The field MUST contain the complete list of header fields in
the order presented to the keyed message digest algorithm. The
field MAY contain names of header fields that do not exist at
the time of computing the keyed message digest; nonexistent
header fields do not contribute to the keyed message digest
computation (that is, they are treated as the null input,
including the header field name, the separating colon, the
header field value, and any CRLF terminator). By including
header fields that do not actually exist in the keyed message
digest computation, the client can allow the resource server to
detect insertion of those header fields by intermediaries.
However, since the client cannot possibly know what header
fields might be defined in the future, this mechanism cannot be
used to prevent the addition of any possible unknown header
fields. The field MAY contain multiple instances of a header
field name, meaning multiple occurrences of the corresponding
header field are included in the header hash. The field MUST
NOT include the mac header field. Folding whitespace (FWS) MAY
be included on either side of the colon separator. Header
field names MUST be compared against actual header field names
in a case-insensitive manner. This list MUST NOT be empty.
See Section 8 for a discussion of choosing header fields.
4. The HTTP request-URI as defined by [RFC2616] section 5.1.2. Attributes MUST NOT appear more than once. Attribute values are
limited to a subset of ASCII, which does not require escaping, as
defined by the plain-string ABNF.
5. The hostname included in the HTTP request using the "Host" 5.2. MAC Input String
request header field in lower case.
6. The port as included in the HTTP request using the "Host" request An HTTP message can either be a request from client to server or a
header field. If the header field does not include a port, the response from server to client. Syntactically, the two types of
default value for the scheme MUST be used (e.g. 80 for HTTP and message differ only in the start-line, which is either a request-line
443 for HTTPS). (for requests) or a status-line (for responses).
7. The value of the "ext" "Authorization" request header field Two parameters serve as input to a keyed message digest function: a
attribute if one was included in the request, otherwise, an empty key and an input string. Depending on the communication direction
string. either the request-line or the status-line is used as the first value
followed by the HTTP header fields listed in the 'h' parameter.
Then, the timestamp field and the seq-nr field (if present) is
concatenated.
Each element is followed by a new line character (%x0A) including the As an example, consider the HTTP request with the new line separator
last element and even when an element value is an empty string. character represented by "\n" for editorial purposes only. The h
parameter is set to h=host, the kid is 314906b0-7c55, and the
timstamp is 1361471629.
For example, the HTTP request: POST /request?b5=%3D%253D&a3=a&c%40=&a2=r%20b&c2&a3=2+q HTTP/1.1
Host: example.com
Hello World!
POST /request?b5=%3D%253D&a3=a&c%40=&a2=r%20b&c2&a3=2+q HTTP/1.1 The resulting string is:
Host: example.com
Hello World! POST /request?b5=%3D%253D&a3=a&c%40=&a2=r%20b&c2&a3=2+q HTTP/1.1\n
1361471629\n
example.com\n
using timestamp "264095:7d8f3e4a", nonce "7d8f3e4a", and extension 5.3. Keyed Message Digest Algorithms
string "a,b,c" is normalized into the following string (the new line
separator character is represented by "\n" for display purposes
only):
264095\n The client uses a cryptographic algorithm together with a session key
7d8f3e4a\n to calculate a keyed message digest. This specification defines two
POST\n algorithms: "hmac-sha-1" and "hmac-sha-256", and provides an
/request?b5=%3D%253D&a3=a&c%40=&a2=r%20b&c2&a3=2+q\n extension registry for additional algorithms.
example.com\n
80\n
a,b,c\n
3.2.2. hmac-sha-1 5.3.1. hmac-sha-1
"hmac-sha-1" uses the HMAC-SHA1 algorithm as defined in [RFC2104]: "hmac-sha-1" uses the HMAC-SHA1 algorithm, as defined in [RFC2104]:
mac = HMAC-SHA1 (key, text) mac = HMAC-SHA1 (key, text)
Where: Where:
text text
is set to the value of the normalized request string as
described in Section 3.2.1,
is set to the value of the input string as described in
Section 5.2,
key key
is set to the MAC key provided by the server, and
is set to the session key provided by the authorization server,
and
mac mac
is used to set the value of the "mac" attribute, after the is used to set the value of the "mac" attribute, after the
result octet string is base64-encoded per [RFC2045] section result string is base64-encoded per Section 6.8 of [RFC2045].
6.8.
3.2.3. hmac-sha-256 5.3.2. hmac-sha-256
"hmac-sha-256" uses the HMAC algorithm as defined in [RFC2104] "hmac-sha-256" uses the HMAC algorithm, as defined in [RFC2104], with
together with the SHA-256 hash function defined in [NIST-FIPS-180-3]: the SHA-256 hash function, defined in [NIST-FIPS-180-3]:
mac = HMAC-SHA256 (key, text) mac = HMAC-SHA256 (key, text)
Where: Where:
text text
is set to the value of the normalize request string as
described in Section 3.2.1,
is set to the value of the input string as described in
Section 5.2,
key key
is set to the MAC key provided by the server, and
is set to the session key provided by the authorization server,
and
mac mac
is used to set the value of the "mac" attribute, after the
result octet string is base64-encoded per [RFC2045] section
6.8.
4. Verifying Requests
A server receiving an authenticated request validates it by is used to set the value of the "mac" attribute, after the
performing the following REQUIRED steps: result string is base64-encoded per Section 6.8 of [RFC2045].
1. Recalculate the request MAC as described in Section 3.2 and 6. Verifying the Authenticator
compare the request MAC to the value received from the client via
the "mac" attribute.
2. Ensure that the combination of timestamp, nonce, and MAC key When receiving a message with an authenticator the following steps
identifier received from the client has not been received before are performed:
in a previous request. The server MAY reject requests with stale
timestamps as described in Section 4.1.
3. Verify the scope and validity of the MAC credentials. 1. When the authorization server receives a message with a new
access token (and consequently a new session key) then it obtains
the session key by retrieving the content of the access token
(which requires decryption of the session key contained inside
the token). The content of the access token, in particular the
audience field and the scope, MUST be verified as described in
Alternatively, the kid parameter is used to look-up a cached
session key from a previous exchange.
2. Recalculate the keyed message digest, as described in
Section 5.3, and compare the request MAC to the value received
from the client via the "mac" attribute.
3. Verify that no replay took place by comparing the value of the ts
(timestamp) header with the local time. The processing of
authenticators with stale timestamps is described in Section 6.1.
If the request fails verification, the server SHOULD respond using Error handling is described in Section 6.2.
the 401 (Unauthorized) HTTP status code and include the "WWW-
Authenticate" response header field as described in Section 4.2.
4.1. Timestamp Verification 6.1. Timestamp Verification
The timestamp, nonce, and MAC key identifier combination provide a
unique identifier which enables the server to prevent replay attacks.
Without replay protection, an attacker can use a compromised (but
otherwise valid and authenticated) request more than once, gaining
long term access to a protected resource.
Including a timestamp with the nonce removes the need to retain an The timestamp field enables the server to detect replay attacks.
infinite number of nonce values for future checks, by enabling the Without replay protection, an attacker can use an eavesdropped
server to restrict the time period after which a request with an old request to gain access to a protected resource. The following
timestamp is rejected. If such a restriction is enforced, the server procedure is used to detect replays:
MUST:
o At the time the first request is received from the client for each o At the time the first request is received from the client for each
MAC key identifier, calculate the difference (in seconds) between key identifier, calculate the difference (in seconds) between the
the request timestamp and the server's clock. The difference - request timestamp and the local clock. The difference is stored
the request time delta - MUST be kept as long as the MAC key locally for later use.
credentials are valid. o For each subsequent request, apply the request time delta to the
timestamp included in the message to calculate the adjusted
o For each subsequent client request, apply the request time delta request time.
to request timestamp to calculate the adjusted request time - the
time when the request MAC has been generated by the client,
adjusted to the server's clock.
o Verify that the adjusted request time is within the allowed time o Verify that the adjusted request time is within the allowed time
period defined by the server. The server SHOULD allow for a period defined by the authorization server. If the local time and
sufficiently large window to accommodate network delays (between the calculated time based in the request differ by more than the
the time the request has been generated by the client to the time allowable clock skew (e.g., 5 minutes) a replay has to be assumed.
it is received by the server and processed).
4.2. The "WWW-Authenticate" Response Header Field 6.2. Error Handling
If the protected resource request does not include authentication If the protected resource request does not include an access token,
credentials, contains an invalid MAC key identifier, or is malformed, lacks the keyed message digest, contains an invalid key identifier,
the server SHOULD include the HTTP "WWW-Authenticate" response header or is malformed, the server SHOULD return a 401 (Unauthorized) HTTP
field. status code.
For example: For example:
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
WWW-Authenticate: MAC WWW-Authenticate: MAC
The "WWW-Authenticate" request header field uses the framework The "WWW-Authenticate" request header field uses the framework
defined by [RFC2617] as follows: defined by [RFC2617] as follows:
challenge = "MAC" [ 1*SP #param ] challenge = "MAC" [ 1*SP #param ]
skipping to change at page 11, line 16 skipping to change at page 17, line 5
request header field and failed authentication, the server MAY request header field and failed authentication, the server MAY
include the "error" attribute to provide the client with a human- include the "error" attribute to provide the client with a human-
readable explanation why the access request was declined to assist readable explanation why the access request was declined to assist
the client developer in identifying the problem. the client developer in identifying the problem.
For example: For example:
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
WWW-Authenticate: MAC error="The MAC credentials expired" WWW-Authenticate: MAC error="The MAC credentials expired"
5. Use with OAuth 2.0 7. Example
OAuth 2.0 ([RFC6749]) defines an extensible token-based
authentication framework. The MAC authentication scheme can be used
to make OAuth-based requests by issuing MAC-type access tokens.
This specification does not define methods for the client to
specifically request a MAC-type token from the authorization server.
Additionally, it does not include any discovery facilities for
identifying which HMAC algorithms are supported by a resource server,
or how the client may go about obtaining MAC access tokens for any
given protected resource.
5.1. Issuing MAC-Type Access Tokens
Authorization servers issuing MAC-type access tokens MUST include the
following parameters whenever a response includes the "access_token"
parameter:
access_token
REQUIRED. The MAC key identifier.
mac_key [Editor's Note: Full example goes in here.]
REQUIRED. The MAC key.
mac_algorithm 8. Security Considerations
REQUIRED. The MAC algorithm used to calculate the request MAC.
Value MUST be one of "hmac-sha-1", "hmac-sha-256", or a
registered extension algorithm name as described in Section
7.1.
For example: As stated in [RFC2617], the greatest sources of risks are usually
found not in the core protocol itself but in policies and procedures
surrounding its use. Implementers are strongly encouraged to assess
how this protocol addresses their security requirements and the
security threats they want to mitigate.
HTTP/1.1 200 OK 8.1. Key Distribution
Content-Type: application/json
Cache-Control: no-store
{ This specification describes a key distribution mechanism for
"access_token":"SlAV32hkKG", providing the session key (and parameters) from the authorization
"token_type":"mac", server to the client. The interaction between the client and the
"expires_in":3600, authorization server requires Transport Layer Security (TLS) with a
"refresh_token":"8xLOxBtZp8", ciphersuite offering confidentiality protection. The session key
"mac_key":"adijq39jdlaska9asud", MUST NOT be transmitted in clear since this would completely destroy
"mac_algorithm":"hmac-sha-256" the security benefits of the proposed scheme. Furthermore, the
} obtained session key MUST be stored so that only the client instance
has access to it. Storing the session key, for example, in a cookie
allows other parties to gain access to this confidential information
and compromises the security of the protocol.
6. Security Considerations 8.2. Offering Confidentiality Protection for Access to Protected
Resources
As stated in [RFC2617], the greatest sources of risks are usually This specification can be used with and without Transport Layer
found not in the core protocol itself but in policies and procedures Security (TLS).
surrounding its use. Implementers are strongly encouraged to assess
how this protocol addresses their security requirements.
6.1. MAC Keys Transmission Without TLS this protocol provides a mechanism for verifying the
integrity of requests and responses, it provides no confidentiality
protection. Consequently, eavesdroppers will have full access to
request content and further messages exchanged between the client and
the resource server. This could be problematic when data is
exchanged that requires care, such as personal data.
This specification describes two mechanism for obtaining or When TLS is used then confidentiality can be ensured and with the use
transmitting MAC keys, both require the use of a transport-layer of the TLS channel binding feature it ensures that the TLS channel is
security mechanism when sending MAC keys to the client. Additional cryptographically bound to the used MAC token. TLS in combination
methods used to obtain MAC credentials must ensure that these with channel bindings bound to the MAC token provide security
transmissions are protected using transport-layer mechanisms such as superiour to the OAuth Bearer Token.
TLS or SSL.
6.2. Confidentiality of Requests The use of TLS in combination with the MAC token is highly
recommended to ensure the confidentiality of the user's data.
While this protocol provides a mechanism for verifying the integrity 8.3. Authentication of Resource Servers
of requests, it provides no guarantee of request confidentiality.
Unless further precautions are taken, eavesdroppers will have full
access to request content. Servers should carefully consider the
kinds of data likely to be sent as part of such requests, and should
employ transport-layer security mechanisms to protect sensitive
resources.
6.3. Spoofing by Counterfeit Servers This protocol allows clients to verify the authenticity of resource
servers in two ways:
1. The resource server demonstrates possession of the session key by
computing a keyed message digest function over a number of HTTP
fields in the response to the request from the client.
2. When TLS is used the resource server is authenticated as part of
the TLS handshake.
This protocol makes no attempt to verify the authenticity of the 8.4. Plaintext Storage of Credentials
server. A hostile party could take advantage of this by intercepting
the client's requests and returning misleading or otherwise incorrect
responses. Service providers should consider such attacks when
developing services using this protocol, and should require
transport-layer security for any requests where the authenticity of
the resource server or of request responses is an issue.
6.4. Plaintext Storage of Credentials The MAC key works in the same way passwords do in traditional
The MAC key functions the same way passwords do in traditional authentication systems. In order to compute the keyed message
authentication systems. In order to compute the request MAC, the digest, the client and the resource server must have access to the
server must have access to the MAC key in plaintext form. This is in MAC key in plaintext form.
contrast, for example, to modern operating systems, which store only
a one-way hash of user credentials.
If an attacker were to gain access to these MAC keys - or worse, to If an attacker were to gain access to these MAC keys - or worse, to
the server's database of all such MAC keys - he or she would be able the resource server's or the authorization server's database of all
to perform any action on behalf of any resource owner. Accordingly, such MAC keys - he or she would be able to perform any action on
it is critical that servers protect these MAC keys from unauthorized behalf of any client.
access.
6.5. Entropy of MAC Keys It is therefore paramount to the security of the protocol that these
session keys are protected from unauthorized access.
Unless a transport-layer security protocol is used, eavesdroppers 8.5. Entropy of Session Keys
will have full access to authenticated requests and request MAC
values, and will thus be able to mount offline brute-force attacks to
recover the MAC key used. Servers should be careful to assign MAC
keys which are long enough, and random enough, to resist such attacks
for at least the length of time that the MAC credentials are valid.
For example, if the MAC credentials are valid for two weeks, servers Unless TLS is used between the client and the resource server,
should ensure that it is not possible to mount a brute force attack eavesdroppers will have full access to requests sent by the client.
that recovers the MAC key in less than two weeks. Of course, servers They will thus be able to mount offline brute-force attacks to
are urged to err on the side of caution, and use the longest MAC key recover the session key used to compute the keyed message digest.
reasonable. Authorization servers should be careful to generate fresh and unique
session keys with sufficient entrophy to resist such attacks for at
least the length of time that the session keys are valid.
For example, if a session key is valid for one day, authorization
servers must ensure that it is not possible to mount a brute force
attack that recovers the session key in less than one day. Of
course, servers are urged to err on the side of caution, and use the
longest session key reasonable.
It is equally important that the pseudo-random number generator It is equally important that the pseudo-random number generator
(PRNG) used to generate these MAC keys be of sufficiently high (PRNG) used to generate these session keys be of sufficiently high
quality. Many PRNG implementations generate number sequences that quality. Many PRNG implementations generate number sequences that
may appear to be random, but which nevertheless exhibit patterns or may appear to be random, but which nevertheless exhibit patterns,
other weaknesses which make cryptanalysis or brute force attacks which make cryptanalysis easier. Implementers are advised to follow
easier. Implementers should be careful to use cryptographically the guidance on random number generation in [RFC4086].
secure PRNGs to avoid these problems.
6.6. Denial of Service / Resource Exhaustion Attacks 8.6. Denial of Service / Resource Exhaustion Attacks
This specification includes a number of features which may make This specification includes a number of features which may make
resource exhaustion attacks against servers possible. For example, resource exhaustion attacks against resource servers possible. For
this protocol requires servers to track used nonces. If an attacker example, a resource server may need to need to consult backend
is able to use many nonces quickly, the resources required to track databases and the authorization server to verify an incoming request
them may exhaust available capacity. And again, this protocol can including an access token before granting access to the protected
require servers to perform potentially expensive computations in resource.
order to verify the request MAC on incoming requests. An attacker
may exploit this to perform a denial of service attack by sending a
large number of invalid requests to the server.
Resource Exhaustion attacks are by no means specific to this An attacker may exploit this to perform a denial of service attack by
specification. However, implementers should be careful to consider sending a large number of invalid requests to the server. The
the additional avenues of attack that this protocol exposes, and computational overhead of verifying the keyed message digest alone
design their implementations accordingly. For example, entropy is, however, not sufficient to mount a denial of service attack since
starvation typically results in either a complete denial of service keyed message digest functions belong to the computationally fastest
while the system waits for new entropy or else in weak (easily cryptographic algorithms. The usage of TLS does, however, require
guessable) MAC keys. When implementing this protocol, servers should additional computational capabity to perform the asymmetric
consider which of these presents a more serious risk for their cryptographic operations. For a brief discussion about denial of
application and design accordingly. service vulnerabilities of TLS please consult Appendix F.5 of RFC
5246 [RFC5246].
6.7. Timing Attacks 8.7. Timing Attacks
This specification makes use of HMACs, for which a signature This specification makes use of HMACs, for which a signature
verification involves comparing the received MAC string to the verification involves comparing the received MAC string to the
expected one. If the string comparison operator operates in expected one. If the string comparison operator operates in
observably different times depending on inputs, e.g. because it observably different times depending on inputs, e.g. because it
compares the strings character by character and returns a negative compares the strings character by character and returns a negative
result as soon as two characters fail to match, then it may be result as soon as two characters fail to match, then it may be
possible to use this timing information to determine the expected possible to use this timing information to determine the expected
MAC, character by character. MAC, character by character.
Service implementers are encouraged to use fixed-time string Implementers are encouraged to use fixed-time string comparators for
comparators for MAC verification. MAC verification. This means that the comparison operation is not
terminated once a mismatch is found.
6.8. CSRF Attacks 8.8. CSRF Attacks
A Cross-Site Request Forgery attack occurs when a site, evil.com, A Cross-Site Request Forgery attack occurs when a site, evil.com,
initiates within the victim's browser the loading of a URL from or initiates within the victim's browser the loading of a URL from or
the posting of a form to a web site where a side-effect will occur, the posting of a form to a web site where a side-effect will occur,
e.g. transfer of money, change of status message, etc. To prevent e.g. transfer of money, change of status message, etc. To prevent
this kind of attack, web sites may use various techniques to this kind of attack, web sites may use various techniques to
determine that the originator of the request is indeed the site determine that the originator of the request is indeed the site
itself, rather than a third party. The classic approach is to itself, rather than a third party. The classic approach is to
include, in the set of URL parameters or form content, a nonce include, in the set of URL parameters or form content, a nonce
generated by the server and tied to the user's session, which generated by the server and tied to the user's session, which
indicates that only the server could have triggered the action. indicates that only the server could have triggered the action.
Recently, the Origin HTTP header has been proposed and deployed in Recently, the Origin HTTP header has been proposed and deployed in
some browsers. This header indicates the scheme, host, and port of some browsers. This header indicates the scheme, host, and port of
the originator of a request. Some web applications may use this the originator of a request. Some web applications may use this
Origin header as a defense against CSRF. Origin header as a defense against CSRF.
To keep this specification simple, HTTP headers are not part of the To keep this specification simple, HTTP headers are not part of the
string to be MAC'ed. As a result, MAC authentication cannot defend string to be MAC'ed. As a result, MAC authentication cannot defend
against header spoofing, and a web site that uses the Host header to against header spoofing, and a web site that uses the Host header to
defend against CSRF attacks cannot use MAC authentication to defend defend against CSRF attacks cannot use MAC authentication to defend
against active network attackers. Sites that want the full against active network attackers. Sites that want the full
protection of MAC Authentication should use traditional, cookie-tied protection of MAC Authentication should use traditional, cookie-tied
CSRF defenses. CSRF defenses.
6.9. Coverage Limitations 8.9. Protecting HTTP Header Fields
The normalized request string has been designed to support the
authentication methods defined in this specification. Those
designing additional methods, should evaluated the compatibility of
the normalized request string with their security requirements.
Since the normalized request string does not cover the entire HTTP
request, servers should employ additional mechanisms to protect such
elements.
The request MAC does not cover entity-header fields which can often This specification provides flexibility for selectively protecting
affect how the request body is interpreted by the server (i.e. header fields and even the body of the message. At a minimum the
Content-Type). If the server behavior is influenced by the presence following fields are included in the keyed message digest.
or value of such header fields, an attacker can manipulate the
request header without being detected.
7. IANA Considerations 9. IANA Considerations
7.1. The HTTP MAC Authentication Scheme Algorithm Registry 9.1. JSON Web Token Claims
This specification establishes the HTTP MAC authentication scheme This document adds the following claims to the JSON Web Token Claims
algorithm registry. registry established with [I-D.ietf-oauth-json-web-token]:
o Claim Name: "kid"
o Change Controller: IETF
o Specification Document(s): [[ this document ]]
o Claim Name: "mac_key"
o Change Controller: IETF
o Specification Document(s): [[ this document ]]
Additional MAC algorithms are registered on the advice of one or more 9.2. MAC Token Algorithm Registry
Designated Experts (appointed by the IESG or their delegate), with a
Specification Required (using terminology from [RFC5226]). However, This specification establishes the MAC Token Algorithm registry.
to allow for the allocation of values prior to publication, the
Designated Expert(s) may approve registration once they are satisfied Additional keyed message digest algorithms are registered on the
that such a specification will be published. advice of one or more Designated Experts (appointed by the IESG or
their delegate), with a Specification Required (using terminology
from [RFC5226]). 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 should be sent to the [TBD]@ietf.org mailing Registration requests should be sent to the [TBD]@ietf.org mailing
list for review and comment, with an appropriate subject (e.g., list for review and comment, with an appropriate subject (e.g.,
"Request for MAC Algorithm: example"). [[ Note to RFC-EDITOR: The "Request for MAC Algorithm: example"). [[ Note to RFC-EDITOR: The
name of the mailing list should be determined in consultation with name of the mailing list should be determined in consultation with
the IESG and IANA. Suggested name: http-mac-ext-review. ]] the IESG and IANA. Suggested name: http-mac-ext-review. ]]
Within at most 14 days of the request, the Designated Expert(s) will Within at most 14 days of the request, the Designated Expert(s) will
either approve or deny the registration request, communicating this either approve or deny the registration request, communicating this
decision to the review list and IANA. Denials should include an decision to the review list and IANA. Denials should include an
explanation and, if applicable, suggestions as to how to make the explanation and, if applicable, suggestions as to how to make the
request successful. request successful.
Decisions (or lack thereof) made by the Designated Expert can be Decisions (or lack thereof) made by the Designated Expert can be
first appealed to Application Area Directors (contactable using app- first appealed to Application Area Directors (contactable using
ads@tools.ietf.org email address or directly by looking up their app-ads@tools.ietf.org email address or directly by looking up their
email addresses on http://www.iesg.org/ website) and, if the email addresses on http://www.iesg.org/ website) and, if the
appellant is not satisfied with the response, to the full IESG (using appellant is not satisfied with the response, to the full IESG (using
the iesg@iesg.org mailing list). the iesg@iesg.org mailing list).
IANA should only accept registry updates from the Designated IANA should only accept registry updates from the Designated
Expert(s), and should direct all requests for registration to the Expert(s), and should direct all requests for registration to the
review mailing list. review mailing list.
7.1.1. Registration Template 9.2.1. Registration Template
Algorithm name: Algorithm name:
The name requested (e.g., "example").
The name requested (e.g., "example").
Change controller: Change controller:
For standards-track RFCs, state "IETF". For others, give the name For standards-track RFCs, state "IETF". For others, give the name
of the responsible party. Other details (e.g., postal address, of the responsible party. Other details (e.g., postal address,
e-mail address, home page URI) may also be included. e-mail address, home page URI) may also be included.
Specification document(s): Specification document(s):
Reference to document that specifies the algorithm, preferably Reference to document that specifies the algorithm, preferably
including a URI that can be used to retrieve a copy of the including a URI that can be used to retrieve a copy of the
document. An indication of the relevant sections may also be document. An indication of the relevant sections may also be
included, but is not required. included, but is not required.
7.1.2. Initial Registry Contents 9.2.2. Initial Registry Contents
The HTTP MAC authentication scheme algorithm registry's initial The HTTP MAC authentication scheme algorithm registry's initial
contents are: contents are:
o Algorithm name: hmac-sha-1 o Algorithm name: hmac-sha-1
o Change controller: IETF o Change controller: IETF
o Specification document(s): [[ this document ]] o Specification document(s): [[ this document ]]
o Algorithm name: hmac-sha-256 o Algorithm name: hmac-sha-256
o Change controller: IETF o Change controller: IETF
o Specification document(s): [[ this document ]] o Specification document(s): [[ this document ]]
7.2. OAuth Access Token Type Registration 9.3. OAuth Access Token Type Registration
This specification registers the following access token type in the This specification registers the following access token type in the
OAuth Access Token Type Registry. OAuth Access Token Type Registry.
7.2.1. The "mac" OAuth Access Token Type 9.3.1. The "mac" OAuth Access Token Type
Type name: Type name:
mac
mac
Additional Token Endpoint Response Parameters: Additional Token Endpoint Response Parameters:
secret, algorithm
secret, algorithm
HTTP Authentication Scheme(s): HTTP Authentication Scheme(s):
MAC
MAC
Change controller: Change controller:
IETF
IETF
Specification document(s): Specification document(s):
[[ this document ]] [[ this document ]]
7.3. OAuth Parameters Registration 9.4. OAuth Parameters Registration
This specification registers the following parameters in the OAuth This specification registers the following parameters in the OAuth
Parameters Registry established by [RFC6749]. Parameters Registry established by [RFC6749].
7.3.1. The "mac_key" OAuth Parameter 9.4.1. The "mac_key" OAuth Parameter
Parameter name: mac_key
Parameter usage location: authorization response, token response
Change controller: IETF
Specification document(s): [[ this document ]]
Related information: None
7.3.2. The "mac_algorithm" OAuth Parameter
Parameter name: mac_algorithm Parameter name: mac_key
Parameter usage location: authorization response, token response
Change controller: IETF
Specification document(s): [[ this document ]]
Related information: None
Parameter usage location: authorization response, token response 9.4.2. The "mac_algorithm" OAuth Parameter
Change controller: IETF Parameter name: mac_algorithm
Parameter usage location: authorization response, token response
Change controller: IETF
Specification document(s): [[ this document ]]
Related information: None
Specification document(s): [[ this document ]] 9.4.3. The "kid" OAuth Parameter
Related information: None Parameter name: kid
Parameter usage location: authorization response, token response
Change controller: IETF
Specification document(s): [[ this document ]]
Related information: None
8. Contributors 10. Acknowledgments
This document is based on OAuth 1.0 and we would like to thank Eran This document is based on OAuth 1.0 and we would like to thank Eran
Hammer-Lahav for his work on incorporating the ideas into OAuth 2.0. Hammer-Lahav for his work on incorporating the ideas into OAuth 2.0.
As part of this initial work the following persons provided feedback:
Ben Adida, Adam Barth, Phil Hunt, Rasmus Lerdorf, James Manger,
William Mills, Scott Renfro, Justin Richer, Toby White, Peter
Wolanin, and Skylar Woodward
9. Acknowledgments Further work in this document was done as part of OAuth working group
conference calls late 2012/early 2013 and in design team conference
calls February 2013. The following persons (in addition to the OAuth
WG chairs, Hannes Tschofenig, and Derek Atkins) provided their input
during these calls: Bill Mills, Justin Richer, Phil Hunt, Prateek
Mishra, Mike Jones, George Fletcher, John Bradley, Tony Nadalin,
Thomas Hardjono, Brian Campbell
The author would like to thank Ben Adida, Adam Barth, Phil Hunt, 11. References
Rasmus Lerdorf, James Manger, William Mills, Scott Renfro, Justin
Richer, Toby White, Peter Wolanin, and Skylar Woodward for their
contributions, suggestions, and feedback.
10. References 11.1. Normative References
10.1. Normative References [I-D.ietf-httpbis-p1-messaging]
Fielding, R. and J. Reschke, "Hypertext Transfer Protocol
(HTTP/1.1): Message Syntax and Routing",
draft-ietf-httpbis-p1-messaging-22 (work in progress),
February 2013.
[10] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol [I-D.ietf-jose-json-web-encryption]
(HTTP/1.1): Message Syntax and Routing", Internet-Draft Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web
draft-ietf-httpbis-p1-messaging-21, October 2012. Encryption (JWE)", draft-ietf-jose-json-web-encryption-08
(work in progress), December 2012.
[11] Hardt, D., "The OAuth 2.0 Authorization Framework", RFC [I-D.ietf-oauth-json-web-token]
6749, October 2012. Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token
(JWT)", draft-ietf-oauth-json-web-token-06 (work in
progress), December 2012.
[12] Hors, A., Raggett, D. and I. Jacobs, "HTML 4.01 [I-D.richer-oauth-introspection]
Specification", World Wide Web Consortium Recommendation Richer, J., "OAuth Token Introspection",
REC-html401-19991224, December 1999, <http://www.w3.org/TR draft-richer-oauth-introspection-03 (work in progress),
/1999/REC-html401-19991224>. February 2013.
[13] National Institute of Standards and Technology, "Secure [I-D.tschofenig-oauth-audience]
Hash Standard (SHS). FIPS PUB 180-3, October 2008", . Tschofenig, H., "OAuth 2.0: Audience Information",
draft-tschofenig-oauth-audience-00 (work in progress),
February 2013.
[1] Bradner, S., "Key words for use in RFCs to Indicate [NIST-FIPS-180-3]
Requirement Levels", BCP 14, RFC 2119, March 1997. National Institute of Standards and Technology, "Secure
Hash Standard (SHS). FIPS PUB 180-3, October 2008".
[2] Freed, N. and N.S. Borenstein, "Multipurpose Internet Mail [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part One: Format of Internet Message Extensions (MIME) Part One: Format of Internet Message
Bodies", RFC 2045, November 1996. Bodies", RFC 2045, November 1996.
[3] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed- [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
Hashing for Message Authentication", RFC 2104, February Hashing for Message Authentication", RFC 2104,
1997. February 1997.
[4] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[5] Franks, J., Hallam-Baker, P.M., Hostetler, J.L., Lawrence, [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S.,
S.D., Leach, P.J., Luotonen, A. and L. Stewart, "HTTP Leach, P., Luotonen, A., and L. Stewart, "HTTP
Authentication: Basic and Digest Access Authentication", Authentication: Basic and Digest Access Authentication",
RFC 2617, June 1999. RFC 2617, June 1999.
[6] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66, RFC Resource Identifier (URI): Generic Syntax", STD 66,
3986, January 2005. RFC 3986, January 2005.
[7] Narten, T. and H. Alvestrand, "Guidelines for Writing an [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness
Requirements for Security", BCP 106, RFC 4086, June 2005.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", BCP 26, RFC 5226, IANA Considerations Section in RFCs", BCP 26, RFC 5226,
May 2008. May 2008.
[8] Dierks, T. and E. Rescorla, "The Transport Layer Security [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", RFC 5246, August 2008. (TLS) Protocol Version 1.2", RFC 5246, August 2008.
[9] Barth, A., "HTTP State Management Mechanism", RFC 6265, [RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings
for TLS", RFC 5929, July 2010.
[RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265,
April 2011. April 2011.
10.2. Informative References [RFC6749] Hardt, D., "The OAuth 2.0 Authorization Framework",
RFC 6749, October 2012.
[1] Tschofenig, H. and P. Hunt, "OAuth 2.0 Security: Going [W3C.REC-html401-19991224]
Beyond Bearer Tokens", Internet-Draft draft-tschofenig- Hors, A., Raggett, D., and I. Jacobs, "HTML 4.01
oauth-security-00, September 2012. Specification", World Wide Web Consortium
Recommendation REC-html401-19991224, December 1999,
<http://www.w3.org/TR/1999/REC-html401-19991224>.
[2] Bradley, J., Hunt, P., Nadalin, A. and H. Tschofenig, "The 11.2. Informative References
OAuth 2.0 Authorization Framework: Holder-of-the-Key Token
Usage", Internet-Draft draft-tschofenig-oauth-hotk-01,
July 2012.
[3] Hammer-Lahav, E., "The OAuth 1.0 Protocol", RFC 5849, [I-D.tschofenig-oauth-security]
April 2010. Tschofenig, H. and P. Hunt, "OAuth 2.0 Security: Going
Beyond Bearer Tokens", draft-tschofenig-oauth-security-01
(work in progress), December 2012.
Authors' Addresses Authors' Addresses
Justin Richer, editor Justin Richer
The MITRE Corporation The MITRE Corporation
Email: jricher@mitre.org Email: jricher@mitre.org
William Mills, editor William Mills
Yahoo! Inc. Yahoo! Inc.
Phone:
Email: wmills@yahoo-inc.com Email: wmills@yahoo-inc.com
Hannes Tschofenig (editor)
Hannes Tschofenig, editor
Nokia Siemens Networks Nokia Siemens Networks
Linnoitustie 6 Linnoitustie 6
Espoo, 02600 Espoo 02600
Finland Finland
Phone: +358 (50) 4871445 Phone: +358 (50) 4871445
Email: Hannes.Tschofenig@gmx.net Email: Hannes.Tschofenig@gmx.net
URI: http://www.tschofenig.priv.at URI: http://www.tschofenig.priv.at
 End of changes. 202 change blocks. 
556 lines changed or deleted 714 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/