Open Authentication Protocol                         T. Lodderstedt, Ed.
Internet-Draft                                                yes.com AG
Intended status: Standards Track                            V. Dzhuvinov
Expires: March 1, 22, 2020                                  Connect2id Ltd.
                                                            Aug 29,
                                                            Sep 19, 2019

               JWT Response for OAuth Token Introspection
             draft-ietf-oauth-jwt-introspection-response-07
             draft-ietf-oauth-jwt-introspection-response-08

Abstract

   This draft specification proposes an additional JSON Web Token (JWT) based
   secured response for OAuth 2.0 Token Introspection.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on March 1, 22, 2020.

Copyright Notice

   Copyright (c) 2019 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.
   2.  Requirements Notation and Conventions . . . . . . . . . . . .   3
   2.
   3.  Resource server management  . . . . . . . . . . . . . . . . .   3
   4.  Requesting a JWT Response . . . . . . . . . . . . . . . . . .   3
   3.   4
   5.  JWT Response  . . . . . . . . . . . . . . . . . . . . . . . .   3
   4.   4
   6.  Client Metadata . . . . . . . . . . . . . . . . . . . . . . .   5
   5.   7
   7.  Authorization Server Metadata . . . . . . . . . . . . . . . .   5
   6.   8
   8.  Security Considerations . . . . . . . . . . . . . . . . . . .   6
     6.1.   9
     8.1.  Cross-JWT Confusion . . . . . . . . . . . . . . . . . . .   6
     6.2.   9
     8.2.  Token Data Leakage  . . . . . . . . . . . . . . . . . . .   7
     6.3.   9
     8.3.  Keeping Token Data Confidential from OAuth Clients  . . .   7
     6.4.  10
     8.4.  Logging and Audit of Introspection Activity . . . . . . .   7
     6.5.  Data Minimization .  10
   9.  Privacy Considerations  . . . . . . . . . . . . . . . . . . .   7
   7.  10
   10. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .   7
   8.  11
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .   8
     8.1.  11
     11.1.  OAuth Dynamic Client Registration Metadata Registration .   8
       8.1.1.   11
       11.1.1.  Registry Contents  . . . . . . . . . . . . . . . . . .   8
     8.2.  11
     11.2.  OAuth Authorization Server Metadata Registration . . . .   8
       8.2.1.  12
       11.2.1.  Registry Contents  . . . . . . . . . . . . . . . . .  12
     11.3.  Media Type Registration  . .   8
     8.3.  OAuth Token Introspection Response . . . . . . . . . . .   9
       8.3.1. . . .  12
       11.3.1.  Registry Contents  . . . . . . . . . . . . . . . . . .   9
   9.  13
   12. References  . . . . . . . . . . . . . . . . . . . . . . . . .  14
     9.1.
     12.1.  Normative References . . . . . . . . . . . . . . . . . .  14
     9.2.
     12.2.  Informative References . . . . . . . . . . . . . . . . .  16  15
   Appendix A.  Document History . . . . . . . . . . . . . . . . . .  16  15
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  18

1.  Introduction

   OAuth 2.0 Token Introspection [RFC7662] specifies a method for a
   protected resource to query an OAuth 2.0 authorization server to
   determine the state of an access token and obtain data associated
   with the access token.  This allows enables deployments to implement
   identifier-based opaque
   access tokens in an interoperable way.

   The introspection response, as specified in OAuth 2.0 Token
   Introspection [RFC7662], is a plain JSON object.  However, there are
   use cases where the resource server requires stronger assurance that
   the authorization server issued the token introspection response for
   an access token, including cases where the authorization server
   assumes liability for the token's
   content. content of the token introspection
   response.  An example is a resource server using verified person data
   to create certificates, which in turn are used to create qualified
   electronic signatures.

   In such use cases it may be useful or even required to return a
   signed JWT [RFC7519] as the introspection response.  This
   specification extends the token introspection endpoint with the
   capability to return responses as JWTs.

1.1.

2.  Requirements Notation and Conventions

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in BCP
   14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

2.  Requesting a JWT Response

   A resource

3.  Resource server requests to receive a JWT introspection response by
   including an Accept header with content type "application/jwt" in the
   introspection request. management

   The following is authorization server (AS) and the resource server (RS) maintain a non-normative example request:

   POST /introspect HTTP/1.1
   Host: server.example.com
   Accept: application/jwt
   Content-Type: application/x-www-form-urlencoded

   token=2YotnFZFEjr1zCsicMWpAA

3.  JWT Response
   strong two-way trust relationship.  The introspection endpoint responds with a JWT, setting resource server relies on the Content-
   Type header
   authorization server to "application/jwt".

   This JWT MUST contain the claims "iss" obtain authorization, user and "aud" in order to prevent
   misuse of the JWT other data as ID or
   input to its access token (see Section 6.1).

   This JWT MAY furthermore contain all claims defined in the "OAuth
   Token Introspection Response" registry established by [RFC7662].

   The following is a non-normative example response (with line breaks
   for display purposes only):

   HTTP/1.1 200 OK
   Content-Type: application/jwt

   eyJraWQiOiIxIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJaNU8zdXBQQzg4UXJBa
   ngwMGRpcyIsImF1ZCI6Imh0dHBzOlwvXC9wcm90ZWN0ZWQuZXhhbXBsZS5uZXRcL
   3Jlc291cmNlIiwiZXh0ZW5zaW9uX2ZpZWxkIjoidHdlbnR5LXNldmVuIiwic2Nvc
   GUiOiJyZWFkIHdyaXRlIGRvbHBoaW4iLCJpc3MiOiJodHRwczpcL1wvc2VydmVyL
   mV4YW1wbGUuY29tXC8iLCJhY3RpdmUiOnRydWUsImV4cCI6MTQxOTM1NjIzOCwia
   WF0IjoxNDE5MzUwMjM4LCJjbGllbnRfaWQiOiJsMjM4ajMyM2RzLTIzaWo0Iiwid
   XNlcm5hbWUiOiJqZG9lIn0.HEQHf05vqVvWVnWuEjbzUnPz6JDQVR69QkxgzBNq5
   kk-sK54ieg1STazXGsdFAT8nUhiiV1f_Z4HOKNnBs8TLKaFXokhA0MqNBOYI--2u
   nVHDqI_RPmC3p0NmP02Xmv4hzxFmTmpgjSy3vpKQDihOjhwNBh7G81JNaJqjJQTR
   v_1dHUPJotQjMK3k8_5FyiO2p64Y2VyxyQn1VWVlgOHlJwhj6BaGHk4Qf5F8DHQZ
   1WCPg2p_-hwfINfXh1_buSjxyDRF4oe9pKy6ZB3ejh9qIMm-WrwltuU1uWMXxN6e
   S6tUtpKo8UCHBwLWCHmJN7KU6ZojmaISspdS23lELAlyw control decisions and service delivery.  The example response contains the following JSON document:

   {
     "sub": "Z5O3upPC88QrAjx00dis",
     "aud": "https://protected.example.net/resource",
     "scope": "read write dolphin",
     "iss": "https://server.example.com/",
     "active": true,
     "exp": 1419356238,
     "iat": 1419350238,
     "client_id": "l238j323ds-23ij4",
     "given_name": "John",
     "family_name":"Doe",
     "birthdate":"1982-02-01"
   }

   Depending
   authorization server relies on the specific resource server policy to handle the JWT is either
   signed, or signed and encrypted.  If
   provided data appropriately.

   In the JWT context of this specification, the Token Introspection
   Endpoint is signed used to convey such security data and encrypted
   it MUST be a Nested JWT, as defined potentially also
   privacy sensitive data related to an access token.

   In order to process the introspection requests in JWT [RFC7519].

   Note: If a secure and
   privacy-preserving manner, the resource authorization server policy requires a signed MUST be able to
   identify, authenticate and authorize resource servers.

   To support encrypted token introspection response and JWTs, the
   authorization server receives an unauthenticated
   request containing an Accept header MUST also be provided with content type other than
   "application/jwt", it the respective
   resource server encryption keys and algorithms.

   The authorization server MUST refuse be able to serve determine whether an RS is
   the request audience for a particular access token and return an
   HTTP status code 400.  This what data it is done
   entitled to prevent downgrading attacks receive, otherwise the RS is not authorized to obtain token
   data intended for release to legitimate recipients only
   (see Section 6.2).

4.  Client Metadata the access token.  The authorization server determines what algorithm to employ to
   secure AS has the JWT discretion how to fulfil
   this requirement.  The AS could, for example, maintain a particular introspection response.  This
   decision can be based on registered metadata parameters for the mapping
   between scopes values and resource server, supplied via servers.

   The requirements given above imply that the authorization server
   maintains credentials and other configuration data for each RS.

   One way is by utilizing dynamic client registration with the
   resource server posing as the client, [RFC7591] and
   treating every RS as defined by an OAuth client.  In this draft.

   The parameter names follow case, the pattern established by OpenID Connect
   Dynamic Client Registration [OpenID.Registration] for configuring
   signing and encryption algorithms for JWT responses
   authorization server is assumed to at least maintain "client_id" and
   "token_endpoint_auth_method" with complementary authentication method
   metadata, such as "jwks" or "client_secret".  In cases where the AS
   needs to acquire consent to transmit data to a RS, the UserInfo
   endpoint.

   The following
   client metadata parameters fields are introduced recommended: "client_name", "client_uri",
   "contacts", "tos_uri", "policy_uri".

   The AS MUST restrict the use of client credentials by this
   specification:

   introspection_signed_response_alg  OPTIONAL.  JWS [RFC7515] algorithm
           ("alg" value) as defined in JWA [RFC7518] for signing a RS to the
   calls it requires, e.g. the AS MAY restrict such a client to call the
   token introspection responses.  If endpoint only.  How the AS implements this
   restriction is specified, beyond the response
           will be signed using JWS and scope of this specification.

   This specification further introduces client metadata to manage the configured algorithm.  The
           default, if omitted, is "RS256".

   introspection_encrypted_response_alg  OPTIONAL.  JWE [RFC7516]
           algorithm ("alg" value) as defined
   configuration options required to sign and encrypt token
   introspection response JWTs.

4.  Requesting a JWT Response

   A resource server requests to receive a JWT introspection response by
   including an Accept header with content type "application/jwt" in JWA [RFC7518] for
           encrypting the
   introspection responses.  If this request.

   Authentication at the token introspection endpoint can utilize client
   authentication methods or a separate access token issued to the
   resource server.  Whether a resource server is specified, required to
   authenticate is determined by the response will be encrypted using JWE and respective RS-specific policy at
   the configured
           algorithm. AS.

   The default, if omitted, is that no encryption following is
           performed. a non-normative example request using client
   authentication:

   POST /introspect HTTP/1.1
   Host: server.example.com
   Accept: application/jwt
   Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW
   Content-Type: application/x-www-form-urlencoded

   token=2YotnFZFEjr1zCsicMWpAA

   If both signing required by its policy, the authorization server MUST authenticate
   the caller and encryption are requested, check its authorization to use the
           response will be signed then encrypted, token introspection
   endpoint.

5.  JWT Response

   The introspection endpoint responds with the result being a Nested JWT, setting the "Content-
   Type" header to "application/jwt".  This JWT is a cryptographically
   protected representation of the token introspection response as defined
   specified in [RFC7662].

   Note: Although the JWT [RFC7519].

   introspection_encrypted_response_enc  OPTIONAL.  JWE [RFC7516]
           algorithm ("enc" value) format is widely used as defined an access token
   format, the JWT returned in JWA [RFC7518] for
           authenticated encryption of the introspection responses.  The
           default, if omitted, response is "A128CBC-HS256".  Note: This
           parameter MUST NOT be specified without setting
           "introspection_encrypted_response_alg".

   Resource servers may register their public encryption keys using the
   "jwks_uri" or "jwks" metadata parameters.

5.  Authorization Server Metadata

   Authorization servers SHOULD publish not an
   alternative representation of the supported algorithms for
   signing introspected access token and encrypting the JWT of is
   not intended to be used as an access token.

   JWT metadata values, such as "iat", might differ between the token
   introspection response by
   utilizing OAuth 2.0 Authorization Server Metadata [RFC8414]
   parameters.

   The following parameters are introduced by this specification:

   introspection_signing_alg_values_supported  OPTIONAL.  JSON array
           containing a list of the JWS [RFC7515] signing algorithms
           ("alg" values) as defined in JWA [RFC7518] supported by JWT format and the
           introspection endpoint to sign introspected access
   token (see below).

   This specification registers the response.

   introspection_encryption_alg_values_supported  OPTIONAL.  JSON array
           containing a list "application/token-
   introspection+jwt" media type, which is used as value of the JWE [RFC7516] encryption algorithms
           ("alg" values) as defined in JWA [RFC7518] supported by "typ"
   header parameter of the
           introspection endpoint JWT to encrypt indicate that the response.

   introspection_encryption_enc_values_supported  OPTIONAL.  JSON array
           containing payload is a list of the JWE [RFC7516] encryption algorithms
           ("enc" values) as defined in JWA [RFC7518] supported by the token
   introspection endpoint to encrypt the response.

6.  Security Considerations

6.1.  Cross-JWT Confusion

   JWT introspection responses and OpenID Connect ID Tokens are
   syntactically similar.  An attacker could therefore attempt

   If the access token is invalid, expired, has been revoked, or is not
   intended to
   impersonate an end-user at a OpenID Connect relying party be consumed by passing the JWT as an ID token.

   Such an attack can be prevented like any other token substitution
   attack.  The calling resource server (audience),
   the authorization server MUST include set the value of the response claim
   "active" to "false".  Otherwise, this claim is set to "true".

   If the access token is considered active, it MUST contain the claims
   "iss" and "aud" in each order to prevent misuse of the JWT introspection response, with the as an ID or
   access token (see Section 8.1).

   The "iss" value MUST be set to the authorization server's issuer URL and of the "aud" AS.

   The value set to the
   resource server's identifier.  This allows a correctly implemented
   OpenID Connect relying party to detect substitution by checking of the
   "iss" and "aud" claims as described in Section 3.1.3.7. of
   [OpenID.Core].  Relying parties SHOULD also use and check MUST identify the "nonce"
   parameter and claim to prevent token and code replay.

   Resource servers utilizing JWTs to represent self-contained access
   tokens could be susceptible to replay attacks.  Resource servers
   should therefore apply proper counter measures against replay as
   described in [I-D.ietf-oauth-security-topics], section 2.2.

   JWT Confusion and other attacks involving JWTs are discussed in
   [I-D.ietf-oauth-jwt-bcp].

6.2.  Token Data Leakage

   The authorization resource server MUST use Transport Layer Security (TLS) 1.2
   (or higher) per [RFC7525] in order to prevent
   receiving the token data leakage.

   To prevent introspection of leaked tokens and to present an
   additional security layer against token guessing attacks response.

   If the
   authorization server may require all requests AS adds the following claims to the token introspection endpoint to be authenticated.  As an alternative or
   response their meaning is defined as
   an addition to follows:

   iat     The "iat" claim indicates when the authentication, introspection response was
           issued by the intended recipients may AS.

   exp     The "exp" claim indicates when the access token passed in the
           introspection request will expire.

   jti     The "jti" claim is a unique identifier for the access token
           passed in the introspection request.  This identifier MUST be set
   up
           stable for encrypted responses.

   In all introspection calls for a given access token.

   Further content of the latter case, confidentiality introspection response is ensured determined by the fact that only
   RS-specific policy at the legitimate recipient is able AS.

   If possible, the AS MUST narrow down the "scope" value to decrypt the response.  An
   attacker could try scopes
   relevant to circumvent this measure by requesting a plain
   JSON response, using an Accept header with the content type set to,
   for example, "application/json" instead of "application/jwt".  To
   prevent this attack particular RS.

   The JWT formatted introspection response MAY contain further claims,
   especially the authorization server MUST NOT serve requests
   with content type other than "application/jwt" if claims defined in the resource server
   is set up to receive encrypted responses (see also Section 3).

6.3.  Keeping "OAuth Token Data Confidential Introspection
   Response" registry established by [RFC7662] and the "JSON Web Token
   Claims" registry established by [RFC7519].

   This includes claims from OAuth Clients

   Authorization servers with a policy the "JSON Web Token Claims" registry that requires token data to
   are commonly used in [OpenID.Core] and can be
   kept confidential from OAuth clients must require all requests applied to the
   token introspection endpoint resource
   owner.  These claims can serve to be authenticated.  As identify the resource owner as a
   natural person or to provide a required contact detail, such as an alternative
   e-Mail address or phone number.  When transmitting such claims the AS
   acts as an addition identity provider in regard to the authentication, RS.

   The AS determines based on the intended recipients may
   be set up for encrypted responses.

6.4.  Logging and Audit of Introspection Activity

   Authorization servers with a RS-specific policy that requires token introspection
   activity to be logged and audited must require all requests what claims about
   the resource owner to return in the token introspection endpoint to be authenticated.

