draft-ietf-ace-cbor-web-token-00.txt | draft-ietf-ace-cbor-web-token-01.txt | |||
---|---|---|---|---|
ACE Working Group E. Wahlstroem | ACE Working Group E. Wahlstroem | |||
Internet-Draft Nexus Technology | Internet-Draft | |||
Intended status: Informational M. Jones | Intended status: Informational M. Jones | |||
Expires: November 21, 2016 Microsoft | Expires: January 8, 2017 Microsoft | |||
H. Tschofenig | H. Tschofenig | |||
ARM Ltd. | ARM Ltd. | |||
May 20, 2016 | S. Erdtman | |||
Spotify AB | ||||
July 7, 2016 | ||||
CBOR Web Token (CWT) | CBOR Web Token (CWT) | |||
draft-ietf-ace-cbor-web-token-00 | draft-ietf-ace-cbor-web-token-01 | |||
Abstract | Abstract | |||
CBOR Web Token (CWT) is a compact means of representing claims to be | CBOR Web Token (CWT) is a compact means of representing claims to be | |||
transferred between two parties. CWT is a profile of the JSON Web | transferred between two parties. CWT is a profile of the JSON Web | |||
Token (JWT) that is optimized for constrained devices. The claims in | Token (JWT) that is optimized for constrained devices. The claims in | |||
a CWT are encoded in the Concise Binary Object Representation (CBOR) | a CWT are encoded in the Concise Binary Object Representation (CBOR) | |||
and CBOR Object Signing and Encryption (COSE) is used for added | and CBOR Object Signing and Encryption (COSE) is used for added | |||
application layer security protection. A claim is a piece of | application layer security protection. A claim is a piece of | |||
information asserted about a subject and is represented as a name/ | information asserted about a subject and is represented as a name/ | |||
skipping to change at page 1, line 40 ¶ | skipping to change at page 1, line 42 ¶ | |||
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 November 21, 2016. | This Internet-Draft will expire on January 8, 2017. | |||
Copyright Notice | Copyright Notice | |||
Copyright (c) 2016 IETF Trust and the persons identified as the | Copyright (c) 2016 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/license-info) in effect on the date of | (http://trustee.ietf.org/license-info) in effect on the date of | |||
publication of this document. Please review these documents | publication of this document. Please review these documents | |||
carefully, as they describe your rights and restrictions with respect | carefully, as they describe your rights and restrictions with respect | |||
to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
include Simplified BSD License text as described in Section 4.e of | include Simplified BSD License text as described in Section 4.e of | |||
the Trust Legal Provisions and are provided without warranty as | the Trust Legal Provisions and are provided without warranty as | |||
described in the Simplified BSD License. | described in the Simplified BSD License. | |||
Table of Contents | Table of Contents | |||
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 | 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
3. Claims . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 | 3. Claims . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
3.1. Claim Names . . . . . . . . . . . . . . . . . . . . . . . 4 | 3.1. Claim Names . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
3.1.1. iss (Issuer) Claim . . . . . . . . . . . . . . . . . 4 | 3.1.1. iss (Issuer) Claim . . . . . . . . . . . . . . . . . 4 | |||
3.1.2. sub (Subject) Claim . . . . . . . . . . . . . . . . . 4 | 3.1.2. sub (Subject) Claim . . . . . . . . . . . . . . . . . 4 | |||
3.1.3. aud (Audience) Claim . . . . . . . . . . . . . . . . 4 | 3.1.3. aud (Audience) Claim . . . . . . . . . . . . . . . . 4 | |||
3.1.4. exp (Expiration Time) Claim . . . . . . . . . . . . . 4 | 3.1.4. exp (Expiration Time) Claim . . . . . . . . . . . . . 5 | |||
3.1.5. nbf (Not Before) Claim . . . . . . . . . . . . . . . 4 | 3.1.5. nbf (Not Before) Claim . . . . . . . . . . . . . . . 5 | |||
3.1.6. iat (Issued At) Claim . . . . . . . . . . . . . . . . 5 | 3.1.6. iat (Issued At) Claim . . . . . . . . . . . . . . . . 5 | |||
3.1.7. cti (CWT ID) Claim . . . . . . . . . . . . . . . . . 5 | 3.1.7. cti (CWT ID) Claim . . . . . . . . . . . . . . . . . 5 | |||
4. Summary of the values, CBOR major types and encoded claim | 4. Summary of the values, CBOR major types and encoded claim | |||
keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 | keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
5. Security Considerations . . . . . . . . . . . . . . . . . . . 5 | 5. Creating and Validating CWTs . . . . . . . . . . . . . . . . 6 | |||
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 | 5.1. Creating a CWT . . . . . . . . . . . . . . . . . . . . . 6 | |||
7. Normative References . . . . . . . . . . . . . . . . . . . . 6 | 5.2. Validating a CWT . . . . . . . . . . . . . . . . . . . . 7 | |||
Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 6 | 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 | |||
A.1. CWT with "aud" and symmetric key . . . . . . . . . . . . 7 | 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 | |||
A.2. CWT with "aud" and EC key . . . . . . . . . . . . . . . . 8 | 7.1. CBOR Web Token (CWT) Claims Registry . . . . . . . . . . 8 | |||
A.3. Full CWT . . . . . . . . . . . . . . . . . . . . . . . . 10 | 7.1.1. Registration Template . . . . . . . . . . . . . . . . 8 | |||
Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 12 | 7.1.2. Initial Registry Contents . . . . . . . . . . . . . . 9 | |||
Appendix C. Document History . . . . . . . . . . . . . . . . . . 12 | 7.2. CoAP Content-Format Registration . . . . . . . . . . . . 10 | |||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 13 | 7.2.1. Registry Contents . . . . . . . . . . . . . . . . . . 10 | |||
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 | ||||
8.1. Normative References . . . . . . . . . . . . . . . . . . 11 | ||||
8.2. Informative References . . . . . . . . . . . . . . . . . 12 | ||||
Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 12 | ||||
A.1. CWT with "aud" and symmetric key . . . . . . . . . . . . 12 | ||||
A.2. CWT with "aud" and EC key . . . . . . . . . . . . . . . . 13 | ||||
A.3. Full CWT . . . . . . . . . . . . . . . . . . . . . . . . 15 | ||||
Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 18 | ||||
Appendix C. Document History . . . . . . . . . . . . . . . . . . 19 | ||||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 19 | ||||
1. Introduction | 1. Introduction | |||
The JSON Web Token (JWT) [5] is a standardized security token format | The JSON Web Token (JWT) [RFC7519] is a standardized security token | |||
that has found use in OAuth 2.0 and OpenID Connect deployments, among | format that has found use in OAuth 2.0 and OpenID Connect | |||
other applications. JWT uses JSON Web Signatures (JWS) [3] and JSON | deployments, among other applications. JWT uses JSON Web Signatures | |||
Web Encryption (JWE) [4] to secure the contents of the JWT, which is | (JWS) [RFC7515] and JSON Web Encryption (JWE) [RFC7516] to secure the | |||
a set of claims represented in JSON [5]. The use of JSON for | contents of the JWT, which is a set of claims represented in JSON | |||
encoding information is popular for Web and native applications, but | [RFC7519]. The use of JSON for encoding information is popular for | |||
it is considered inefficient for some Internet of Things (IoT) | Web and native applications, but it is considered inefficient for | |||
systems that use low power radio technologies. | some Internet of Things (IoT) systems that use low power radio | |||
technologies. | ||||
In this document an alternative encoding of claims is defined. | In this document an alternative encoding of claims is defined. | |||
Instead of using JSON, as provided by JWTs, this specification uses | Instead of using JSON, as provided by JWTs, this specification uses | |||
CBOR [6] and calls this new structure "CBOR Web Token (CWT)", which | CBOR [RFC7049] and calls this new structure "CBOR Web Token (CWT)", | |||
is a compact means of representing secured claims to be transferred | which is a compact means of representing secured claims to be | |||
between two parties. CWT is closely related to JWT. It references | transferred between two parties. CWT is closely related to JWT. It | |||
the JWT claims and both its name and pronunciation are derived from | references the JWT claims and both its name and pronunciation are | |||
JWT. To protect the claims contained in CWTs, the CBOR Object | derived from JWT. To protect the claims contained in CWTs, the CBOR | |||
Signing and Encryption (COSE) [7] specification is used. | Object Signing and Encryption (COSE) [I-D.ietf-cose-msg] | |||
specification is used. | ||||
The suggested pronunciation of CWT is the same as the English word | The suggested pronunciation of CWT is the same as the English word | |||
"cot". | "cot". | |||
2. Terminology | 2. Terminology | |||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | |||
"OPTIONAL" in this document are to be interpreted as described in | "OPTIONAL" in this document are to be interpreted as described in | |||
"Key words for use in RFCs to Indicate Requirement Levels" [1]. | "Key words for use in RFCs to Indicate Requirement Levels" [RFC2119]. | |||
This document reuses terminology from JWT [5] and COSE [7]. | This document reuses terminology from JWT [RFC7519] and COSE | |||
[I-D.ietf-cose-msg]. | ||||
Type3StringOrURI: | Type3StringOrURI: | |||
The "Type3StringOrURI" term has the same meaning, syntax, and | The "Type3StringOrURI" term has the same meaning, syntax, and | |||
processing rules as the "StringOrUri" term defined in Section 2 of | processing rules as the "StringOrUri" term defined in Section 2 of | |||
JWT [5], except that Type3StringOrURI uses CBOR major type 3 | JWT [RFC7519], except that Type3StringOrURI uses CBOR major type 3 | |||
instead of a JSON string value. | instead of a JSON string value. | |||
FIXME: Use tag 32 for URIs? | ||||
Type6NumericDate: | Type6NumericDate: | |||
The "Type6NumericDate" term has the same meaning, syntax, and | The "Type6NumericDate" term has the same meaning, syntax, and | |||
processing rules as the "NumericDate" term defined in Section 2 of | processing rules as the "NumericDate" term defined in Section 2 of | |||
JWT [5], except that Type6NumericDate uses CBOR major type 6, with | JWT [RFC7519], except that Type6NumericDate uses CBOR major type | |||
tag value 1, instead of a numeric JSON value. | 6, with tag value 1, instead of a numeric JSON value. | |||
CBOR encoded claim key: | CBOR encoded claim key: | |||
The key used to identify a claim value. | The key used to identify a claim value. | |||
3. Claims | 3. Claims | |||
The set of claims that a CWT must contain to be considered valid is | The set of claims that a CWT must contain to be considered valid is | |||
context dependent and is outside the scope of this specification. | context dependent and is outside the scope of this specification. | |||
Specific applications of CWTs will require implementations to | Specific applications of CWTs will require implementations to | |||
skipping to change at page 4, line 20 ¶ | skipping to change at page 4, line 31 ¶ | |||
None of the claims defined below are intended to be mandatory to use | None of the claims defined below are intended to be mandatory to use | |||
or implement. They rather provide a starting point for a set of | or implement. They rather provide a starting point for a set of | |||
useful, interoperable claims. Applications using CWTs should define | useful, interoperable claims. Applications using CWTs should define | |||
which specific claims they use and when they are required or | which specific claims they use and when they are required or | |||
optional. | optional. | |||
3.1.1. iss (Issuer) Claim | 3.1.1. iss (Issuer) Claim | |||
The "iss" (issuer) claim has the same meaning, syntax, and processing | The "iss" (issuer) claim has the same meaning, syntax, and processing | |||
rules as the "iss" claim defined in Section 4.1.1 of JWT [5], except | rules as the "iss" claim defined in Section 4.1.1 of JWT [RFC7519], | |||
that the format MUST be a Type3StringOrURI. The CBOR encoded claim | except that the format MUST be a Type3StringOrURI. The CBOR encoded | |||
key 1 MUST be used to identify this claim. | claim key 1 MUST be used to identify this claim. | |||
3.1.2. sub (Subject) Claim | 3.1.2. sub (Subject) Claim | |||
The "sub" (subject) claim has the same meaning, syntax, and | The "sub" (subject) claim has the same meaning, syntax, and | |||
processing rules as the "sub" claim defined in Section 4.1.2 of JWT | processing rules as the "sub" claim defined in Section 4.1.2 of JWT | |||
[5], except that the format MUST be a Type3StringOrURI. The CBOR | [RFC7519], except that the format MUST be a Type3StringOrURI. The | |||
encoded claim key 2 MUST be used to identify this claim. | CBOR encoded claim key 2 MUST be used to identify this claim. | |||
3.1.3. aud (Audience) Claim | 3.1.3. aud (Audience) Claim | |||
The "aud" (audience) claim has the same meaning, syntax, and | The "aud" (audience) claim has the same meaning, syntax, and | |||
processing rules as the "aud" claim defined in Section 4.1.3 of JWT | processing rules as the "aud" claim defined in Section 4.1.3 of JWT | |||
[5], except that the format MUST be a Type3StringOrURI. The CBOR | [RFC7519], except that the format MUST be a Type3StringOrURI. The | |||
encoded claim key 3 MUST be used to identify this claim. | CBOR encoded claim key 3 MUST be used to identify this claim. | |||
3.1.4. exp (Expiration Time) Claim | 3.1.4. exp (Expiration Time) Claim | |||
The "exp" (expiration time) claim has the same meaning, syntax, and | The "exp" (expiration time) claim has the same meaning, syntax, and | |||
processing rules as the "exp" claim defined in Section 4.1.4 of JWT | processing rules as the "exp" claim defined in Section 4.1.4 of JWT | |||
[5], except that the format MUST be a Type6NumericDate. The CBOR | [RFC7519], except that the format MUST be a Type6NumericDate. The | |||
encoded claim key 4 MUST be used to identify this claim. | CBOR encoded claim key 4 MUST be used to identify this claim. | |||
3.1.5. nbf (Not Before) Claim | 3.1.5. nbf (Not Before) Claim | |||
The "nbf" (not before) claim has the same meaning, syntax, and | The "nbf" (not before) claim has the same meaning, syntax, and | |||
processing rules as the "nbf" claim defined in Section 4.1.5 of JWT | processing rules as the "nbf" claim defined in Section 4.1.5 of JWT | |||
[5], except that the format MUST be a Type6NumericDate. The CBOR | [RFC7519], except that the format MUST be a Type6NumericDate. The | |||
encoded claim key 5 MUST be used to identify this claim. | CBOR encoded claim key 5 MUST be used to identify this claim. | |||
3.1.6. iat (Issued At) Claim | 3.1.6. iat (Issued At) Claim | |||
The "iat" (issued at) claim has the same meaning, syntax, and | The "iat" (issued at) claim has the same meaning, syntax, and | |||
processing rules as the "iat" claim defined in Section 4.1.6 of JWT | processing rules as the "iat" claim defined in Section 4.1.6 of JWT | |||
[5], except that the format MUST be a Type6NumericDate. The CBOR | [RFC7519], except that the format MUST be a Type6NumericDate. The | |||
encoded claim key 6 MUST be used to identify this claim. | CBOR encoded claim key 6 MUST be used to identify this claim. | |||
3.1.7. cti (CWT ID) Claim | 3.1.7. cti (CWT ID) Claim | |||
The "cti" (CWT ID) claim has the same meaning, syntax, and processing | The "cti" (CWT ID) claim has the same meaning, syntax, and processing | |||
rules as the "jti" claim defined in Section 4.1.7 of JWT [5], except | rules as the "jti" claim defined in Section 4.1.7 of JWT [RFC7519], | |||
that the format MUST be of major type 3 with a case-sensitive string | except that the format MUST be of major type 2, binary string. The | |||
value. The CBOR encoded claim key 7 MUST be used to identify this | CBOR encoded claim key 7 MUST be used to identify this claim. | |||
claim. | ||||
4. Summary of the values, CBOR major types and encoded claim keys | 4. Summary of the values, CBOR major types and encoded claim keys | |||
/---------+------------------------+--------------------------\ | /---------+------------------------+--------------------------\ | |||
| Claim | CBOR encoded claim key | CBOR major type of value | | | Claim | CBOR encoded claim key | CBOR major type of value | | |||
|---------+------------------------+--------------------------| | |---------+------------------------+--------------------------| | |||
| iss | 1 | 3 | | | iss | 1 | 3 | | |||
| sub | 2 | 3 | | | sub | 2 | 3 | | |||
| aud | 3 | 3 | | | aud | 3 | 3 | | |||
| exp | 4 | 6 tag value 1 | | | exp | 4 | 6 tag value 1 | | |||
| nbf | 5 | 6 tag value 1 | | | nbf | 5 | 6 tag value 1 | | |||
| iat | 6 | 6 tag value 1 | | | iat | 6 | 6 tag value 1 | | |||
| cti | 7 | 3 | | | cti | 7 | 2 | | |||
\---------+------------------------+--------------------------/ | \---------+------------------------+--------------------------/ | |||
Figure 1: Summary of the values, CBOR major types and encoded claim | Figure 1: Summary of the values, CBOR major types and encoded claim | |||
keys. | keys. | |||
Note: Claims defined by the OpenID Foundation have not yet been | 5. Creating and Validating CWTs | |||
included in the table above. | ||||
5. Security Considerations | 5.1. Creating a CWT | |||
To create a CWT, the following steps are performed. The order of the | ||||
steps is not significant in cases where there are no dependencies | ||||
between the inputs and outputs of the steps. | ||||
1. Create a CWT Claims Set containing the desired claims. | ||||
2. Let the Message be the binary representation of the CWT Claims | ||||
Set. | ||||
3. Create a COSE Header containing the desired set of Header | ||||
Parameters. The CWT Header MUST be a valid according to the | ||||
[I-D.ietf-cose-msg] specification. | ||||
4. Depending upon whether the CWT is signed, MACed or encrypted, | ||||
there are three cases: | ||||
* If the CWT is signed, create a COSE_Sign/COSE_Sign1 object | ||||
using the Message as the COSE_Sign/COSE_Sign1 Payload; all | ||||
steps specified in [I-D.ietf-cose-msg] for creating a | ||||
COSE_Sign/COSE_Sign1 object MUST be followed. | ||||
* Else, if the CWT is MACed, create a COSE_Mac/COSE_Mac0 object | ||||
using the Message as the COSE_Mac/COSE_Mac0 Payload; all steps | ||||
specified in [I-D.ietf-cose-msg] for creating a COSE_Mac/ | ||||
COSE_Mac0 object MUST be followed. | ||||
* Else, if the CWT is a COSE_Encrypt/COSE_Encrypt0 object, | ||||
create a COSE_Encrypt/COSE_Encrypt0 using the Message as the | ||||
plaintext for the COSE_Encrypt/COSE_Encrypt0 object; all steps | ||||
specified in [I-D.ietf-cose-msg] for creating a COSE_Encrypt/ | ||||
COSE_Encrypt0 object MUST be followed. | ||||
5. If a nested signing, MACing or encryption operation will be | ||||
performed, let the Message be the COSE_Sign/COSE_Sign1, COSE_Mac/ | ||||
COSE_Mac0 or COSE_Encrypt/COSE_Encrypt0, and return to Step 3, | ||||
using "content type" header value of "CWT" in the new COSE Header | ||||
created in that step. | ||||
Note: If integrity (signing/MACing) and confidentiality | ||||
(encryption) protection are needed, it is recommended to use an | ||||
authenticated encryption algorithm to save space and processing. | ||||
5.2. Validating a CWT | ||||
When validating a CWT, the following steps are performed. The order | ||||
of the steps is not significant in cases where there are no | ||||
dependencies between the inputs and outputs of the steps. If any of | ||||
the listed steps fail, then the CWT MUST be rejected -- that is, | ||||
treated by the application as an invalid input. | ||||
1. Verify that the CWT is a valid CBOR object. | ||||
2. Verify that the resulting COSE Header includes only parameters | ||||
and values whose syntax and semantics are both understood and | ||||
supported or that are specified as being ignored when not | ||||
understood. | ||||
3. Use the CBOR tag to determine the type the CWT, COSE_Sign/ | ||||
COSE_Sign1, COSE_Mac/COSE_Mac0 or COSE_Encrypt/COSE_Encrypt0. | ||||
4. Depending upon whether the CWT is a COSE_Sign/COSE_Sign1, | ||||
COSE_Mac/COSE_Mac0 or COSE_Encrypt/COSE_Encrypt0, there are three | ||||
cases: | ||||
* If the CWT is a COSE_Sign/COSE_Sign1, follow the steps | ||||
specified in [I-D.ietf-cose-msg] Section 4 (Signing Objects) | ||||
for validating a COSE_Sign/COSE_Sign1 object. Let the Message | ||||
be the COSE_Sign/COSE_Sign1 payload. | ||||
* Else, if the CWT is a COSE_Mac/COSE_Mac0, follow the steps | ||||
specified in [I-D.ietf-cose-msg] Section 6 (MAC Objects) for | ||||
validating a COSE_Mac/COSE_Mac0 object. Let the Message be | ||||
the COSE_Mac/COSE_Mac0 payload. | ||||
* Else, if the CWT is a COSE_Encrypt/COSE_Encrypt0 object, | ||||
follow the steps specified in [I-D.ietf-cose-msg] Section 5 | ||||
(Encryption Objects) for validating a COSE_Encrypt/ | ||||
COSE_Encrypt0 object. Let the Message be the resulting | ||||
plaintext. | ||||
5. If the JOSE Header contains a "content type" value of "CWT", then | ||||
the Message is a CWT that was the subject of nested signing or | ||||
encryption operations. In this case, return to Step 1, using the | ||||
Message as the CWT. | ||||
6. Verify that the Message is a valid CBOR object; let the CWT | ||||
Claims Set be this CBOR object. | ||||
6. Security Considerations | ||||
The security of the CWT is dependent on the protection offered by | The security of the CWT is dependent on the protection offered by | |||
COSE. Without protecting the claims contained in a CWT an adversary | COSE. Without protecting the claims contained in a CWT an adversary | |||
is able to modify, add or remove claims. Since the claims conveyed | is able to modify, add or remove claims. Since the claims conveyed | |||
in a CWT are used to make authorization decisions it is not only | in a CWT are used to make authorization decisions it is not only | |||
important to protect the CWT in transit but also to ensure that the | important to protect the CWT in transit but also to ensure that the | |||
recipient is able to authenticate the party that collected the claims | recipient is able to authenticate the party that collected the claims | |||
and created the CWT. Without trust of the recipient in the party | and created the CWT. Without trust of the recipient in the party | |||
that created the CWT no sensible authorization decision can be made. | that created the CWT no sensible authorization decision can be made. | |||
Furthermore, the creator of the CWT needs to carefully evaluate each | Furthermore, the creator of the CWT needs to carefully evaluate each | |||
claim value prior to including it in the CWT so that the recipient | claim value prior to including it in the CWT so that the recipient | |||
can be assured about the correctness of the provided information. | can be assured about the correctness of the provided information. | |||
6. IANA Considerations | 7. IANA Considerations | |||
This section will create a registry for CWT claims, possibly relating | 7.1. CBOR Web Token (CWT) Claims Registry | |||
them to the JWT Claims Registry. | ||||
7. Normative References | This section establishes the IANA "CBOR Web Token (CWT) Claims" | |||
registry. | ||||
[1] Bradner, S., "Key words for use in RFCs to Indicate | Values are registered on a Specification Required [RFC5226] basis, on | |||
the advice of one or more Designated Experts. However, to allow for | ||||
the allocation of values prior to publication, the Designated Experts | ||||
may approve registration once they are satisfied that such a | ||||
specification will be published. | ||||
Criteria that should be applied by the Designated Experts includes | ||||
determining whether the proposed registration duplicates existing | ||||
functionality, whether it is likely to be of general applicability or | ||||
whether it is useful only for a single application, and whether the | ||||
registration description is clear. | ||||
7.1.1. Registration Template | ||||
Claim Name: | ||||
The human-readable name requested (e.g., "iss"). | ||||
Claim Description: | ||||
Brief description of the claim (e.g., "Issuer"). | ||||
JWT Claim Name: | ||||
Claim Name of the equivalent JWT claim as registered in | ||||
[IANA.JWT.Claims]. CWT claims should normally have a | ||||
corresponding JWT claim. If a corresponding JWT claim would not | ||||
make sense, the Designated Experts can choose to accept | ||||
registrations for which the JWT Claim Name is listed as "N/A". | ||||
CBOR Key Value: | ||||
Key value for the claim. The key value MUST be an integer in the | ||||
range of 1 to 65536. | ||||
CBOR Major Type: | ||||
CBOR Major type and optional tag for the claim. | ||||
Change Controller: | ||||
For Standards Track RFCs, list the "IESG". For others, give the | ||||
name of the responsible party. Other details (e.g., postal | ||||
address, email address, home page URI) may also be included. | ||||
Specification Document(s): | ||||
Reference to the document or documents that specify the parameter, | ||||
preferably including URIs that can be used to retrieve copies of | ||||
the documents. An indication of the relevant sections may also be | ||||
included but is not required. | ||||
7.1.2. Initial Registry Contents | ||||
o Claim Name: "iss" | ||||
o Claim Description: Issuer | ||||
o JWT Claim Name: "iss" | ||||
o CBOR Key Value: 1 | ||||
o CBOR Major Type: 3 | ||||
o Change Controller: IESG | ||||
o Specification Document(s): Section 3.1.1 of [[ this specification | ||||
]] | ||||
o Claim Name: "sub" | ||||
o Claim Description: Subject | ||||
o JWT Claim Name: "sub" | ||||
o CBOR Key Value: 2 | ||||
o CBOR Major Type: 3 | ||||
o Change Controller: IESG | ||||
o Specification Document(s): Section 3.1.2 of [[ this specification | ||||
]] | ||||
o Claim Name: "aud" | ||||
o Claim Description: Audience | ||||
o JWT Claim Name: "aud" | ||||
o CBOR Key Value: 3 | ||||
o CBOR Major Type: 3 | ||||
o Change Controller: IESG | ||||
o Specification Document(s): Section 3.1.3 of [[ this specification | ||||
]] | ||||
o Claim Name: "exp" | ||||
o Claim Description: Expiration Time | ||||
o JWT Claim Name: "exp" | ||||
o CBOR Key Value: 4 | ||||
o CBOR Major Type: 6, tag value 1 | ||||
o Change Controller: IESG | ||||
o Specification Document(s): Section 3.1.4 of [[ this specification | ||||
]] | ||||
o Claim Name: "nbf" | ||||
o Claim Description: Not Before | ||||
o JWT Claim Name: "nbf" | ||||
o CBOR Key Value: 5 | ||||
o CBOR Major Type: 6, tag value 1 | ||||
o Change Controller: IESG | ||||
o Specification Document(s): Section 3.1.5 of [[ this specification | ||||
]] | ||||
o Claim Name: "iat" | ||||
o Claim Description: Issued At | ||||
o JWT Claim Name: "iat" | ||||
o CBOR Key Value: 6 | ||||
o CBOR Major Type: 6, tag value 1 | ||||
o Change Controller: IESG | ||||
o Specification Document(s): Section 3.1.6 of [[ this specification | ||||
]] | ||||
o Claim Name: "cti" | ||||
o Claim Description: CWT ID | ||||
o JWT Claim Name: "jti" | ||||
o CBOR Key Value: 7 | ||||
o CBOR Major Type: 2 | ||||
o Change Controller: IESG | ||||
o Specification Document(s): Section 3.1.7 of [[ this specification | ||||
]] | ||||
7.2. CoAP Content-Format Registration | ||||
This section registers the "application/cwt" CoAP Content-Format ID | ||||
in the "CoRE Parameters" sub-registry "CoAP Content-Format" in the | ||||
manner described in [RFC7252]. | ||||
7.2.1. Registry Contents | ||||
o Media Type: application/cwt | ||||
o Encoding: - | ||||
o Id: TBD (maybe 61) | ||||
o Reference: [[ this specification ]] | ||||
8. References | ||||
8.1. Normative References | ||||
[I-D.ietf-cose-msg] | ||||
Schaad, J., "CBOR Object Signing and Encryption (COSE)", | ||||
draft-ietf-cose-msg-14 (work in progress), June 2016. | ||||
[IANA.JWT.Claims] | ||||
IANA, "JSON Web Token Claims", | ||||
<http://www.iana.org/assignments/jwt>. | ||||
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | ||||
Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
<http://www.rfc-editor.org/info/rfc2119>. | <http://www.rfc-editor.org/info/rfc2119>. | |||
[2] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data | [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an | |||
IANA Considerations Section in RFCs", BCP 26, RFC 5226, | ||||
DOI 10.17487/RFC5226, May 2008, | ||||
<http://www.rfc-editor.org/info/rfc5226>. | ||||
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object | ||||
Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, | ||||
October 2013, <http://www.rfc-editor.org/info/rfc7049>. | ||||
[RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data | ||||
Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March | Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March | |||
2014, <http://www.rfc-editor.org/info/rfc7159>. | 2014, <http://www.rfc-editor.org/info/rfc7159>. | |||
[3] Jones, M., Bradley, J., and N. Sakimura, "JSON Web | [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained | |||
Application Protocol (CoAP)", RFC 7252, | ||||
DOI 10.17487/RFC7252, June 2014, | ||||
<http://www.rfc-editor.org/info/rfc7252>. | ||||
[RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web | ||||
Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May | Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May | |||
2015, <http://www.rfc-editor.org/info/rfc7515>. | 2015, <http://www.rfc-editor.org/info/rfc7515>. | |||
[4] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", | [RFC7516] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", | |||
RFC 7516, DOI 10.17487/RFC7516, May 2015, | RFC 7516, DOI 10.17487/RFC7516, May 2015, | |||
<http://www.rfc-editor.org/info/rfc7516>. | <http://www.rfc-editor.org/info/rfc7516>. | |||
[5] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token | [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token | |||
(JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, | (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, | |||
<http://www.rfc-editor.org/info/rfc7519>. | <http://www.rfc-editor.org/info/rfc7519>. | |||
[6] Bormann, C. and P. Hoffman, "Concise Binary Object | 8.2. Informative References | |||
Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, | ||||
October 2013, <http://www.rfc-editor.org/info/rfc7049>. | ||||
[7] Schaad, J., "CBOR Encoded Message Syntax", draft-ietf- | ||||
cose-msg-12 (work in progress), May 2016. | ||||
[8] Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and | [I-D.seitz-ace-oauth-authz] | |||
Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and | ||||
H. Tschofenig, "Authorization for the Internet of Things | H. Tschofenig, "Authorization for the Internet of Things | |||
using OAuth 2.0", draft-seitz-ace-oauth-authz-00 (work in | using OAuth 2.0", draft-seitz-ace-oauth-authz-00 (work in | |||
progress), October 2015. | progress), October 2015. | |||
Appendix A. Examples | Appendix A. Examples | |||
Three examples of CWTs follow. | Three examples of CWTs follow. | |||
A.1. CWT with "aud" and symmetric key | A.1. CWT with "aud" and symmetric key | |||
skipping to change at page 7, line 25 ¶ | skipping to change at page 12, line 37 ¶ | |||
[ // COSE_Key is a CBOR map with an array of keys | [ // COSE_Key is a CBOR map with an array of keys | |||
{ | { | |||
"kty":4, // symmetric key is indicated using kty 4 | "kty":4, // symmetric key is indicated using kty 4 | |||
"k": "loremipsum" // the symmetric key | "k": "loremipsum" // the symmetric key | |||
} | } | |||
] | ] | |||
} | } | |||
Figure 2: "aud" claim and symmetric key in non-normative JSON | Figure 2: "aud" claim and symmetric key in non-normative JSON | |||
Using the CBOR encoded claim keys according to Section 4 and COSE [7] | Using the CBOR encoded claim keys according to Section 4 and COSE | |||
makes a CWT with "aud" and a symmetric key look like this in CBOR | [I-D.ietf-cose-msg] makes a CWT with "aud" and a symmetric key look | |||
diagnostic notation: | like this in CBOR diagnostic notation: | |||
{ | { | |||
3: "coap://light.example.com", | 3: "coap://light.example.com", | |||
8: | 8: | |||
[ | [ | |||
{ | { | |||
1: 4, | 1: 4, | |||
-1: "loremipsum" | -1: "loremipsum" | |||
} | } | |||
] | ] | |||
skipping to change at page 8, line 44 ¶ | skipping to change at page 14, line 21 ¶ | |||
"kid": "11", | "kid": "11", | |||
"crv": 1, // using P-384 | "crv": 1, // using P-384 | |||
"x": h'bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff', | "x": h'bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff', | |||
"y": h'20138bf82dc1b6d562be0fa54ab7804a3a64b6d72ccfed6b6fb6ed28bbfc117e' | "y": h'20138bf82dc1b6d562be0fa54ab7804a3a64b6d72ccfed6b6fb6ed28bbfc117e' | |||
} | } | |||
] | ] | |||
} | } | |||
Figure 5: "aud" claim and EC key in non-normative JSON | Figure 5: "aud" claim and EC key in non-normative JSON | |||
Using the CBOR encoded claim keys according to Section 4 and COSE [7] | Using the CBOR encoded claim keys according to Section 4 and COSE | |||
makes a CWT with "aud" and an EC key look like this in CBOR | [I-D.ietf-cose-msg] makes a CWT with "aud" and an EC key look like | |||
diagnostic notation: | this in CBOR diagnostic notation: | |||
{ | { | |||
3: "coap://light.example.com", | 3: "coap://light.example.com", | |||
8: | 8: | |||
[ | [ | |||
{ | { | |||
1: 2, | 1: 2, | |||
2: "11", | 2: "11", | |||
-1: 1, | -1: 1, | |||
-2: h'bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff', | -2: h'bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff', | |||
skipping to change at page 10, line 33 ¶ | skipping to change at page 16, line 28 ¶ | |||
"crv": 1, // using P-384 | "crv": 1, // using P-384 | |||
"x": h'bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff', | "x": h'bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff', | |||
"y": h'20138bf82dc1b6d562be0fa54ab7804a3a64b6d72ccfed6b6fb6ed28bbfc117e' | "y": h'20138bf82dc1b6d562be0fa54ab7804a3a64b6d72ccfed6b6fb6ed28bbfc117e' | |||
} | } | |||
], | ], | |||
"aif": [["/s/light", 1], ["/a/led", 5], ["/dtls", 2]] | "aif": [["/s/light", 1], ["/a/led", 5], ["/dtls", 2]] | |||
} | } | |||
Figure 8: All claims, "aif" and EC key in non-normative JSON | Figure 8: All claims, "aif" and EC key in non-normative JSON | |||
Using the CBOR encoded claim keys according to Section 4 and COSE [7] | Using the CBOR encoded claim keys according to Section 4 and COSE | |||
makes a full CWT look like this in CBOR diagnostic notation: | [I-D.ietf-cose-msg] makes a full CWT look like this in CBOR | |||
diagnostic notation: | ||||
{ | { | |||
1: "coap://as.example.com", | 1: "coap://as.example.com", | |||
3: "coap://light.example.com", | 3: "coap://light.example.com", | |||
2: "erikw", | 2: "erikw", | |||
4: 1(1444064944), | 4: 1(1444064944), | |||
5: 1(1443944944), | 5: 1(1443944944), | |||
6: 1(1443944944), | 6: 1(1443944944), | |||
7: 2929, | 7: 2929, | |||
8: [ | 8: [ | |||
skipping to change at page 12, line 41 ¶ | skipping to change at page 18, line 41 ¶ | |||
2f64746c73 # "/dtls" | 2f64746c73 # "/dtls" | |||
02 # unsigned(2) | 02 # unsigned(2) | |||
Figure 10: Full CWT with EC in CBOR | Figure 10: Full CWT with EC in CBOR | |||
Size of the CWT with an EC key is 194 bytes. This is then packaged | Size of the CWT with an EC key is 194 bytes. This is then packaged | |||
signed and encrypted using COSE. | signed and encrypted using COSE. | |||
Appendix B. Acknowledgements | Appendix B. Acknowledgements | |||
A straw man proposal of CWT was written in the draft "Authorization | This specification is based on JSON Web Token (JWT) [RFC7519], the | |||
for the Internet of Things using OAuth 2.0" [8] with the help of | authors of which also include Nat Sakimura and John Bradley. A straw | |||
Ludwig Seitz, Goeran Selander, and Samuel Erdtman. | man proposal of CWT was written in the draft "Authorization for the | |||
Internet of Things using OAuth 2.0" [I-D.seitz-ace-oauth-authz] with | ||||
the help of Ludwig Seitz and Goeran Selander. | ||||
Appendix C. Document History | Appendix C. Document History | |||
[[ to be removed by the RFC Editor before publication as an RFC ]] | [[ to be removed by the RFC Editor before publication as an RFC ]] | |||
-01 | ||||
o Added IANA registration for CWT Claims. | ||||
o Added IANA registration for the application/cwt CoAP content- | ||||
format type. | ||||
o Added Samuel Erdtman as an editor. | ||||
o Changed Erik's e-mail address. | ||||
-00 | -00 | |||
o Created the initial working group version based on draft- | o Created the initial working group version based on draft- | |||
wahlstroem-ace-cbor-web-token-00. | wahlstroem-ace-cbor-web-token-00. | |||
Authors' Addresses | Authors' Addresses | |||
Erik Wahlstroem | Erik Wahlstroem | |||
Nexus Technology | ||||
Sweden | Sweden | |||
Email: erik.wahlstrom@nexusgroup.com | Email: erik@wahlstromstekniska.se | |||
URI: https://www.nexusgroup.com | ||||
Michael B. Jones | Michael B. Jones | |||
Microsoft | Microsoft | |||
Email: mbj@microsoft.com | Email: mbj@microsoft.com | |||
URI: http://self-issued.info/ | URI: http://self-issued.info/ | |||
Hannes Tschofenig | Hannes Tschofenig | |||
ARM Ltd. | ARM Ltd. | |||
Hall in Tirol 6060 | Hall in Tirol 6060 | |||
Austria | Austria | |||
Email: Hannes.Tschofenig@arm.com | Email: Hannes.Tschofenig@arm.com | |||
Samuel Erdtman | ||||
Spotify AB | ||||
Birger Jarlsgatan 61, 4tr | ||||
Stockholm 113 56 | ||||
Sweden | ||||
Phone: +46702691499 | ||||
Email: erdtman@spotify.com | ||||
End of changes. 47 change blocks. | ||||
93 lines changed or deleted | 346 lines changed or added | |||
This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |