JWT access tokens
MUST be signed. Although JWT access tokens can use any signing algorithm, use of asymmetric cryptography is
RECOMMENDED as it simplifies the process of acquiring validation information for resource servers (see
Section 4). JWT access tokens
MUST NOT use "none" as the signing algorithm. See
Section 4 for more details.
Authorization servers and resource servers conforming to this specification
MUST include RS256 (as defined in [
RFC 7518]) among their supported signature algorithms.
This specification registers the "application/at+jwt" media type, which can be used to indicate that the content is a JWT access token. JWT access tokens
MUST include this media type in the "typ" header parameter to explicitly declare that the JWT represents an access token complying with this profile. Per the definition of "typ" in
Section 4.1.9 of
RFC 7515, it is
RECOMMENDED that the "application/" prefix be omitted. Therefore, the "typ" value used
SHOULD be "at+jwt". See the [
Security Considerations] section for details on the importance of preventing OpenID Connect ID Tokens (as defined by Section 2 of [
OpenID.Core]) from being accepted as access tokens by resource servers implementing this profile.
The following claims are used in the JWT access token data structure.
-
iss
-
REQUIRED - as defined in Section 4.1.1 of RFC 7519.
-
exp
-
REQUIRED - as defined in Section 4.1.4 of RFC 7519.
-
aud
-
REQUIRED - as defined in Section 4.1.3 of RFC 7519. See Section 3 for indications on how an authorization server should determine the value of "aud" depending on the request.
-
sub
-
REQUIRED - as defined in Section 4.1.2 of RFC 7519. In cases of access tokens obtained through grants where a resource owner is involved, such as the authorization code grant, the value of "sub" SHOULD correspond to the subject identifier of the resource owner. In cases of access tokens obtained through grants where no resource owner is involved, such as the client credentials grant, the value of "sub" SHOULD correspond to an identifier the authorization server uses to indicate the client application. See Section 5 for more details on this scenario. Also, see Section 6 for a discussion about how different choices in assigning "sub" values can impact privacy.
-
client_id
-
REQUIRED - as defined in Section 4.3 of RFC 8693.
-
iat
-
REQUIRED - as defined in Section 4.1.6 of RFC 7519. This claim identifies the time at which the JWT access token was issued.
-
jti
-
REQUIRED - as defined in Section 4.1.7 of RFC 7519.
The claims listed in this section
MAY be issued in the context of authorization grants involving the resource owner and reflect the types and strength of authentication in the access token that the authentication server enforced prior to returning the authorization response to the client. Their values are fixed and remain the same across all access tokens that derive from a given authorization response, whether the access token was obtained directly in the response (e.g., via the implicit flow) or after one or more token exchanges (e.g., obtaining a fresh access token using a refresh token or exchanging one access token for another via [
RFC 8693] procedures).
-
auth_time
-
OPTIONAL - as defined in Section 2 of [OpenID.Core].
-
acr
-
OPTIONAL - as defined in Section 2 of [OpenID.Core].
-
amr
-
OPTIONAL - as defined in Section 2 of [OpenID.Core].
In the context of authorization grants involving the resource owner, commercial authorization servers will often include resource owner attributes directly in access tokens so that resource servers can consume them directly for authorization or other purposes without any further round trips to introspection ([
RFC 7662]) or UserInfo ([
OpenID.Core]) endpoints. This is particularly common in scenarios where the client and the resource server belong to the same entity and are part of the same solution, as is the case for first-party clients invoking their own backend API.
This profile does not introduce any mechanism for a client to directly request the presence of specific claims in JWT access tokens, as the authorization server can determine what additional claims are required by a particular resource server by taking the client_id of the client and the "scope" and the "resource" parameters included in the request into consideration.
Any additional identity attribute whose semantic is well described by an entry in the "JSON Web Token (JWT)" IANA registry introduced in [
RFC 7519]
SHOULD be encoded using the corresponding claim name, if that attribute is to be included in the JWT access token. Note that the JWT IANA registry includes the claims found in Section 5.1 of [
OpenID.Core].
Authorization servers
MAY return arbitrary attributes not defined in any existing specification, as long as the corresponding claim names are collision resistant or the access tokens are meant to be used only within a private subsystem. Please refer to Sections
4.2 and
4.3 of [
RFC 7519] for details.
Authorization servers including resource owner attributes in JWT access tokens need to exercise care and verify that all privacy requirements are met, as discussed in
Section 6.
If an authorization request includes a scope parameter, the corresponding issued JWT access token
SHOULD include a "scope" claim as defined in
Section 4.2 of
RFC 8693.
All the individual scope strings in the "scope" claim
MUST have meaning for the resources indicated in the "aud" claim. See
Section 5 for more considerations about the relationship between scope strings and resources indicated by the "aud" claim.
Many authorization servers embed authorization attributes that go beyond the delegated scenarios described by [
RFC 7519] in the access tokens they issue. Typical examples include resource owner memberships in roles and groups that are relevant to the resource being accessed, entitlements assigned to the resource owner for the targeted resource that the authorization server knows about, and so on.
An authorization server wanting to include such attributes in a JWT access token
SHOULD use the "groups", "roles", and "entitlements" attributes of the "User" resource schema defined by
Section 4.1.2 of
RFC 7643) as claim types.
Authorization servers
SHOULD encode the corresponding claim values according to the guidance defined in [
RFC 7643]. In particular, a non-normative example of a "groups" attribute can be found in
Section 8.2 of
RFC 7643. No specific vocabulary is provided for "roles" and "entitlements".
Section 7.2.1 of this document provides entries for registering "groups", "roles", and "entitlements" attributes from [
RFC 7643] as claim types to be used in this profile.