6.5.  Data Minimization response.
   The authorisation server determines AS MUST ensure that the token release of any privacy-sensitive data a resource server is allowed to see based
   legally based.

   The following is a non-normative example response (with line breaks
   for display purposes only):

   HTTP/1.1 200 OK
   Content-Type: application/jwt

   eyJ0eXAiOiJ0b2tlbi1pbnRyb3NwZWN0aW9uK2p3dCIsImFsZyI6IlJTMjU2In0.eyJ
   pc3MiOiJodHRwczovL3NlcnZlci5leGFtcGxlLmNvbS8iLCJhdWQiOiJzNkJoZFJrcX
   QzIiwianRpIjoidDFGb0NDYVpkNFh2NE9SSlVXVlVlVFpmc0toVzMwQ1FDcldERGp3W
   Hk2dyIsImFjdGl2ZSI6dHJ1ZSwic2NvcGUiOiJyZWFkIHdyaXRlIGRvbHBoaW4iLCJl
   eHAiOjE1MTQ3OTc5NDIwMDAsImlhdCI6MTUxNDc5NzgyMjAwMCwiY2xpZW50X2lkIjo
   iczZCaGRSa3F0MyIsInN1YiI6Ilo1TzN1cFBDODhRckFqeDAwZGlzIiwiZ2l2ZW5fbm
   FtZSI6IkpvaG4iLCJmYW1pbHlfbmFtZSI6IkRvZSIsImJpcnRoZGF0ZSI6IjE5ODItM
   DItMDEifQ.mnGNVJJwMaMR-drVHIyjOd7S5mScHT5tYC_sLdeaS9C4pkmiOgwHNGah9
   w_15kbotjDckotJNHpNTQCcE5nRC29L_jz5hSCNTMmK62fJdEcq0QVuCL_roeHzc-s1
   bjU2V2Qme6_2468zqcuhf1fhcieWxx9bDwFFwk3su0qdoF9RBa0HobWzy1ENU6MjiKH
   vmrnd5PkJenn1rJEt0EQTUuVE0vh2tQGhxbaZkQ34mLLgES5TCuBK7ALDXhT4aGCzxg
   3jLprs_jYTjCq2kugptseKaxsvti0TxOxmxLPcuy5xRxHDUzV2h9_VWVJRgM8y0vhLN
   v9XKDe4EQqaIFLA_YD4TBeyPV7Sm4xMQ-2OsSmAz0E2BY_b_s0WrFN2K8tspQhj2mnG
   v7Zz8O3zeE2gC59JR56aU_SNspGPbt8GvTwuL5ZZTCmiWKUzQ0ev4zVthUczQmK53dx
   Zl6ZxBfIRPV5k1GTPyEPbWehizbJT4JBSLlk-l8JvJcfL2USLtJgMLH1D01fww0IqN1
   ofHeHFUmZWB_LR7kGaJ8Kx_a9z4CaaVesW8jzgSmwA8K_pv9yJqqjnUhsh51c49OAgn
   cqwAahGrUhrN0dIBrd6sRXU3AiRpaah0MMNcjR2UJbEZKwnMyHTkBQAeZAe9vO9pKV8
   JOd0ziYBpAbEpYGE4p3wog4

   The example response header contains the following JSON document:

   {
     "typ": "token-introspection+jwt",
     "alg": "RS256"
   }
   The example response payload contains the following JSON document:

   {
      "iss":"https://server.example.com/",
      "aud":"s6BhdRkqt3",
      "jti": "t1FoCCaZd4Xv4ORJUWVUeTZfsKhW30CQCrWDDjwXy6w",
      "active":true,
      "scope":"read write dolphin",
      "exp":1514797942000,
      "iat":1514797822000,
      "client_id":"s6BhdRkqt3",
      "sub":"Z5O3upPC88QrAjx00dis",
      "given_name":"John",
      "family_name":"Doe",
      "birthdate":"1982-02-01"
   }

   Depending on the specific resource server's client_id server policy the JWT is either
   signed, or signed and
   suitable token data, e.g. encrypted.  If the scope value.

7.  Acknowledgements

   We would like JWT is signed and encrypted
   it MUST be a Nested JWT, as defined in JWT [RFC7519].

   Note: If the resource server policy requires a signed and encrypted
   response and the authorization server receives an unauthenticated
   request containing an Accept header with content type other than
   "application/jwt", it MUST refuse to thank Petteri Stenius, Neil Madden, Filip Skokan, serve the request and Tony Nadalin return an
   HTTP status code 400.  This is done to prevent downgrading attacks to
   obtain token data intended for their valuable feedback.

8.  IANA Considerations

8.1.  OAuth Dynamic release to legitimate recipients only
   (see Section 8.2).

6.  Client Registration Metadata Registration

   The authorization server determines what algorithm to employ to
   secure the JWT for a particular introspection response.  This specification requests registration of
   decision can be based on registered metadata parameters for the following
   resource server, supplied via dynamic client
   metadata definitions in registration [RFC7591]
   with the IANA "OAuth Dynamic Client Registration
   Metadata" registry [IANA.OAuth.Parameters] resource server acting as a client, as specified below.

   The parameter names follow the pattern established by [RFC7591]:

