idnits 2.17.1 draft-ietf-oauth-access-token-jwt-10.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 23, 2020) is 1309 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 OAuth Working Group V. Bertocci 3 Internet-Draft Auth0 4 Intended status: Standards Track September 23, 2020 5 Expires: March 27, 2021 7 JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens 8 draft-ietf-oauth-access-token-jwt-10 10 Abstract 12 This specification defines a profile for issuing OAuth 2.0 access 13 tokens in JSON web token (JWT) format. Authorization servers and 14 resource servers from different vendors can leverage this profile to 15 issue and consume access tokens in interoperable manner. 17 Status of This Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at https://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on March 27, 2021. 34 Copyright Notice 36 Copyright (c) 2020 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (https://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 52 1.1. Requirements Notation and Conventions . . . . . . . . . . 3 53 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 54 2. JWT Access Token Header and Data Structure . . . . . . . . . 4 55 2.1. Header . . . . . . . . . . . . . . . . . . . . . . . . . 4 56 2.2. Data Structure . . . . . . . . . . . . . . . . . . . . . 4 57 2.2.1. Authentication Information Claims . . . . . . . . . . 5 58 2.2.2. Identity Claims . . . . . . . . . . . . . . . . . . . 5 59 2.2.3. Authorization Claims . . . . . . . . . . . . . . . . 6 60 2.2.3.1. Claims for Authorization Outside of Delegation 61 Scenarios . . . . . . . . . . . . . . . . . . . . 6 62 3. Requesting a JWT Access Token . . . . . . . . . . . . . . . . 7 63 4. Validating JWT Access Tokens . . . . . . . . . . . . . . . . 8 64 5. Security Considerations . . . . . . . . . . . . . . . . . . . 9 65 6. Privacy Considerations . . . . . . . . . . . . . . . . . . . 10 66 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 67 7.1. Media Type Registration . . . . . . . . . . . . . . . . . 12 68 7.1.1. Registry Content . . . . . . . . . . . . . . . . . . 12 69 7.2. Claims Registration . . . . . . . . . . . . . . . . . . . 13 70 7.2.1. Registry Contents . . . . . . . . . . . . . . . . . . 13 71 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 13 72 8.1. Normative References . . . . . . . . . . . . . . . . . . 13 73 8.2. Informative References . . . . . . . . . . . . . . . . . 15 74 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 15 75 Appendix B. Document History . . . . . . . . . . . . . . . . . . 16 76 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 20 78 1. Introduction 80 The original OAuth 2.0 Authorization Framework [RFC6749] 81 specification does not mandate any specific format for access tokens. 82 While that remains perfectly appropriate for many important 83 scenarios, in-market use has shown that many commercial OAuth 2.0 84 implementations elected to issue access tokens using a format that 85 can be parsed and validated by resource servers directly, without 86 further authorization server involvement. The approach is 87 particularly common in topologies where the authorization server and 88 resource server are not co-located, are not run by the same entity, 89 or are otherwise separated by some boundary. At the time of writing, 90 many commercial implementations leverage the JSON Web Tokens (JWT) 91 [RFC7519] format. 93 Many vendor specific JWT access tokens share the same functional 94 layout, using JWT claims to convey the information needed to support 95 a common set of use cases: token validation, transporting 96 authorization information in forms of scopes and entitlements, 97 carrying identity information about the subject, and so on. The 98 differences are mostly confined to the claim names and syntax used to 99 represent the same entities, suggesting that interoperability could 100 be easily achieved by standardizing on a common set of claims and 101 validation rules. 103 The assumption that access tokens are associated to specific 104 information doesn't appear only in commercial implementations. 105 Various specifications in the OAuth 2.0 family (such as resource 106 indicators [RFC8707], OAuth 2.0 bearer token usage [RFC6750] and 107 others) postulate the presence in access tokens of scoping 108 mechanisms, such as an audience. The family of specifications 109 associated to introspection also indirectly suggest a fundamental set 110 of information access tokens are expected to carry or at least be 111 associated with. 113 This specification aims to provide a standardized and interoperable 114 profile as an alternative to the proprietary JWT access token layouts 115 going forward. Besides defining a common set of mandatory and 116 optional claims, the profile provides clear indications on how 117 authorization request parameters determine the content of the issued 118 JWT access token, how an authorization server can publish metadata 119 relevant to the JWT access tokens it issues, and how a resource 120 server should validate incoming JWT access tokens. 122 Finally, this specification provides security and privacy 123 considerations meant to prevent common mistakes and anti patterns 124 that are likely to occur in naive use of the JWT format to represent 125 access tokens. 127 1.1. Requirements Notation and Conventions 129 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 130 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 131 "OPTIONAL" in this document are to be interpreted as described in BCP 132 14 [RFC2119] [RFC8174] when, and only when, they appear in all 133 capitals, as shown here. 135 1.2. Terminology 137 JWT access token An OAuth 2.0 access token encoded in JWT format and 138 complying with the requirements described in this specification. 140 This specification uses the terms "access token", "refresh token", 141 "authorization server", "resource server", "authorization endpoint", 142 "authorization request", "authorization response", "token endpoint", 143 "grant type", "access token request", "access token response", and 144 "client" defined by The OAuth 2.0 Authorization Framework [RFC6749]. 146 2. JWT Access Token Header and Data Structure 148 2.1. Header 150 Although JWT access tokens can use any signing algorithm, use of 151 asymmetric cryptography is RECOMMENDED as it simplifies the process 152 of acquiring validation information for resource servers (see 153 Section 4). JWT access tokens MUST NOT use "none" as the signing 154 algorithm. See Section 4 for more details. 156 This specification registers the "application/at+jwt" media type, 157 which can be used to indicate that the content is a JWT access token. 158 JWT access tokens MUST include this media type in the "typ" header 159 parameter to explicitly declare that the JWT represents an access 160 token complying with this profile. Per the definition of "typ" in 161 Section 4.1.9 of [RFC7515], it is RECOMMENDED that the "application/" 162 prefix be omitted. Therefore, the "typ" value used SHOULD be 163 "at+jwt". See the security considerations section for details on the 164 importance of preventing OpenID Connect ID Tokens from being accepted 165 as access tokens by resource servers implementing this profile. 167 2.2. Data Structure 169 The following claims are used in the JWT access token data structure. 171 iss REQUIRED - as defined in Section 4.1.1 of [RFC7519]. 173 exp REQUIRED - as defined in Section 4.1.4 of [RFC7519]. 175 aud REQUIRED - as defined in Section 4.1.3 of [RFC7519]. See 176 Section 3 for indications on how an authorization server should 177 determine the value of "aud" depending on the request. 179 sub REQUIRED - as defined in Section 4.1.2 of [RFC7519]. In case of 180 access tokens obtained through grants where a resource owner is 181 involved, such as the authorization code grant, the value of "sub" 182 SHOULD correspond to the subject identifier of the resource owner. 183 In case of access tokens obtained through grants where no resource 184 owner is involved, such as the client credentials grant, the value 185 of "sub" SHOULD correspond to an identifier the authorization 186 server uses to indicate the client application.See Section 5 for 187 more details on this scenario. Also, see Section 6 for a 188 discussion about how different choices in assigning "sub" values 189 can impact privacy. 191 client_id REQUIRED - as defined in Section 4.3 of [RFC8693]. 193 iat REQUIRED - as defined in Section 4.1.6 of [RFC7519]. This claim 194 identifies the time at which the JWT access token was issued. 196 jti REQUIRED - as defined in Section 4.1.7 of [RFC7519]. 198 2.2.1. Authentication Information Claims 200 The claims listed in this section MAY be issued in the context of 201 authorization grants involving the resource owner, and reflect in the 202 access token the types and strength of authentication that the 203 authentication server enforced prior to returning the authorization 204 response to the client. Their values are fixed, and remain the same 205 across all access tokens that derive from a given authorization 206 response, whether the access token was obtained directly in the 207 response (e.g., via the implicit flow) or after one or more token 208 exchanges (e.g., obtaining a fresh access token using a refresh 209 token, or exchanging one access token for another via [RFC8693]). 211 auth_time OPTIONAL - as defined in Section 2 of [OpenID.Core]. 213 acr, amr OPTIONAL - as defined in Section 2 of [OpenID.Core]. 215 2.2.2. Identity Claims 217 In the context of authorization grants involving the resource owner, 218 commercial authorization servers will often include resource owner 219 attributes directly in access tokens, so that resource servers can 220 consume them directly for authorization or other purposes without any 221 further round trips to introspection ( [RFC7662]) or userinfo ( 222 [OpenID.Core]) endpoints. This is particularly common in scenarios 223 where the client and the resource server belong to the same entity 224 and are part of the same solution, as is the case for first party 225 clients invoking their own backend API. 227 This profile does not introduce any mechanism for a client to 228 directly request the presence of specific claims in JWT access 229 tokens, as the authorization server can determine what additional 230 claims are required by a particular resource server by taking in 231 consideration the client_id of the client, the "scope" and the 232 "resource" parameters included in the request. 234 Any additional attributes whose semantics are well described by the 235 attribute's description found in Section 5.1 of [OpenID.Core] SHOULD 236 be codified in JWT access tokens via the corresponding claim names in 237 that section of the OpenID Connect specification. The same holds for 238 attributes defined in [RFC7662] and other identity related 239 specifications registering claims in the JSON Web Token (JWT) IANA 240 registry introduced in [RFC7519]. 242 Authorization servers MAY return arbitrary attributes not defined in 243 any existing specification, as long as the corresponding claim names 244 are collision resistant or the access tokens are meant to be used 245 only within a private subsystem. Please refer to Sections 4.2 and 246 4.3 of [RFC7519] for details. 248 Authorization servers including resource owner attributes in JWT 249 access tokens should exercise care and verify that all privacy 250 requirements are met, as discussed in Section 6. 252 2.2.3. Authorization Claims 254 If an authorization request includes a scope parameter, the 255 corresponding issued JWT access token SHOULD include a "scope" claim 256 as defined in Section 4.2 of [RFC8693]. 258 All the individual scope strings in the "scope" claim MUST have 259 meaning for the resources indicated in the "aud" claim. See 260 Section 5 for more considerations about the relationship between 261 scope strings and resources indicated by the "aud" claim. 263 2.2.3.1. Claims for Authorization Outside of Delegation Scenarios 265 Many authorization servers embed in the access tokens they issue 266 authorization attributes that go beyond the delegated scenarios 267 described by [RFC7519]. Typical examples include resource owner 268 memberships in roles and groups that are relevant to the resource 269 being accessed, entitlements assigned to the resource owner for the 270 targeted resource that the authorization server knows about, and so 271 on. 273 An authorization server wanting to include such attributes in a JWT 274 access token SHOULD use as claim types the "groups","roles" and 275 "entitlements" attributes of the "User" resource schema defined by 276 Section 4.1.2 of [RFC7643]). 278 Authorization servers SHOULD encode the corresponding claim values 279 according to the guidance defined in [RFC7643]. In particular, a 280 non-normative example of "groups" attribute can be found in 281 Section 8.2 of [RFC7643]. No specific vocabulary is provided for 282 "roles" and "entitlements". 284 Section 7 of this document provides entries for registering "groups", 285 "roles" and "entitlements" attributes from [RFC7643] as claim types 286 to be used in this profile. 288 3. Requesting a JWT Access Token 290 An authorization server can issue a JWT access token in response to 291 any authorization grant defined by [RFC6749] and subsequent 292 extensions meant to result in an access token. 294 If the request includes a "resource" parameter (as defined in 295 [RFC8707]), the resulting JWT access token "aud" claim SHOULD have 296 the same value as the "resource" parameter in the request. 298 Example request below: 300 GET /as/authorization.oauth2?response_type=code 301 &client_id=s6BhdRkqt3& 302 state=laeb 303 &scope=openid%20profile%20reademail 304 &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb 305 &resource=https%3A%2F%2Frs.example.com%2F HTTP/1.1 306 Host: authorization-server.example.com 308 Figure 1: Authorization Request with Resource and Scope Parameters 310 Once redeemed, the code obtained from the request above will result 311 in a JWT access token in the form shown below: 313 Header: 315 {"typ":"at+JWT","alg":"RS256","kid":"RjEwOwOA"} 317 Claims: 319 { 320 "iss": "https://authorization-server.example.com/", 321 "sub": " 5ba552d67", 322 "aud": "https://rs.example.com/", 323 "exp": 1544645174, 324 "client_id": "s6BhdRkqt3_", 325 "scope": "openid profile reademail" 326 } 328 Figure 2: The Header and JWT Claims Set of a JWT Access Token 330 The authorization server MUST NOT issue a JWT access token if the 331 authorization granted by the token would be ambiguous. See Section 5 332 for more details about common cases that might lead to ambiguity and 333 strategies an authorization server can enact to prevent them. 335 If the request does not include a "resource" parameter, the 336 authorization server MUST use in the "aud" claim a default resource 337 indicator. If a "scope" parameter is present in the request, the 338 authorization server SHOULD use it to infer the value of the default 339 resource indicator to be used in the "aud" claim. The mechanism 340 through which scopes are associated to default resource indicator 341 values is outside the scope of this specification. If the values in 342 the "scope" parameter refer to different default resource indicator 343 values, the authorization server SHOULD reject the request with 344 "invalid_scope" as described in Section 4.1.2.1 of [RFC6749]. 346 4. Validating JWT Access Tokens 348 For the purpose of facilitating validation data retrieval, it is 349 RECOMMENDED that authorization servers sign JWT access tokens with an 350 asymmetric algorithm. 352 Authorization servers SHOULD use OAuth 2.0 Authorization Server 353 Metadata [RFC8414] to advertise to resource servers their signing 354 keys via "jwks_uri" and what "iss" claim value to expect via the 355 issuer metadata value. Alternatively, authorization servers 356 implementing OpenID Connect MAY use the OpenID Connect discovery 357 document for the same purpose. If an authorization server supports 358 both OAuth 2.0 Authorization Server Metadata and OpenID Connect 359 discovery, the values provided MUST be consistent across the two 360 publication methods. 362 An authorization server MAY elect to use different keys to sign 363 OpenID Connect ID Tokens and JWT access tokens. This specification 364 does not provide a mechanism for identifying a specific key as the 365 one used to sign JWT access tokens. An authorization server can sign 366 JWT access tokens with any of the keys advertised via AS metadata or 367 OpenID Connect discovery. See Section 5 for further guidance on 368 security implications. 370 Resource servers receiving a JWT access token MUST validate it in the 371 following manner. 373 o The resource server MUST verify that the typ header value is 374 "at+jwt" or "application/at+jwt" and reject tokens carrying any 375 other value. 377 o If the JWT access token is encrypted, decrypt it using the keys 378 and algorithms that the resource server specified during 379 registration. If encryption was negotiated with the authorization 380 server at registration time and the incoming JWT access token is 381 not encrypted, the resource server SHOULD reject it. 383 o The Issuer Identifier for the authorization server (which is 384 typically obtained during discovery) MUST exactly match the value 385 of the "iss" claim. 387 o The resource server MUST validate that the "aud" claim contains a 388 resource indicator value corresponding to an identifier the 389 resource server expects for itself. The JWT access token MUST be 390 rejected if "aud" does not contain a resource indicator of the 391 current resource server as a valid audience. 393 o The resource server MUST validate the signature of all incoming 394 JWT access tokens according to [RFC7515] using the algorithm 395 specified in the JWT alg Header Parameter. The resource server 396 MUST reject any JWT in which the value of "alg" is "none". The 397 resource server MUST use the keys provided by the authorization 398 server. 400 o The current time MUST be before the time represented by the "exp" 401 claim. 403 The resource server MUST handle errors as described in Section 3.1 of 404 [RFC6750]. In particular, in case of any failure in the validation 405 checks listed above the authorization server response MUST include 406 the error code "invalid_token". 408 If the JWT access token includes authorization claims as described in 409 Section 2.2.3, the resource server SHOULD use them in combination 410 with any other contextual information available to determine whether 411 the current call should be authorized or rejected. Details about how 412 a resource server performs those checks is beyond the scope of this 413 profile specification. 415 5. Security Considerations 417 The JWT access token data layout described here is very similar to 418 the one of the id_token as defined by [OpenID.Core]. The explicit 419 typing required in this profile, in line with the recommendations in 420 [RFC8725] helps the resource server to distinguish between JWT access 421 tokens and OpenID Connect ID Tokens. 423 Authorization servers should prevent scenarios where clients can 424 affect the value of the "sub" claim in ways that could confuse 425 resource servers. For example, if the authorization server elects to 426 use the client_id as the "sub" value for access tokens issued client 427 credentials grant, the authorization server should prevent clients to 428 register an arbitrary client_id value, as this would allow malicious 429 clients to select the sub of a high privilege resource owner and 430 confuse any authorization logic on the resource server relying on the 431 "sub" value. For more details please refer to Section 4.13 of 432 [OAuth2.Security.BestPractices]. 434 To preventing cross-JWT confusion, authorization servers MUST use a 435 distinct identifier as "aud" claim value to uniquely identify access 436 tokens issued by the same issuer for distinct resources. For more 437 details on cross-JWT confusion please refer to Section 2.8 of 438 [RFC8725]. 440 Authorization servers should use particular care when handling 441 requests that might lead to ambiguous authorization grants. For 442 example: if a request includes multiple resource indicators, the 443 authorization server should ensure that each scope string included in 444 the resulting JWT access token, if any, can be unambiguously 445 correlated to a specific resource among the ones listed in the "aud" 446 claim. The details on how to recognize and mitigate this and other 447 ambiguous situations is highly scenario-dependent, hence out of scope 448 for this profile. 450 Authorization servers should not rely on the use of different keys 451 for signing OpenID Connect ID Tokens and JWT tokens as a method to 452 safeguard against the consequences of leaking specific keys. Given 453 that resource servers have no way of knowing what key should be used 454 to validate JWT access tokens in particular, they have to accept 455 signatures performed with any of the keys published in AS metadata or 456 OpenID Connect discovery: consequently, an attacker just needs to 457 compromise any key among the ones published to be able to generate 458 and sign JWTs that will be accepted as valid by the resource server. 460 6. Privacy Considerations 462 As JWT access tokens carry information by value, it now becomes 463 possible for clients and potentially even end users to directly peek 464 inside the token claims collection. 466 The client MUST NOT inspect the content of the access token: the 467 authorization server and the resource server might decide to change 468 token format at any time (for example by switching from this profile 469 to opaque tokens) hence any logic in the client relying on the 470 ability to read the access token content would break without 471 recourse. The OAuth 2.0 framework assumes that access tokens are 472 treated as opaque by clients. Administrators of authorization 473 servers should also take into account that the content of an access 474 token is visible to the client. Whenever client access to the access 475 token content presents privacy issues for a given scenario, the 476 authorization server should take explicit steps to prevent it. 478 In scenarios in which JWT access tokens are accessible to the end 479 user, it should be evaluated whether the information can be accessed 480 without privacy violations (for example, if an end user would simply 481 access his or her own personal information) or if steps must be taken 482 to enforce confidentiality. 484 Possible measures to prevent leakage of information to clients and 485 end users include: encrypting the access token, encrypting the 486 sensitive claims, omitting the sensitive claims or not using this 487 profile, falling back on opaque access tokens. 489 In every scenario, the content of the JWT access token will 490 eventually be accessible to the resource server. It's important to 491 evaluate whether the resource server gained the proper entitlement to 492 have access to any content received in form of claims, for example 493 through user consent in some form, policies and agreements with the 494 organization running the authorization servers, and so on. 496 This profile mandates the presence of the "sub" claim in every JWT 497 access token, making it possible for resource servers to rely on that 498 information for correlating incoming requests with data stored 499 locally for the authenticated principal. Although the ability to 500 correlate requests might be required by design in many scenarios, 501 there are scenarios where the authorization server might want to 502 prevent correlation. The "sub" claim should be populated by the 503 authorization servers according to a privacy impact assessment. For 504 instance, if a solution requires preventing tracking principal 505 activities across multiple resource servers, the authorization server 506 should ensure that JWT access tokens meant for different resource 507 servers have distinct "sub" values that cannot be correlated in the 508 event of resource servers collusion. Similarly, if a solution 509 requires preventing a resource server from correlating the 510 principal's activity within the resource itself, the authorization 511 server should assign different "sub" values for every JWT access 512 token issued. In turn, the client should obtain a new JWT access 513 token for every call to the resource server, to ensure that the 514 resource server receives different "sub" and "jti" values at every 515 call, thus preventing correlation between distinct requests. 517 7. IANA Considerations 518 7.1. Media Type Registration 520 7.1.1. Registry Content 522 This section registers the "application/at+jwt" media type [RFC2046] 523 in the "Media Types" registry [IANA.MediaTypes] in the manner 524 described in [RFC6838], which can be used to indicate that the 525 content is an access token encoded in JWT format. 527 o Type name: application 529 o Subtype name: at+jwt 531 o Required parameters: N/A 533 o Optional parameters: N/A 535 o Encoding considerations: binary; JWT values are encoded as a 536 series of base64url-encoded values (with trailing '=' characters 537 removed), some of which may be the empty string, separated by 538 period ('.') characters. 540 o Security considerations: See the Security Considerations 541 Section of [[TODO: update once there's a RFC number for the JWT AT 542 profile]] 544 o Interoperability considerations: N/A 546 o Published specification: [[TODO: update once there's a RFC number 547 for the JWT AT profile]] 549 o Applications that use this media type: Applications that access 550 resource servers using OAuth 2.0 access tokens encoded in JWT 551 format 553 o Fragment identifier considerations: N/A 555 o Additional information: Magic number(s): N/A File extension(s): N/ 556 A Macintosh file type code(s): N/A 558 o Person and email address to contact for further information: 559 Vittorio Bertocci, vittorio@auth0.com 561 o Intended usage: COMMON 563 o Restrictions on usage: none 565 o Author: Vittorio Bertocci, vittorio@auth0.com 566 o Change controller: IESG 568 o Provisional registration? No 570 7.2. Claims Registration 572 Section 2.2.3.1 of this specification refers to the attributes 573 "roles", "groups", "entitlements" defined in [RFC7643] to express 574 authorization information in JWT access tokens. This section 575 registers those attributes as claims in the JSON Web Token (JWT) IANA 576 registry introduced in [RFC7519]. 578 7.2.1. Registry Contents 580 o Claim Name: "roles" 582 o Claim Description: Roles 584 o Change Controller: IESG 586 o Specification Document(s): Section 4.1.2 of [RFC7643] and 587 Section 2.2.3.1 of [[this specification]] 589 o Claim Name: "groups" 591 o Claim Description: Groups 593 o Change Controller: IESG 595 o Specification Document(s): Section 4.1.2 of [RFC7643] and 596 Section 2.2.3.1 of [[this specification]] 598 o Claim Name: "entitlements" 600 o Claim Description: Entitlements 602 o Change Controller: IESG 604 o Specification Document(s): Section 4.1.2 of [RFC7643] and 605 Section 2.2.3.1 of [[this specification]] 607 8. References 609 8.1. Normative References 611 [OpenID.Core] 612 Sakimura, N., Bradley, J., Jones, M., Medeiros, B., and C. 613 Mortimore, "OpenID Connect Core 1.0", November 2014. 615 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 616 Extensions (MIME) Part Two: Media Types", RFC 2046, 617 DOI 10.17487/RFC2046, November 1996, 618 . 620 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 621 Requirement Levels", BCP 14, RFC 2119, 622 DOI 10.17487/RFC2119, March 1997, 623 . 625 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 626 RFC 6749, DOI 10.17487/RFC6749, October 2012, 627 . 629 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 630 Specifications and Registration Procedures", BCP 13, 631 RFC 6838, DOI 10.17487/RFC6838, January 2013, 632 . 634 [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 635 Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May 636 2015, . 638 [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token 639 (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, 640 . 642 [RFC7643] Hunt, P., Ed., Grizzle, K., Wahlstroem, E., and C. 643 Mortimore, "System for Cross-domain Identity Management: 644 Core Schema", RFC 7643, DOI 10.17487/RFC7643, September 645 2015, . 647 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 648 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 649 May 2017, . 651 [RFC8414] Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0 652 Authorization Server Metadata", RFC 8414, 653 DOI 10.17487/RFC8414, June 2018, 654 . 656 [RFC8693] Jones, M., Nadalin, A., Campbell, B., Ed., Bradley, J., 657 and C. Mortimore, "OAuth 2.0 Token Exchange", RFC 8693, 658 DOI 10.17487/RFC8693, January 2020, 659 . 661 [RFC8707] Campbell, B., Bradley, J., and H. Tschofenig, "Resource 662 Indicators for OAuth 2.0", RFC 8707, DOI 10.17487/RFC8707, 663 February 2020, . 665 [RFC8725] Sheffer, Y., Hardt, D., and M. Jones, "JSON Web Token Best 666 Current Practices", BCP 225, RFC 8725, 667 DOI 10.17487/RFC8725, February 2020, 668 . 670 8.2. Informative References 672 [OAuth2.Security.BestPractices] 673 Lodderstedt, T., Bradley, J., Labunets, A., and D. Fett, 674 "OAuth 2.0 Security Best Current Practice", July 2019. 676 [RFC6750] Jones, M. and D. Hardt, "The OAuth 2.0 Authorization 677 Framework: Bearer Token Usage", RFC 6750, 678 DOI 10.17487/RFC6750, October 2012, 679 . 681 [RFC7662] Richer, J., Ed., "OAuth 2.0 Token Introspection", 682 RFC 7662, DOI 10.17487/RFC7662, October 2015, 683 . 685 Appendix A. Acknowledgements 687 The initial set of requirements informing this specification was 688 extracted by numerous examples of access tokens issued in JWT format 689 by production systems. Thanks to Dominick Baier (IdentityServer), 690 Brian Campbell (Ping Identity), Daniel Dobalian (Microsoft), Karl 691 Guinness (Okta) for providing sample tokens issued by their products 692 and services. Brian Campbell and Filip Skokan provided early 693 feedback that shaped the direction of the specification. This 694 profile was discussed at lenght during the OAuth Security Workshop 695 2019, with several individuals contributing ideas and feedback. The 696 author would like to acknowledge the contributions of: 698 John Bradley, Brian Campbell, Vladimir Dzhuvinov, Torsten 699 Lodderstedt, Nat Sakimura, Hannes Tschofenig and everyone who 700 actively participated in the unconference discussions. 702 The following individuals contributed useful feedback and insights on 703 the drafts, both on the IETF OAuth 2.0 WG DL and during the IIW28 704 conference: 706 Dale Olds, George Fletcher, David Waite, Michael Engan, Mike Jones, 707 Hans Zandbelt, Vladimir Dzhuvinov, Martin Schanzenbach , Aaron 708 Parecki, Annabelle Richard Backman, Dick Hardt, Denis Pinkas, 709 Benjamin Kaduk, Dominick Baier, Mike Jones and everyone who actively 710 participated in the IIW28 unconference discussions and the IETF OAuth 711 2.0 WG DL discussions. 713 Appendix B. Document History 715 [[ to be removed by the RFC Editor before publication as an RFC ]] 717 draft-ietf-oauth-access-token-jwt-10 719 o Updated Figure 2 in Section 3 to clarify that the intent of that 720 snippet is to describe the content rather than exact JWT AT 721 format. 722 o Updated registry references in Section 7.2.1 to point to 723 Section 2.2.3.1 724 o Modified Section 2.2.3.1 to make it easier for the reader to 725 understand what values and format is expected for the groups, 726 roles and entitlement claims. Minor formatting issues fixed. 728 draft-ietf-oauth-access-token-jwt-09 730 o Removed unused reference to http://www.iana.org/assignments/oauth- 731 parameters; moved the OAuth2 security BCP to the informative 732 references section. 733 o Restructured opening paragraphs in Section 6 for clarity. 735 draft-ietf-oauth-access-token-jwt-08 737 o Numerous edits for correcting typos, improving clarity and 738 precision of language. 739 o Moved RFC7519 to the normative section; eliminated unused 740 references RFC7644 and RFC3986. 742 draft-ietf-oauth-access-token-jwt-07 744 o In Section 2.1, added language that forbids use of none as alg 745 value, and references Section 4 where the same prohibition was 746 already expressed from the RS perspective. 747 o In the sub definition in Section 2.2, added a sentence that 748 clarifies what goes in the sub in the case of grants where a 749 resource owner is involved. 750 o Updated acknowledgements. 751 o Updated Section 2.2.1 to clarify that acr, amr and auth_type can 752 occur if the AT has been obtained by grants where the resource 753 owner is involved. 754 o Updated Section 2.2.2 to clarify that identity claims can occur if 755 the AT has been obtained by grants where the resource owner is 756 involved. 758 o In Section 2.2.3.1 eliminated the claim that SCIM doesn't provide 759 a vocabulary for the attributes listed there. 760 o In Section 5 added reference to 8725. 761 o In Section 4 added application/jwt+at as accepted typ value. 762 o Various typos and formatting issues fixed. 764 draft-ietf-oauth-access-token-jwt-06 766 o In Section 2.2 and Section 6 added a discussion about how 767 different sub values affect the privacy properties of a solution. 768 o In Section 2.2.3 and Section 3 eliminated language prohibiting JWT 769 AT requests featuring multiple resources, substituting it with the 770 prohibition for the AS to emit JWT ATs expressing ambiguous 771 authorization grants. In Section 5, added language warning 772 against scope confusion and mentioned the existence of other 773 ambiguous authorization grant. 774 o In Section 2.2 promoted claims iat and jti from RECOMMENDED to 775 REQUIRED. 776 o In Section 2.1 eliminated temporary note on the lack of 777 authenticated encryption methods specifications. 778 o Updated acknowledgements. 780 draft-ietf-oauth-access-token-jwt-05 782 o Varios typos, grammar issues and improper abbreviations fixed. 783 o Reworded the definition of at+jwt in Section 2.1. 784 o In Section 2.2, clarified that iat refers to the issuance time of 785 the JWT itself. 786 o In Section 2.2.2, added a reference to public/private claims 787 definitions (Sections 4.2, 4.3) of [RFC7519]. 788 o In Section 3, removed the paragrah stating that every JWT AT MUST 789 have an aud, as it is already defined in Section 2.2. 790 o Reworded description of the JWT AT adoption landscape in 791 Section 1. 792 o Simplified the individual descriptions of the claims list in 793 Section 2.2.1. 794 o Updated Section 4 and Section 5 to clarify that the AS can use any 795 of the published keys to sign JWT access tokens, and that the AS 796 should not rely on use of different signing keys per token type as 797 a security mechanism. 798 o In Section 2.2 promoted claims iat and jti from OPTIONAL to 799 RECOMMENDED 800 o In Section 4, switched the validation steps list type from numbers 801 to bullets. 802 o In Section 4, eliminated the auth_time instructions from the 803 validation steps list. 804 o In Section 2.2.2, added a reference to the JWT claims registry as 805 source of claims for JWT ATs 807 o In Section 4, clarified that failures in JWT AT validation checks 808 will result in invalid_token. 810 draft-ietf-oauth-access-token-jwt-04 812 o Eliminated reference to resource aliases list from the aud claim 813 description in Section 2. 814 o Eliminated references to resource aliases list from the aud 815 validation guidance in Section 4. 816 o Introduced a new subsection Section 2.2.1, moved the definitions 817 of auth_time, acr and amr there and incorporated the language 818 proposed by Annabelle and Brian on the WG mailing list. 819 o In section Section 3 softened (from MUST to SHOULD) the 820 requirement that ties the resource identifier in the request to 821 the value in the aud claim of the issued access token. 822 o Updated acknowledgements. 823 o In the section Section 3, the example request now has 824 response_type=code. 825 o Updated text in the Privacy Consideration section to clarify what 826 protection steps the text refers to. 827 o Updated the typ header discussion in Section 2.1 to clarify that 828 it helps preventing resources from accepting OpenID Connect ID 829 Tokens as JWT access tokens. 830 o Updated refrences to token exchange, resource indicators and JWT 831 best practices to reflect their RFC status (8693,8707,8725). 833 draft-ietf-oauth-access-token-jwt-03 835 o Varios typos fixed. 836 o In the security considerations section, relaxed the claim that the 837 typ header value "at+jwt" will prevent RS from misinterpreting JWT 838 ATs as idtokens. 839 o In the "Requesting JWT Access Tokens" section, added 840 "invalid_target" as a possible error returned for the multiple 841 resources request case. 842 o In the Validating JWT Access Tokens" section, disallowed JWTs with 843 "alg":"none" 844 o in the IANA registration entries for the SCIM claim types, 845 complemented the reference to the SCIM spec with a reference to 846 this spec so that the eventual registration entries have better 847 context. 848 o Updated acknowledgements. 849 o In the section Section 3, the example request now has 850 response_type=code. 851 o Updated text in the Privacy Consideration section to clarify what 852 protection steps the text refers to. 854 draft-ietf-oauth-access-token-jwt-02 855 o In 2.2.1, opened the sources of identity attributes to any 856 identity related specification. 857 o In 2.2.2, relaxed from MUST to SHOULD the requirement that 858 requests including a scope always result in access tkens 859 containing a corresponding scope claim. 860 o In the security considerations setting, added a requirement for 861 the authorization server to assing unique identifiers for 862 different resources- to prevent cross JWT confusion. 863 o Added IANA registration for the authorization attributes borrowed 864 from SCIM CORE 866 draft-ietf-oauth-access-token-jwt-01 868 o Added note on authenticated encryption. 869 o Added a mention to the 1st party clients scenarios in the identity 870 claims section. 871 o Changed the definition reference for the iss, exp, aud, sub, iat 872 claims from OpenID.Core to RFC7519. 873 o Added a mention of the client_id==sub case in the security 874 considerations section, added a reference to draft-ietf-oauth- 875 security-topics-13. Added a reference to the security 876 considerations from the sub claim definition section. 877 o Specified invalid_request as the error code the authorization 878 server should return in case of multiple resources in the access 879 token request. 880 o Specified invalid_scope as the error code the authorization server 881 should return in case it isn;t possible to determine to which 882 resource the requested scopes refers to. 883 o In the identity claims section, added a reference to introspection 884 as possible source of claim types and added language explicitly 885 stating that the AS can add arbitrary attributes as long as they 886 are collision resistant or private. 887 o Updated language for the auth_time claim to include the case in 888 which the AS reauthenticates the user mid-session (e.g. during 889 step up auth). 890 o Removed note about adding a mechanism for extablishing whether the 891 token was obtained on behalf or the resource owner or of the 892 client itself (client credentials grant). 893 o Removed note about adding a mechanism for indicating whether the 894 authorization server sent the resource owner to authenticate with 895 a federated identity provider, and the identity of that federated 896 provider. 897 o Removed the note in the security consideration sections about 898 discussing the purpose of aud, iss, exp validation (redundant). 899 o In the authorization claims section, stated intent to register 900 roles, groups and entitlements as claim types in IANA 901 o Clarified in the privacy considerations that clients should not 902 inspect access tokens. 904 o Expanded the privacy considerations with more explicit guidance 905 about privacy preserving approaches. 906 o Added IANA registry content for the at+JWT MIME type. 907 o Updated acknowledgements. 909 draft-ietf-oauth-access-token-jwt-00 911 o Initial draft to define a JWTt profile for OAuth 2.0 access 912 tokens. 914 Author's Address 916 Vittorio Bertocci 917 Auth0 919 Email: vittorio@auth0.com