draft-ietf-oauth-v2-http-mac-01.txt   draft-ietf-oauth-v2-http-mac-02.txt 
Network Working Group E. Hammer-Lahav, Ed. OAuth J. Richer, Ed.
Internet-Draft February 8, 2012 Internet-Draft The MITRE Corporation
Intended status: Standards Track Intended status: Standards Track W. Mills, Ed.
Expires: August 11, 2012 Expires: May 30, 2013 Yahoo! Inc.
H. Tschofenig, Ed.
Nokia Siemens Networks
November 28, 2012
HTTP Authentication: MAC Access Authentication OAuth 2.0 Message Authentication Code (MAC) Tokens
draft-ietf-oauth-v2-http-mac-01 draft-ietf-oauth-v2-http-mac-02
Abstract Abstract
This document specifies the HTTP MAC access authentication scheme, an This document specifies the HTTP MAC access authentication scheme, an
HTTP authentication method using a message authentication code (MAC) HTTP authentication method using a message authentication code (MAC)
algorithm to provide cryptographic verification of portions of HTTP algorithm to provide cryptographic verification of portions of HTTP
requests. The document also defines an OAuth 2.0 binding for use as requests. The document also defines an OAuth 2.0 binding for use as
an access-token type. an access token type.
NOTE: This document (and other OAuth 2.0 security documents, such as
[I-D.tschofenig-oauth-hotk]) are still work in progress in the OAuth
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 August 11, 2012. This Internet-Draft will expire on May 30, 2013.
Copyright Notice Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the Copyright (c) 2012 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 Provisions Relating to IETF Documents (http://trustee.ietf.org/
(http://trustee.ietf.org/license-info) in effect on the date of license-info) in effect on the date of publication of this document.
publication of this document. Please review these documents Please review these documents carefully, as they describe your rights
carefully, as they describe your rights and restrictions with respect and restrictions with respect to this document. Code Components
to this document. Code Components extracted from this document must extracted from this document must include Simplified BSD License text
include Simplified BSD License text as described in Section 4.e of as described in Section 4.e of the Trust Legal Provisions and are
the Trust Legal Provisions and are provided without warranty as provided without warranty as described in the Simplified BSD License.
described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Example . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1. Example . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2. Notational Conventions . . . . . . . . . . . . . . . . . . 5 1.2. Notational Conventions . . . . . . . . . . . . . . . . . . 5
2. Issuing MAC Credentials . . . . . . . . . . . . . . . . . . . 5 2. Issuing MAC Credentials . . . . . . . . . . . . . . . . . . . 5
3. Making Requests . . . . . . . . . . . . . . . . . . . . . . . 6 3. Making Requests . . . . . . . . . . . . . . . . . . . . . . . 6
3.1. The "Authorization" Request Header . . . . . . . . . . . . 6 3.1. The "Authorization" Request Header . . . . . . . . . . . . 6
3.2. Request MAC . . . . . . . . . . . . . . . . . . . . . . . 7 3.2. Request MAC . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.1. Normalized Request String . . . . . . . . . . . . . . 8 3.2.1. Normalized Request String . . . . . . . . . . . . . . 7
3.2.2. hmac-sha-1 . . . . . . . . . . . . . . . . . . . . . . 9 3.2.2. hmac-sha-1 . . . . . . . . . . . . . . . . . . . . . . 8
3.2.3. hmac-sha-256 . . . . . . . . . . . . . . . . . . . . . 9 3.2.3. hmac-sha-256 . . . . . . . . . . . . . . . . . . . . . 9
4. Verifying Requests . . . . . . . . . . . . . . . . . . . . . . 10 4. Verifying Requests . . . . . . . . . . . . . . . . . . . . . . 9
4.1. Timestamp Verification . . . . . . . . . . . . . . . . . . 10 4.1. Timestamp Verification . . . . . . . . . . . . . . . . . . 9
4.2. The "WWW-Authenticate" Response Header Field . . . . . . . 11 4.2. The "WWW-Authenticate" Response Header Field . . . . . . . 10
5. Use with OAuth 2.0 . . . . . . . . . . . . . . . . . . . . . . 12 5. Use with OAuth 2.0 . . . . . . . . . . . . . . . . . . . . . . 11
5.1. Issuing MAC-Type Access Tokens . . . . . . . . . . . . . . 12 5.1. Issuing MAC-Type Access Tokens . . . . . . . . . . . . . . 11
6. Security Considerations . . . . . . . . . . . . . . . . . . . 13 6. Security Considerations . . . . . . . . . . . . . . . . . . . 12
6.1. MAC Keys Transmission . . . . . . . . . . . . . . . . . . 13 6.1. MAC Keys Transmission . . . . . . . . . . . . . . . . . . 12
6.2. Confidentiality of Requests . . . . . . . . . . . . . . . 13 6.2. Confidentiality of Requests . . . . . . . . . . . . . . . 12
6.3. Spoofing by Counterfeit Servers . . . . . . . . . . . . . 13 6.3. Spoofing by Counterfeit Servers . . . . . . . . . . . . . 12
6.4. Plaintext Storage of Credentials . . . . . . . . . . . . . 13 6.4. Plaintext Storage of Credentials . . . . . . . . . . . . . 12
6.5. Entropy of MAC Keys . . . . . . . . . . . . . . . . . . . 14 6.5. Entropy of MAC Keys . . . . . . . . . . . . . . . . . . . 13
6.6. Denial of Service / Resource Exhaustion Attacks . . . . . 14 6.6. Denial of Service / Resource Exhaustion Attacks . . . . . 13
6.7. Timing Attacks . . . . . . . . . . . . . . . . . . . . . . 15 6.7. Timing Attacks . . . . . . . . . . . . . . . . . . . . . . 14
6.8. CSRF Attacks . . . . . . . . . . . . . . . . . . . . . . . 15 6.8. CSRF Attacks . . . . . . . . . . . . . . . . . . . . . . . 14
6.9. Coverage Limitations . . . . . . . . . . . . . . . . . . . 15 6.9. Coverage Limitations . . . . . . . . . . . . . . . . . . . 14
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15
7.1. The HTTP MAC Authentication Scheme Algorithm Registry . . 16 7.1. The HTTP MAC Authentication Scheme Algorithm Registry . . 15
7.1.1. Registration Template . . . . . . . . . . . . . . . . 17 7.1.1. Registration Template . . . . . . . . . . . . . . . . 15
7.1.2. Initial Registry Contents . . . . . . . . . . . . . . 17 7.1.2. Initial Registry Contents . . . . . . . . . . . . . . 16
7.2. OAuth Access Token Type Registration . . . . . . . . . . . 17 7.2. OAuth Access Token Type Registration . . . . . . . . . . . 16
7.2.1. The "mac" OAuth Access Token Type . . . . . . . . . . 17 7.2.1. The "mac" OAuth Access Token Type . . . . . . . . . . 16
7.3. OAuth Parameters Registration . . . . . . . . . . . . . . 18 7.3. OAuth Parameters Registration . . . . . . . . . . . . . . 17
7.3.1. The "mac_key" OAuth Parameter . . . . . . . . . . . . 18 7.3.1. The "mac_key" OAuth Parameter . . . . . . . . . . . . 17
7.3.2. The "mac_algorithm" OAuth Parameter . . . . . . . . . 18 7.3.2. The "mac_algorithm" OAuth Parameter . . . . . . . . . 17
8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 18 8. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 17
9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 18 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 17
9.1. Normative References . . . . . . . . . . . . . . . . . . . 18 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 17
9.2. Informative References . . . . . . . . . . . . . . . . . . 19 10.1. Normative References . . . . . . . . . . . . . . . . . . 17
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 20 10.2. Informative References . . . . . . . . . . . . . . . . . 18
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 19
1. Introduction 1. Introduction
This specification defines the HTTP MAC access authentication scheme, This specification defines the HTTP MAC access authentication scheme,
providing a method for making authenticated HTTP requests with providing a method for making authenticated HTTP requests with
partial cryptographic verification of the request, covering the HTTP partial cryptographic verification of the request, covering the HTTP
method, request URI, and host. method, request URI, and host.
Similar to the HTTP Basic access authentication scheme [RFC2617], the Similar to the HTTP Basic access authentication scheme [RFC2617], the
MAC scheme utilizes a set of client credentials which include an MAC scheme utilizes a set of client credentials which include an
identifier and key. However, in contrast with the Basic scheme, the identifier and key. However, in contrast with the Basic scheme, the
key is never included in authenticated requests but is used to key is never included in authenticated requests but is used to
calculate the request MAC value which is included instead. calculate the request MAC value which is included instead.
skipping to change at page 4, line 23 skipping to change at page 4, line 14
The resource server returns the following authentication challenge: The resource server returns the following authentication challenge:
HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized
WWW-Authenticate: MAC WWW-Authenticate: MAC
The client has previously obtained a set of MAC credentials for The client has previously obtained a set of MAC credentials for
accessing resources on the "http://example.com/" server. The MAC accessing resources on the "http://example.com/" server. The MAC
credentials issued to the client include the following attributes: credentials issued to the client include the following attributes:
MAC key identifier: h480djs93hd8 MAC key identifier: h480djs93hd8
MAC key: 489dks293j39
MAC algorithm: hmac-sha-1 MAC key: 489dks293j39
MAC algorithm: hmac-sha-1
The client constructs the authentication header by calculating a The client constructs the authentication header by calculating a
timestamp (e.g. the number of seconds since January 1, 1970 00:00:00 timestamp (e.g. the number of seconds since January 1, 1970 00:00:00
GMT) and generating a random string used as a nonce: GMT) and generating a random string used as a nonce:
Timestamp: 1336363200 Timestamp: 1336363200
Nonce: dj83hs9s
Nonce: dj83hs9s
The client constructs the normalized request string (the new line The client constructs the normalized request string (the new line
separator character is represented by "\n" for display purposes only; separator character is represented by "\n" for display purposes only;
the trailing new line separator signify that no extension value is the trailing new line separator signify that no extension value is
included with the request, explained below): included with the request, explained below):
1336363200\n 1336363200\n
dj83hs9s\n dj83hs9s\n
GET\n GET\n
/resource/1?b=1&a=2\n /resource/1?b=1&a=2\n
skipping to change at page 5, line 39 skipping to change at page 5, line 31
'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this
specification are to be interpreted as described in [RFC2119]. specification are to be interpreted as described in [RFC2119].
This specification uses the Augmented Backus-Naur Form (ABNF) This specification uses the Augmented Backus-Naur Form (ABNF)
notation of [I-D.ietf-httpbis-p1-messaging]. Additionally, the notation of [I-D.ietf-httpbis-p1-messaging]. Additionally, the
following rules are included from [RFC2617]: auth-param. following rules are included from [RFC2617]: auth-param.
2. Issuing MAC Credentials 2. Issuing MAC Credentials
This specification provides one method for issuing MAC credentials This specification provides one method for issuing MAC credentials
using OAuth 2.0 as described in Section 5. This specification does using OAuth 2.0 as described in Section 5. This specification does
not mandate servers to support any particular method for issuing MAC not mandate servers to support any particular method for issuing MAC
credentials, and other methods MAY be defined and used. Whenever MAC credentials, and other methods MAY be defined and used. Whenever MAC
credentials are issued, the credentials MUST include the following credentials are issued, the credentials MUST include the following
attributes: attributes:
MAC key identifier MAC key identifier
A string identifying the MAC key used to calculate the request A string identifying the MAC key used to calculate the request
MAC. The string is usually opaque to the client. The server MAC. The string is usually opaque to the client. The server
typically assigns a specific scope and lifetime to each set of typically assigns a specific scope and lifetime to each set of
MAC credentials. The identifier MAY denote a unique value used MAC credentials. The identifier MAY denote a unique value used
to retrieve the authorization information (e.g. from a to retrieve the authorization information (e.g. from a
database), or self-contain the authorization information in a database), or self-contain the authorization information in a
verifiable manner (i.e. a string consisting of some data and a verifiable manner (i.e. a string consisting of some data and a
signature). signature).
MAC key MAC key
A shared symmetric secret used as the MAC algorithm key. The A shared symmetric secret used as the MAC algorithm key. The
server MUST NOT reissue a previously issued MAC key and MAC key server MUST NOT reissue a previously issued MAC key and MAC key
identifier combination. identifier combination.
MAC algorithm MAC algorithm
A MAC algorithm used to calculate the request MAC. Value MUST A MAC algorithm used to calculate the request MAC. Value MUST
be one of "hmac-sha-1", "hmac-sha-256", or a registered be one of "hmac-sha-1", "hmac-sha-256", or a registered
extension algorithm name as described in Section 7.1. extension algorithm name as described in Section 7.1.
Algorithm names are case-sensitive. If the MAC algorithm is Algorithm names are case-sensitive. If the MAC algorithm is
not understood by the client, the client MUST NOT use the MAC not understood by the client, the client MUST NOT use the MAC
credentials and continue as if no MAC credentials were issued. credentials and continue as if no MAC credentials were issued.
The MAC key identifier, MAC key, MAC algorithm strings MUST NOT The MAC key identifier, MAC key, MAC algorithm strings MUST NOT
include characters other than: include characters other than:
%x20-21 / %x23-5B / %x5D-7E %x20-21 / %x23-5B / %x5D-7E
skipping to change at page 7, line 22 skipping to change at page 6, line 47
ext = "ext" "=" string-value ext = "ext" "=" string-value
mac = "mac" "=" string-value mac = "mac" "=" string-value
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 )
The header attributes are set as follows: The header attributes are set as follows:
id id
REQUIRED. The MAC key identifier. REQUIRED. The MAC key identifier.
ts ts
REQUIRED. The request timestamp. The value MUST be a positive REQUIRED. The request timestamp. The value MUST be a positive
integer set by the client when making each request to the integer set by the client when making each request to the
number of seconds elapsed from a fixed point in time (e.g. number of seconds elapsed from a fixed point in time (e.g.
January 1, 1970 00:00:00 GMT). The value MUST NOT include January 1, 1970 00:00:00 GMT). The value MUST NOT include
leading zeros (e.g. "000273154346"). leading zeros (e.g. "000273154346").
nonce nonce
REQUIRED. A unique string generated by the client. The value REQUIRED. A unique string generated by the client. The value
MUST be unique across all requests with the same timestamp and MUST be unique across all requests with the same timestamp and
MAC key identifier combination. MAC key identifier combination.
ext ext
OPTIONAL. A string used to include additional information OPTIONAL. A string used to include additional information which
which is covered by the request MAC. The content and format of is covered by the request MAC. The content and format of the
the string is beyond the scope of this specification. string is beyond the scope of this specification.
mac mac
REQUIRED. The HTTP request MAC as described in Section 3.2. REQUIRED. The HTTP request MAC as described in Section 3.2.
Attributes MUST NOT appear more than once. Attribute values are Attributes MUST NOT appear more than once. Attribute values are
limited to a subset of ASCII, which does not require escaping, as limited to a subset of ASCII, which does not require escaping, as
defined by the plain-string ABNF. defined by the plain-string ABNF.
3.2. Request MAC 3.2. Request MAC
The client uses the MAC algorithm and the MAC key to calculate the The client uses the MAC algorithm and the MAC key to calculate the
request MAC. This specification defines two algorithms: "hmac-sha-1" request MAC. This specification defines two algorithms: "hmac-sha-1"
and "hmac-sha-256", and provides an extension registry for additional and "hmac-sha-256", and provides an extension registry for additional
algorithms. algorithms.
3.2.1. Normalized Request String 3.2.1. Normalized Request String
The normalized request string is a consistent, reproducible The normalized request string is a consistent, reproducible
concatenation of several of the HTTP request elements into a single concatenation of several of the HTTP request elements into a single
string. By normalizing the request into a reproducible string, the string. By normalizing the request into a reproducible string, the
client and server can both calculate the request MAC over the exact client and server can both calculate the request MAC over the exact
same value. same value.
skipping to change at page 8, line 18 skipping to change at page 7, line 47
concatenation of several of the HTTP request elements into a single concatenation of several of the HTTP request elements into a single
string. By normalizing the request into a reproducible string, the string. By normalizing the request into a reproducible string, the
client and server can both calculate the request MAC over the exact client and server can both calculate the request MAC over the exact
same value. same value.
The string is constructed by concatenating together, in order, the The string is constructed by concatenating together, in order, the
following HTTP request elements, each followed by a new line following HTTP request elements, each followed by a new line
character (%x0A): character (%x0A):
1. The timestamp value calculated for the request. 1. The timestamp value calculated for the request.
2. The nonce value generated for the request. 2. The nonce value generated for the request.
3. The HTTP request method in upper case. For example: "HEAD", 3. The HTTP request method in upper case. For example: "HEAD",
"GET", "POST", etc. "GET", "POST", etc.
4. The HTTP request-URI as defined by [RFC2616] section 5.1.2. 4. The HTTP request-URI as defined by [RFC2616] section 5.1.2.
5. The hostname included in the HTTP request using the "Host" 5. The hostname included in the HTTP request using the "Host"
request header field in lower case. request header field in lower case.
6. The port as included in the HTTP request using the "Host" request 6. The port as included in the HTTP request using the "Host" request
header field. If the header field does not include a port, the header field. If the header field does not include a port, the
default value for the scheme MUST be used (e.g. 80 for HTTP and default value for the scheme MUST be used (e.g. 80 for HTTP and
443 for HTTPS). 443 for HTTPS).
7. The value of the "ext" "Authorization" request header field 7. The value of the "ext" "Authorization" request header field
attribute if one was included in the request, otherwise, an empty attribute if one was included in the request, otherwise, an empty
string. string.
Each element is followed by a new line character (%x0A) including the Each element is followed by a new line character (%x0A) including the
last element and even when an element value is an empty string. last element and even when an element value is an empty string.
For example, the HTTP request: For example, the HTTP request:
POST /request?b5=%3D%253D&a3=a&c%40=&a2=r%20b&c2&a3=2+q HTTP/1.1 POST /request?b5=%3D%253D&a3=a&c%40=&a2=r%20b&c2&a3=2+q HTTP/1.1
skipping to change at page 9, line 24 skipping to change at page 9, line 5
"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 is set to the value of the normalized request string as
described in Section 3.2.1, described in Section 3.2.1,
key key
is set to the MAC key provided by the server, and is set to the MAC key provided by the 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 octet string is base64-encoded per [RFC2045] section
6.8. 6.8.
3.2.3. hmac-sha-256 3.2.3. 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]
together with the SHA-256 hash function defined in [NIST FIPS-180-3]: together with 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 is set to the value of the normalize request string as
described in Section 3.2.1, described in Section 3.2.1,
key key
is set to the MAC key provided by the server, and is set to the MAC key provided by the 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 octet string is base64-encoded per [RFC2045] section
6.8. 6.8.
4. Verifying Requests 4. Verifying Requests
skipping to change at page 10, line 18 skipping to change at page 9, line 43
6.8. 6.8.
4. Verifying Requests 4. Verifying Requests
A server receiving an authenticated request validates it by A server receiving an authenticated request validates it by
performing the following REQUIRED steps: performing the following REQUIRED steps:
1. Recalculate the request MAC as described in Section 3.2 and 1. Recalculate the request MAC as described in Section 3.2 and
compare the request MAC to the value received from the client via compare the request MAC to the value received from the client via
the "mac" attribute. the "mac" attribute.
2. Ensure that the combination of timestamp, nonce, and MAC key 2. Ensure that the combination of timestamp, nonce, and MAC key
identifier received from the client has not been received before identifier received from the client has not been received before
in a previous request. The server MAY reject requests with stale in a previous request. The server MAY reject requests with stale
timestamps as described in Section 4.1. timestamps as described in Section 4.1.
3. Verify the scope and validity of the MAC credentials. 3. Verify the scope and validity of the MAC credentials.
If the request fails verification, the server SHOULD respond using If the request fails verification, the server SHOULD respond using
the 401 (Unauthorized) HTTP status code and include the the 401 (Unauthorized) HTTP status code and include the "WWW-
"WWW-Authenticate" response header field as described in Section 4.2. Authenticate" response header field as described in Section 4.2.
4.1. Timestamp Verification 4.1. Timestamp Verification
The timestamp, nonce, and MAC key identifier combination provide a The timestamp, nonce, and MAC key identifier combination provide a
unique identifier which enables the server to prevent replay attacks. unique identifier which enables the server to prevent replay attacks.
Without replay protection, an attacker can use a compromised (but Without replay protection, an attacker can use a compromised (but
otherwise valid and authenticated) request more than once, gaining otherwise valid and authenticated) request more than once, gaining
long term access to a protected resource. long term access to a protected resource.
Including a timestamp with the nonce removes the need to retain an Including a timestamp with the nonce removes the need to retain an
infinite number of nonce values for future checks, by enabling the infinite number of nonce values for future checks, by enabling the
server to restrict the time period after which a request with an old server to restrict the time period after which a request with an old
timestamp is rejected. If such a restriction is enforced, the server timestamp is rejected. If such a restriction is enforced, the server
skipping to change at page 12, line 7 skipping to change at page 11, line 18
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 5. Use with OAuth 2.0
OAuth 2.0 ([I-D.ietf-oauth-v2]) defines an extensible token-based OAuth 2.0 ([RFC6749]) defines an extensible token-based
authentication framework. The MAC authentication scheme can be used authentication framework. The MAC authentication scheme can be used
to make OAuth-based requests by issuing MAC-type access tokens. to make OAuth-based requests by issuing MAC-type access tokens.
This specification does not define methods for the client to This specification does not define methods for the client to
specifically request a MAC-type token from the authorization server. specifically request a MAC-type token from the authorization server.
Additionally, it does not include any discovery facilities for Additionally, it does not include any discovery facilities for
identifying which HMAC algorithms are supported by a resource server, identifying which HMAC algorithms are supported by a resource server,
or how the client may go about obtaining MAC access tokens for any or how the client may go about obtaining MAC access tokens for any
given protected resource. given protected resource.
5.1. Issuing MAC-Type Access Tokens 5.1. Issuing MAC-Type Access Tokens
Authorization servers issuing MAC-type access tokens MUST include the Authorization servers issuing MAC-type access tokens MUST include the
following parameters whenever a response includes the "access_token" following parameters whenever a response includes the "access_token"
parameter: parameter:
access_token access_token
REQUIRED. The MAC key identifier. REQUIRED. The MAC key identifier.
mac_key mac_key
REQUIRED. The MAC key. REQUIRED. The MAC key.
mac_algorithm mac_algorithm
REQUIRED. The MAC algorithm used to calculate the request MAC. REQUIRED. The MAC algorithm used to calculate the request MAC.
Value MUST be one of "hmac-sha-1", "hmac-sha-256", or a Value MUST be one of "hmac-sha-1", "hmac-sha-256", or a
registered extension algorithm name as described in registered extension algorithm name as described in Section
Section 7.1. 7.1.
For example: For example:
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Cache-Control: no-store Cache-Control: no-store
{ {
"access_token":"SlAV32hkKG", "access_token":"SlAV32hkKG",
"token_type":"mac", "token_type":"mac",
skipping to change at page 15, line 10 skipping to change at page 14, line 20
while the system waits for new entropy or else in weak (easily while the system waits for new entropy or else in weak (easily
guessable) MAC keys. When implementing this protocol, servers should guessable) MAC keys. When implementing this protocol, servers should
consider which of these presents a more serious risk for their consider which of these presents a more serious risk for their
application and design accordingly. application and design accordingly.
6.7. Timing Attacks 6.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 Service implementers are encouraged to use fixed-time string
comparators for MAC verification. comparators for MAC verification.
6.8. CSRF Attacks 6.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
skipping to change at page 16, line 8 skipping to change at page 15, line 14
The normalized request string has been designed to support the The normalized request string has been designed to support the
authentication methods defined in this specification. Those authentication methods defined in this specification. Those
designing additional methods, should evaluated the compatibility of designing additional methods, should evaluated the compatibility of
the normalized request string with their security requirements. the normalized request string with their security requirements.
Since the normalized request string does not cover the entire HTTP Since the normalized request string does not cover the entire HTTP
request, servers should employ additional mechanisms to protect such request, servers should employ additional mechanisms to protect such
elements. elements.
The request MAC does not cover entity-header fields which can often The request MAC does not cover entity-header fields which can often
affect how the request body is interpreted by the server (i.e. affect how the request body is interpreted by the server (i.e.
Content-Type). If the server behavior is influenced by the presence Content-Type). If the server behavior is influenced by the presence
or value of such header fields, an attacker can manipulate the or value of such header fields, an attacker can manipulate the
request header without being detected. request header without being detected.
7. IANA Considerations 7. IANA Considerations
7.1. The HTTP MAC Authentication Scheme Algorithm Registry 7.1. The HTTP MAC Authentication Scheme Algorithm Registry
This specification establishes the HTTP MAC authentication scheme This specification establishes the HTTP MAC authentication scheme
algorithm registry. algorithm registry.
Additional MAC algorithms are registered on the advice of one or more Additional MAC algorithms are registered on the advice of one or more
Designated Experts (appointed by the IESG or their delegate), with a Designated Experts (appointed by the IESG or their delegate), with a
Specification Required (using terminology from [RFC5226]). However, Specification Required (using terminology from [RFC5226]). However,
to allow for the allocation of values prior to publication, the to allow for the allocation of values prior to publication, the
Designated Expert(s) may approve registration once they are satisfied Designated Expert(s) may approve registration once they are satisfied
that such a specification will be published. 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 first appealed to Application Area Directors (contactable using app-
app-ads@tools.ietf.org email address or directly by looking up their 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 7.1.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 7.1.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:
skipping to change at page 17, line 41 skipping to change at page 16, line 44
7.2. OAuth Access Token Type Registration 7.2. 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 7.2.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 7.3. 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 [I-D.ietf-oauth-v2]. Parameters Registry established by [RFC6749].
7.3.1. The "mac_key" OAuth Parameter 7.3.1. The "mac_key" OAuth Parameter
Parameter name: mac_key Parameter name: mac_key
Parameter usage location: authorization response, token response
Change controller: IETF Parameter usage location: authorization response, token response
Specification document(s): [[ this document ]]
Related information: None Change controller: IETF
Specification document(s): [[ this document ]]
Related information: None
7.3.2. The "mac_algorithm" OAuth Parameter 7.3.2. The "mac_algorithm" OAuth Parameter
Parameter name: mac_algorithm Parameter name: mac_algorithm
Parameter usage location: authorization response, token response
Change controller: IETF
Specification document(s): [[ this document ]]
Related information: None
8. Acknowledgments Parameter usage location: authorization response, token response
Change controller: IETF
Specification document(s): [[ this document ]]
Related information: None
8. Contributors
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.
9. Acknowledgments
The author would like to thank Ben Adida, Adam Barth, Phil Hunt, The author would like to thank Ben Adida, Adam Barth, Phil Hunt,
Rasmus Lerdorf, James Manger, William Mills, Scott Renfro, Justin Rasmus Lerdorf, James Manger, William Mills, Scott Renfro, Justin
Richer, Toby White, Peter Wolanin, and Skylar Woodward for their Richer, Toby White, Peter Wolanin, and Skylar Woodward for their
contributions, suggestions, and feedback. contributions, suggestions, and feedback.
9. References 10. References
9.1. Normative References 10.1. Normative References
[I-D.ietf-httpbis-p1-messaging] [10] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol
Fielding, R., Gettys, J., Mogul, J., Nielsen, H., (HTTP/1.1): Message Syntax and Routing", Internet-Draft
Masinter, L., Leach, P., Berners-Lee, T., and J. Reschke, draft-ietf-httpbis-p1-messaging-21, October 2012.
"HTTP/1.1, part 1: URIs, Connections, and Message
Parsing", draft-ietf-httpbis-p1-messaging-13 (work in
progress), March 2011.
[I-D.ietf-oauth-v2] [11] Hardt, D., "The OAuth 2.0 Authorization Framework", RFC
Hammer-Lahav, E., Recordon, D., and D. Hardt, "The OAuth 6749, October 2012.
2.0 Authorization Protocol", draft-ietf-oauth-v2-15 (work
in progress), April 2011.
[NIST FIPS-180-3] [12] Hors, A., Raggett, D. and I. Jacobs, "HTML 4.01
National Institute of Standards and Technology, "Secure Specification", World Wide Web Consortium Recommendation
Hash Standard (SHS). FIPS PUB 180-3, October 2008". REC-html401-19991224, December 1999, <http://www.w3.org/TR
/1999/REC-html401-19991224>.
[RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail [13] National Institute of Standards and Technology, "Secure
Hash Standard (SHS). FIPS PUB 180-3, October 2008", .
[1] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[2] Freed, N. and N.S. 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.
[RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- [3] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed-
Hashing for Message Authentication", RFC 2104, Hashing for Message Authentication", RFC 2104, February
February 1997. 1997.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., [4] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 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.
[RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., [5] Franks, J., Hallam-Baker, P.M., Hostetler, J.L., Lawrence,
Leach, P., Luotonen, A., and L. Stewart, "HTTP S.D., Leach, P.J., 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.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform [6] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66, Resource Identifier (URI): Generic Syntax", STD 66, RFC
RFC 3986, January 2005. 3986, January 2005.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an [7] 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.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security [8] 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.
[RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, [9] Barth, A., "HTTP State Management Mechanism", RFC 6265,
April 2011. April 2011.
[W3C.REC-html401-19991224] 10.2. Informative References
Hors, A., Raggett, D., and I. Jacobs, "HTML 4.01
Specification", World Wide Web Consortium
Recommendation REC-html401-19991224, December 1999,
<http://www.w3.org/TR/1999/REC-html401-19991224>.
9.2. Informative References [1] Tschofenig, H. and P. Hunt, "OAuth 2.0 Security: Going
Beyond Bearer Tokens", Internet-Draft draft-tschofenig-
oauth-security-00, September 2012.
[RFC5849] Hammer-Lahav, E., "The OAuth 1.0 Protocol", RFC 5849, [2] Bradley, J., Hunt, P., Nadalin, A. and H. Tschofenig, "The
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,
April 2010. April 2010.
Author's Address Authors' Addresses
Eran Hammer-Lahav (editor) Justin Richer, editor
The MITRE Corporation
Email: eran@hueniverse.com Email: jricher@mitre.org
URI: http://hueniverse.com
William Mills, editor
Yahoo! Inc.
Email: wmills@yahoo-inc.com
Hannes Tschofenig, editor
Nokia Siemens Networks
Linnoitustie 6
Espoo, 02600
Finland
Phone: +358 (50) 4871445
Email: Hannes.Tschofenig@gmx.net
URI: http://www.tschofenig.priv.at
 End of changes. 84 change blocks. 
144 lines changed or deleted 195 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/