8.1.1.  Registry Contents

   o  Client Metadata Name: "introspection_signed_response_alg"

   o OpenID Connect
   Dynamic Client Metadata Description: String value indicating Registration [OpenID.Registration] for configuring
   signing and encryption algorithms for JWT responses at the client's
      desired UserInfo
   endpoint.

   The following client metadata parameters are introduced by this
   specification:

   introspection_signed_response_alg  OPTIONAL.  JWS [RFC7515] algorithm
           ("alg" value) as defined in JWA [RFC7518] for signing
           introspection responses.  If this is specified, the response signing
           will be signed using JWS and the configured algorithm.

   o  Change Controller: IESG

   o  Specification Document(s): Section 4 of [[  The
           default, if omitted, is "RS256".

   introspection_encrypted_response_alg  OPTIONAL.  JWE [RFC7516]
           algorithm ("alg" value) as defined in JWA [RFC7518] for
           content key encryption.  If this specification ]]

   o  Client Metadata Name: "introspection_encrypted_response_alg"

   o  Client Metadata Description: String value specifying is specified, the desired
      introspection response
           will be encrypted using JWE and the configured content
           encryption algorithm (alg value).

   o  Change Controller: IESG

   o  Specification Document(s): Section 4 of [[ this specification ]]

   o  Client Metadata Name: "introspection_encrypted_response_enc"

   o  Client Metadata Description: String value specifying
           ("introspection_encrypted_response_enc").  The default, if
           omitted, is that no encryption is performed.  If both signing
           and encryption are requested, the desired
      introspection response encryption will be signed
           then encrypted, with the result being a Nested JWT, as
           defined in JWT [RFC7519].

   introspection_encrypted_response_enc  OPTIONAL.  JWE [RFC7516]
           algorithm (enc value).

   o  Change Controller: IESG

   o  Specification Document(s): Section 4 ("enc" value) as defined in JWA [RFC7518] for
           content encryption of [[ this specification ]]

8.2.  OAuth introspection responses.  The default,
           if omitted, is "A128CBC-HS256".  Note: This parameter MUST
           NOT be specified without setting
           "introspection_encrypted_response_alg".

   Resource servers may register their public encryption keys using the
   "jwks_uri" or "jwks" metadata parameters.

7.  Authorization Server Metadata Registration

   This specification requests registration of

   Authorization servers SHOULD publish the following values in supported algorithms for
   signing and encrypting the IANA "OAuth JWT of an introspection response by
   utilizing OAuth 2.0 Authorization Server Metadata" registry
   [IANA.OAuth.Parameters] established by [RFC8414].

8.2.1.  Registry Contents

   o  Metadata Name: "introspection_signing_alg_values_supported"
   o Metadata Description: [RFC8414]
   parameters.  Resource servers use this data to parametrize their
   client registration requests.

   The following parameters are introduced by this specification:

   introspection_signing_alg_values_supported  OPTIONAL.  JSON array
           containing a list of the JWS [RFC7515] signing algorithms
           ("alg" values) as defined in JWA [RFC7518] supported by the authorization server for
           introspection response
      signing.

   o  Change Controller: IESG

   o  Specification Document(s): Section 5 of [[ this specification ]]

   o  Metadata Name: "introspection_encryption_alg_values_supported"

   o  Metadata Description: endpoint to sign the response.

   introspection_encryption_alg_values_supported  OPTIONAL.  JSON array
           containing a list of the JWE [RFC7516] encryption algorithms
           ("alg" values) as defined in JWA [RFC7518] supported by the authorization server for
           introspection response endpoint to encrypt the content encryption (alg value).

   o  Change Controller: IESG

   o  Specification Document(s): Section 5 of [[ this specification ]]

   o  Metadata Name: "introspection_encryption_enc_values_supported"

   o  Metadata Description: key
           for introspection responses (content key encryption).

   introspection_encryption_enc_values_supported  OPTIONAL.  JSON array
           containing a list of the JWE [RFC7516] encryption algorithms
           ("enc" values) as defined in JWA [RFC7518] supported by the authorization server for
           introspection endpoint to encrypt the response
      encryption (enc value).

   o  Change Controller: IESG

   o  Specification Document(s): Section 5 of [[ (content
           encryption).

8.  Security Considerations

8.1.  Cross-JWT Confusion

   Token introspection responses in JWT format, access tokens in JWT
   format, and OpenID Connect ID Tokens are syntactical similar.
   Attackers could try to utilize this specification ]]

8.3.  OAuth fact and attempt to use a token
   introspection response as access token when invoking a resource
   server or as ID Token Introspection Response

   This specification requests registration when logging into at a OpenID Connect RP.

   Any relying party processing the "typ" JWT header element should
   detect the attack since token introspection responses in JWT format
   set this header to the value "token-introspection+jwt".
   Unfortunately, this is not a well established practice yet.

   As an alternative approach, such an attack can be prevented like any
   other token substitution attack by restricting the audience of the
   JWT.  As specified in Section 5, the authorization server includes
   the claims "iss" and "aud" in each JWT introspection response, with
   the "iss" value set to the authorization server's issuer URL and the
   "aud" value set to the resource server's identifier.  Any recipient
   of an JWT MUST check these values in order to detect substitution
   attacks.

   OpenID Connect RPs are additionally expected to use and check the following
   "nonce" parameter and claim
   values to prevent token and code replay.

   Resource servers MUST additionally apply the countermeasures against
   replay as defined described in [OpenID.Core], Section 5.1, [I-D.ietf-oauth-security-topics], section 3.2.

   JWT Confusion and other attacks involving JWTs are discussed in the IANA "OAuth
   [I-D.ietf-oauth-jwt-bcp].

8.2.  Token Introspection Response" registry.  [IANA.OAuth.Parameters]
   established by [RFC7662].

8.3.1.  Registry Contents

   o  Name: "name"

   o  Description: End-User's full name Data Leakage

   The authorization server MUST use Transport Layer Security (TLS) 1.2
   (or higher) per BCP 195 [RFC7525] in displayable form including
      all name parts, possibly including titles order to prevent token data
   leakage.

   To prevent introspection of leaked tokens and suffixes, ordered
      according to present an
   additional security layer against token guessing attacks the
   authorization server MAY require all requests to the End-User's locale and preferences.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

   o  Name: "given_name"
   o  Description: Given name(s) token
   introspection endpoint to be authenticated.  As an alternative or first name(s) of as
   an addition to the End-User.  Note
      that in some cultures, people can have multiple given names; all
      can authentication, the intended recipients MAY be present, with set
   up for encrypted responses.

   In the names being separated latter case, confidentiality is ensured by space
      characters.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

   o  Name: "family_name"

   o  Description: Surname(s) or last name(s) of the End-User.  Note fact that in some cultures, people can have multiple family names or no
      family name; all can be present, with only
   the names being separated legitimate recipient is able to decrypt the response.  An
   attacker could try to circumvent this measure by
      space characters.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

   o  Name: "middle_name"

   o  Description: Middle name(s) requesting a plain
   JSON response, using an Accept header with the content type set to,
   for example, "application/json" instead of "application/jwt".  To
   prevent this attack the End-User.  Note that in some
      cultures, people can have multiple middle names; all can be
      present, authorization server MUST NOT serve requests
   with a content type other than "application/jwt" if the names being separated by space characters.  Also
      note that in some cultures, middle names are not used.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], resource
   server is set up to receive encrypted responses (see also Section 5.1

   o  Name: "nickname"

   o  Description: Casual name of the End-User 5).

8.3.  Keeping Token Data Confidential from OAuth Clients

   Authorization servers with a policy that may or may not requires token data to be
   kept confidential from OAuth clients must require all requests to the same
   token introspection endpoint to be authenticated.  As an alternative
   or as an addition to the given_name.  For instance, a nickname value of
      Mike might authentication, the intended recipients may
   be returned alongside a given_name value set up for encrypted responses.

8.4.  Logging and Audit of Michael.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

   o  Name: "preferred_username"

   o  Description: Shorthand name by which the End-User wishes Introspection Activity

   Authorization servers with a policy that requires token introspection
   activity to be
      referred logged and audited must require all requests to at the RP, such as janedoe or j.doe.  This value MAY
   token introspection endpoint to be any valid JSON string including special characters such as @,
      /, or whitespace.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

   o  Name: "profile"

   o  Description:URL of the End-User's profile page. authenticated.

9.  Privacy Considerations

   The contents of
      this Web page SHOULD token introspection response can be about used to transfer personal
   identifiable information from the End-User.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

   o  Name: "picture"

   o  Description: URL of AS to the End-User's profile picture.  This URL RS.  The AS MUST ensure a
   legal basis exists for the data transfer before any data is released
   to a particular RS.  The way the legal basis is established might
   vary among jurisdictions and MUST
      refer to an image file (for consider the legal entities
   involved.

   For example, a PNG, JPEG, or GIF image
      file), rather than the classical way to a Web page containing an image.  Note that
      this URL SHOULD specifically reference a profile photo of establish the End-
      User suitable for displaying when describing legal basis is by
   explicit user consent gathered from the End-User, rather
      than an arbitrary photo taken resource owner by the End-User.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

   o  Name: "website"

   o  Description: URL of AS
   during the End-User's Web page authorization flow.

   It is also possible that the legal basis is established out of band,
   e.g. in an explicit contract or blog.  This Web
      page SHOULD contain information published by the End-User or an
      organization that client gathering the End-User is affiliated with.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

   o  Name: "email"

   o  Description: End-User's preferred e-mail address.  Its value MUST
      conform to resource
   owner's consent.

   If the [RFC5322] "addr-spec" syntax.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

   o  Name: "email_verified"
   o  Description: True if AS and the End-User's e-mail address has been
      verified; otherwise false.  When this Claim Value RS belong to the same legal entity (1st party
   scenario), there is true, this
      means that potentially no need for an explicit user consent
   but the OP took affirmative steps to terms of service and policy of the respective service
   provider MUST be enforced at all times.

   In any case, the AS MUST ensure that this
      e-mail address was controlled by the End-User at scope of the time legal basis is
   enforced throughout the
      verification was performed. whole process.  The means by which an e-mail address
      is verified is context-specific, AS MUST retain the scope
   of the legal basis with the access token, e.g. in the scope value,
   and dependent upon the trust
      framework or contractual agreements within which AS MUST determine the parties are
      operating.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

   o  Name: "gender"

   o  Description:End-User's gender.  Values defined by this
      specification are female data a resource server is allowed to
   receive based on the resource server's identity and male.  Other values MAY be used when
      neither suitable token
   data, e.g. the scope value.

10.  Acknowledgements

   We would like to thank Petteri Stenius, Neil Madden, Filip Skokan,
   Tony Nadalin, and Remco Schaar for their valuable feedback.

11.  IANA Considerations

11.1.  OAuth Dynamic Client Registration Metadata Registration

   This specification requests registration of the defined values are applicable.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1 following client
   metadata definitions in the IANA "OAuth Dynamic Client Registration
   Metadata" registry [IANA.OAuth.Parameters] established by [RFC7591]:

11.1.1.  Registry Contents

   o  Client Metadata Name: "birthdate" "introspection_signed_response_alg"

   o  Description:Time the End-User's information was last updated.  Its  Client Metadata Description: String value is a JSON number representing the number of seconds from
      1970-01-01T0:0:0Z as measured in UTC until indicating the date/time. client's
      desired introspection response signing algorithm.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Document(s): Section 5.1 6 of [[ this specification ]]

   o  Client Metadata Name: "zoneinfo" "introspection_encrypted_response_alg"

   o  Client Metadata Description: String from zoneinfo [zoneinfo] time zone database
      representing the End-User's time zone.  For example, Europe/Paris
      or America/Los_Angeles. value specifying the desired
      introspection response content key encryption algorithm (alg
      value).

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Document(s): Section 5.1 6 of [[ this specification ]]

   o  Client Metadata Name: "locale" "introspection_encrypted_response_enc"

   o  Client Metadata Description: End-User's locale, represented as a BCP47 [RFC5646]
      language tag.  This is typically an ISO 639-1 Alpha-2 [ISO639-1]
      language code in lowercase and an ISO 3166-1 Alpha-2 [ISO3166-1]
      country code in uppercase, separated by a dash.  For example, en-
      US or fr-CA.  As a compatibility note, some implementations have
      used an underscore as String value specifying the separator rather than a dash, for
      example, en_US; Relying Parties MAY choose to accept this locale
      syntax as well. desired
      introspection response content encryption algorithm (enc value).

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Document(s): Section 5.1 6 of [[ this specification ]]

11.2.  OAuth Authorization Server Metadata Registration

   This specification requests registration of the following values in
   the IANA "OAuth Authorization Server Metadata" registry
   [IANA.OAuth.Parameters] established by [RFC8414].

11.2.1.  Registry Contents

   o  Metadata Name: "phone_number" "introspection_signing_alg_values_supported"

   o  Metadata Description: End-User's preferred telephone number.  [E.164] is
      RECOMMENDED as the format JSON array containing a list of this Claim, for example, +1 (425)
      555-1212 or +56 (2) 687 2400.  If the phone number contains an
      extension, it is RECOMMENDED that the extension be represented
      using algorithms
      supported by the [RFC3966] extension syntax, authorization server for example, +1 (604)
      555-1234;ext=5678. introspection response
      signing.

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Document(s): Section 5.1 7 of [[ this specification ]]

   o  Metadata Name: "phone_number_verified" "introspection_encryption_alg_values_supported"

   o  Metadata Description: True if the End-User's phone number has been
      verified; otherwise false.  When this Claim Value is true, this
      means that the OP took affirmative steps to ensure that this phone
      number was controlled by the End-User at the time the verification
      was performed.  The means by which JSON array containing a phone number is verified is
      context-specific, and dependent upon the trust framework or
      contractual agreements within which the parties are operating.
      When true, list of algorithms
      supported by the phone_number Claim MUST be in [E.164] format and
      any extensions MUST be represented in [RFC3966] format. authorization server for introspection response
      content key encryption (alg value).

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Document(s): Section 5.1 7 of [[ this specification ]]

   o  Metadata Name: "address" "introspection_encryption_enc_values_supported"

   o  Metadata Description: End-User's preferred postal address.  The value of
      the address member is a JSON [RFC8259] structure array containing some
      or all a list of algorithms
      supported by the members defined in [OpenID.Core], Section 5.1.1. authorization server for introspection response
      content encryption (enc value).

   o  Change Controller: IESG

   o  Specification Document(s):[OpenID.Core], Document(s): Section 5.1 7 of [[ this specification ]]

11.3.  Media Type Registration

   This section registers the "application/token-introspection+jwt"
   media type in the "Media Types" registry [IANA.MediaTypes] in the
   manner described in [RFC6838], which can be used to indicate that the
   content is a token introspection response in JWT format.

11.3.1.  Registry Contents

   o  Name: "updated_at"  Type name: application

   o  Description: Time the End-User's information was last updated.
      Its value  Subtype name: token-introspection+jwt

   o  Required parameters: N/A

   o  Optional parameters: N/A

   o  Encoding considerations: binary; A token introspection response is
      a JSON number representing JWT; JWT values are encoded as a series of base64url-encoded
      values (with trailing '=' characters removed), some of which may
      be the number empty string, separated by period ('.') characters.

   o  Security considerations: See Section 7 of seconds from
      1970-01-01T0:0:0Z as measured this specification

   o  Interoperability considerations: N/A

   o  Published specification: Section 4 of this specification

   o  Applications that use this media type: Applications that produce
      and consume OAuth Token Introspection Responses in UTC until the date/time. JWT format

   o  Fragment identifier considerations: N/A

   o  Additional information:

      *  Magic number(s): N/A

      *  File extension(s): N/A

      *  Macintosh file type code(s): N/A

   o  Person & email address to contact for further information: Torsten
      Lodderstedt, torsten@lodderstedt.net

   o  Intended usage: COMMON

   o  Restrictions on usage: none

   o  Author: Torsten Lodderstedt, torsten@lodderstedt.net

   o  Change Controller: controller: IESG

   o  Specification Document(s):[OpenID.Core], Section 5.1

9.  Provisional registration?  No

12.  References

9.1.

12.1.  Normative References

   [E.164]    Standardization, I. O. F., "E.164: The international
              public telecommunication numbering plan", 2010,
              <https://www.itu.int/rec/T-REC-E.164-201011-I/en>.

   [I-D.ietf-oauth-jwt-bcp]
              Sheffer, Y., Hardt, D., and M. Jones, "JSON Web Token Best
              Current Practices", draft-ietf-oauth-jwt-bcp-06 (work in
              progress), June 2019.

   [I-D.ietf-oauth-security-topics]
              Lodderstedt, T., Bradley, J., Labunets, A., and D. Fett,
              "OAuth 2.0 Security Best Current Practice", draft-ietf-
              oauth-security-topics-13 (work in progress), July 2019.

   [ISO3166-1]
              Standardization, I. O. F., "ISO 3166-1:1997. Codes for the
              representation of names of countries and their
              subdivisions -- Part 1: Country codes", 2013,
              <https://www.iso.org/standard/63545.html>.

   [ISO639-1]
              Standardization, I. O. F., "ISO 639-1:2002 Codes for the
              representation of names of languages -- part 1: Alpha-2
              Code", 2002, <https://www.iso.org/standard/22109.html>.

   [IANA.MediaTypes]
              IANA, "Media Types",
              <http://www.iana.org/assignments/media-types>.

   [OpenID.Core]
              Sakimura, N., Bradley, J., Jones, M., Medeiros, B. D., and
              C. Mortimore, "OpenID Connect Core 1.0 incorporating
              errata set 1", Nov 2014,
              <http://openid.net/specs/openid-connect-core-1_0.html>.

   [OpenID.Registration]
              Sakimura, N., Bradley, J., and M. Jones, "OpenID Connect
              Dynamic Client Registration 1.0 incorporating errata set
              1", Nov 2014, <https://openid.net/specs/
              openid-connect-registration-1_0.html>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC3966]  Schulzrinne, H., "The tel URI for Telephone Numbers",
              RFC 3966, DOI 10.17487/RFC3966, December 2004,
              <https://www.rfc-editor.org/info/rfc3966>.

   [RFC5322]  Resnick, P., Ed., "Internet Message Format",

   [RFC6838]  Freed, N., Klensin, J., and T. Hansen, "Media Type
              Specifications and Registration Procedures", BCP 13,
              RFC 5322, 6838, DOI 10.17487/RFC5322, October 2008,
              <https://www.rfc-editor.org/info/rfc5322>. 10.17487/RFC6838, January 2013,
              <https://www.rfc-editor.org/info/rfc6838>.

   [RFC7515]  Jones, M., Bradley, J., and N. Sakimura, "JSON Web
              Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May
              2015, <https://www.rfc-editor.org/info/rfc7515>.

   [RFC7516]  Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)",
              RFC 7516, DOI 10.17487/RFC7516, May 2015,
              <https://www.rfc-editor.org/info/rfc7516>.

   [RFC7518]  Jones, M., "JSON Web Algorithms (JWA)", RFC 7518,
              DOI 10.17487/RFC7518, May 2015,
              <https://www.rfc-editor.org/info/rfc7518>.

   [RFC7519]  Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token
              (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015,
              <https://www.rfc-editor.org/info/rfc7519>.

   [RFC7525]  Sheffer, Y., Holz, R., and P. Saint-Andre,
              "Recommendations for Secure Use of Transport Layer
              Security (TLS) and Datagram Transport Layer Security
              (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May
              2015, <https://www.rfc-editor.org/info/rfc7525>.

   [RFC7591]  Richer, J., Ed., Jones, M., Bradley, J., Machulak, M., and
              P. Hunt, "OAuth 2.0 Dynamic Client Registration Protocol",
              RFC 7591, DOI 10.17487/RFC7591, July 2015,
              <https://www.rfc-editor.org/info/rfc7591>.

   [RFC7662]  Richer, J., Ed., "OAuth 2.0 Token Introspection",
              RFC 7662, DOI 10.17487/RFC7662, October 2015,
              <https://www.rfc-editor.org/info/rfc7662>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8259]  Bray, T., Ed., "The JavaScript Object Notation (JSON) Data
              Interchange Format", STD 90, RFC 8259,
              DOI 10.17487/RFC8259, December 2017,
              <https://www.rfc-editor.org/info/rfc8259>.

   [RFC8414]  Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0
              Authorization Server Metadata", RFC 8414,
              DOI 10.17487/RFC8414, June 2018,
              <https://www.rfc-editor.org/info/rfc8414>.

9.2.

12.2.  Informative References

   [IANA.OAuth.Parameters]
              IANA, "OAuth Parameters",
              <http://www.iana.org/assignments/oauth-parameters>.

Appendix A.  Document History

   [[ To be removed from the final specification ]]

   -08

   o  made difference between introspected access token and
      introspection response clearer

   o  defined semantics of JWT claims overlapping between introspected
      access token and introspection response as JWT

   o  added section about RS management

   o  added text about user claims including a privacy considerations
      section

   o  removed registration of OpenID Connect claims to "Token
      Introspection Response" registry and refer to "JWT Claims"
      registry instead

   o  added registration of "application/token-introspection+jwt" media
      type as type identifier of token introspection responses in JWT
      format

   o  more changed to incorporate IESG review feedback

   -07

   o  fixed wrong description of "locale"

   o  added references for ISO and ITU specifications

   -06

   o  replaced reference to RFC 7159 with reference to RFC 8259

   -05

   o  improved wording for TLS requirement

   o  added RFC 2119 boilerplate

   o  fixed and updated some references

   -04

   o  reworked definition of parameters in section 4

   o  added text on data minimization to security considerations section

   o  added statement regarding TLS to security considerations section

   -03

   o  added registration for OpenID Connect Standard Claims to OAuth
      Token Introspection Response registry

   -02

   o  updated references

   -01

   o  adapted wording to preclude any accept header except "application/
      jwt" if encrypted responses are required

   o  use registered alg value RS256 for default signing algorithm

   o  added text on claims in the token introspection response

   -00

   o  initial version of the WG draft

   o  defined default signing algorithm

   o  changed behavior in case resource server is set up for encryption

   o  Added text on token data leakage prevention to the security
      considerations

   o  moved Security Considerations section forward

   WG draft

   -01

   o  fixed typos in client meta data field names

   o  added OAuth Server Metadata parameters to publish algorithms
      supported for signing and encrypting the introspection response

   o  added registration of new parameters for OAuth Server Metadata and
      Client Registration

   o  added explicit request for JWT introspection response

   o  made iss and aud claims mandatory in introspection response

   o  Stylistic and clarifying edits, updates references

   -00

   o  initial version

Authors' Addresses

   Torsten Lodderstedt (editor)
   yes.com AG

   Email: torsten@lodderstedt.net

   Vladimir Dzhuvinov
   Connect2id Ltd.

   Email: vladimir@connect2id.com