<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type='text/xsl' href='http://xml2rfc.tools.ietf.org/authoring/rfc2629.xslt' ?>
<!DOCTYPE rfc PUBLIC "-//IETF//DTD RFC 2629//EN"
"http://xml2rfc.tools.ietf.org/authoring/rfc2629.dtd">

<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
	category="std" docName="draft-ietf-oauth-resource-metadata-08" ipr="trust200902">

  <?rfc toc="yes" ?>
  <?rfc tocdepth="5" ?>
  <?rfc symrefs="yes" ?>
  <?rfc sortrefs="yes"?>
  <?rfc strict="yes" ?>
  <?rfc compact='yes' ?>
  <?rfc subcompact='no' ?>

  <front>
    <title abbrev="OAuth 2.0 Protected Resource Metadata">OAuth 2.0 Protected Resource Metadata</title>

    <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
      <organization>Self-Issued Consulting</organization>
      <address>
        <email>michael_b_jones@hotmail.com</email>
	<uri>https://self-issued.info/</uri>
      </address>
    </author>

    <author fullname="Phil Hunt" initials="P." surname="Hunt">
      <organization>Independent Identity, Inc.</organization>
      <address>
        <email>phil.hunt@yahoo.com</email>
      </address>
    </author>

    <author fullname="Aaron Parecki" initials="A." surname="Parecki">
      <organization>Okta</organization>
      <address>
        <email>aaron@parecki.com</email>
        <uri>https://aaronparecki.com/</uri>
      </address>
    </author>

    <date day="11" month="August" year="2024" />

    <area>Security</area>
    <workgroup>OAuth Working Group</workgroup>

    <keyword>OAuth</keyword>
    <keyword>Discovery</keyword>
    <keyword>Metadata</keyword>
    <keyword>Discovery Metadata</keyword>
    <keyword>Configuration Information</keyword>
    <keyword>Resource Server</keyword>
    <keyword>Protected Resource</keyword>
    <keyword>Resource Identifier</keyword>
    <keyword>JavaScript Object Notation</keyword>
    <keyword>JSON</keyword>
    <keyword>JSON Web Token</keyword>
    <keyword>JWT</keyword>

    <abstract>
      <t>
	This specification defines a metadata format that
	an OAuth 2.0 client or authorization server can use to obtain
	the information needed to interact with
	an OAuth 2.0 protected resource.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>
	This specification defines a metadata format
	enabling OAuth 2.0 clients and authorization servers to obtain information needed
	to interact with an OAuth 2.0 protected resource.
	The structure and content of this specification is intentionally as parallel as possible to that of
	<xref target="RFC7591">"OAuth 2.0 Dynamic Client Registration Protocol"</xref>,
	which enables a client to provide metadata about itself
	to an OAuth 2.0 authorization server and to
	<xref target="RFC8414">OAuth 2.0 Authorization Server Metadata</xref>,
	which enables a client to obtain metadata about
	an OAuth 2.0 authorization server.
      </t>
      <t>
	The metadata for a protected resource
	is retrieved from a well-known location as a JSON <xref target="RFC8259"/> document,
	which declares information about its capabilities and optionally, its relationships to other services.
	This process is described in <xref target="PRConfig"/>.
      </t>
      <t>
	This metadata can either be communicated in a self-asserted fashion or as
	a set of signed metadata values represented as claims
	in a JSON Web Token (JWT) <xref target="JWT"/>.
	In the JWT case, the issuer is vouching for
	the validity of the data about the protected resource.
	This is analogous to the role that the Software Statement
	plays in OAuth Dynamic Client Registration <xref target="RFC7591"/>.
      </t>
      <t>
	Each protected resource publishing metadata about itself makes its own
	metadata document available at a well-known location
	deterministically derived from the protected resource's URL,
	even when the resource server implements multiple protected resources.
	This prevents attackers from publishing metadata supposedly describing
	the protected resource, but that is not actually authoritative for
	the protected resource, as described in <xref target="Impersonation"/>.
      </t>
      <t>
	The means by which the client obtains the location
	of the protected resource
	is out of scope.
	In some cases, the location may be manually configured into the client.
	In other cases, it may be dynamically discovered, for instance,
	through the use of <xref target="RFC7033">WebFinger</xref>,
	in a manner related to the description in Section 2 of
	<xref target="OpenID.Discovery">"OpenID Connect Discovery 1.0"</xref>.
      </t>
      <t>
	    	<xref target="PRMetadata"/> defines metadata values that a protected
	      resource can publish, which includes things like which scopes are
	      supported, how a client can present an access token, and more.
	      These values may be used by other specifications, such as the <spanx style="verb">jwks_uri</spanx>
	      used to publish public keys the resource server uses to sign
	      resource responses, for instance,
	      as described in <xref target="FAPI.MessageSigning"/>.
	    </t>

      <section anchor="rnc" title="Requirements Notation and Conventions">
	<t>
	  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 <xref target="RFC2119"/> <xref target="RFC8174"/>
	  when, and only when, they appear in all capitals, as shown here.
	</t>

	<t>
	  All uses of <xref target="JWS">JSON Web Signature (JWS)</xref>
	  and <xref target="JWE">JSON Web Encryption (JWE)</xref>
	  data structures in this specification utilize
	  the JWS Compact Serialization or the JWE Compact Serialization;
	  the JWS JSON Serialization and the JWE JSON Serialization are not used.
	</t>
      </section>

      <section anchor="Terminology" title="Terminology">
	<t>
	  This specification uses the terms "Access Token", "Authorization Code",
	  "Authorization Endpoint", "Authorization Grant", "Authorization Server",
	  "Client", "Client Authentication", "Client Identifier", "Client Secret",
	  "Grant Type", "Protected Resource", "Redirection URI", "Refresh Token",
	  "Resource Owner", "Resource Server", "Response Type", and "Token Endpoint"
	  defined by <xref target="RFC6749">OAuth 2.0</xref>,
	  the terms "Claim Name", "Claim Value", and "JSON Web Token (JWT)"
	  defined by <xref target="JWT">JSON Web Token (JWT)</xref>.
	</t>
	<t>
	  This specification defines the following term:
	  <list style='hanging'>
	    <t hangText='Resource Identifier:'>
	      <vspace/>
	      The Protected resource's resource identifier, which is a URL that
	      uses the <spanx style="verb">https</spanx> scheme and has no query or fragment components.
	      Protected resource metadata is published at a
	      <spanx style="verb">.well-known</spanx> location
	      <xref target="RFC8615"/>
	      derived from this resource identifier,
	      as described in <xref target="PRConfig"/>.
	    </t>
	  </list>
	</t>
      </section>
    </section>

    <section anchor="PRMetadata" title="Protected Resource Metadata">
      <t>
	Protected resources can have metadata describing their configuration.
	The following protected resource metadata values
	are used by this specification and are registered in the IANA
	"OAuth Protected Resource Metadata" registry
	established in <xref target="PRMetadataReg"/>:

	<list style="hanging">

	  <t hangText="resource">
	    <vspace/>
	    REQUIRED.
	    The protected resource's resource identifier, which is a URL that
	    uses the <spanx style="verb">https</spanx> scheme and has no query or fragment components.
	    Using these well-known resources is described in <xref target="PRConfig"/>.
	  </t>

	  <t hangText="authorization_servers">
	    <vspace/>
	    OPTIONAL.
	    JSON array containing a list of OAuth authorization server issuer identifiers,
	    as defined in <xref target="RFC8414"/>,
	    for authorization servers that can be used with this protected resource.
	    Protected resources MAY choose not to advertise some supported authorization servers
	    even when this parameter is used.
	    In some use cases, the set of authorization servers will not be enumerable,
	    in which case this metadata parameter would not be used.
	  </t>

	  <t hangText="jwks_uri">
	    <vspace/>
	    OPTIONAL.
	    URL of the protected resource's JSON Web Key (JWK) Set <xref target="JWK"/> document.
	    This contains public keys belonging to the protected resource, such as
	    signing key(s) that the resource server uses to sign resource responses.
	    This URL MUST use the <spanx style="verb">https</spanx> scheme.
	    When both signing and encryption keys are made available,
	    a <spanx style="verb">use</spanx> (public key use) parameter
	    value is REQUIRED for all keys in the referenced JWK Set
	    to indicate each key's intended usage.
	  </t>

	  <t hangText="scopes_supported">
	    <vspace/>
	    RECOMMENDED.
	    JSON array containing a list of the <xref
	    target="RFC6749">OAuth 2.0</xref> <spanx style="verb">scope</spanx> values that
	    are used in authorization requests to request access to this protected resource.
	    Protected resources MAY choose not to advertise some scope values supported
	    even when this parameter is used.
	  </t>

	  <t hangText="bearer_methods_supported">
	    <vspace/>
	    OPTIONAL.
	    JSON array containing a list of the supported methods of sending an
	    OAuth 2.0 Bearer Token <xref target="RFC6750"/> to the protected resource.
	    Defined values are
	    <spanx style="verb">["header", "body", "query"]</spanx>,
	    corresponding to Sections 2.1, 2.2, and 2.3 of RFC 6750.
	  </t>

	  <t hangText="resource_signing_alg_values_supported">
	    <vspace/>
	    OPTIONAL.
	    JSON array containing a list of the JWS <xref target="JWS" /> signing algorithms
	    (<spanx style="verb">alg</spanx> values) <xref target="JWA" />
	    supported by the protected resource for signing resource responses,
	    for instance,
	    as described in <xref target="FAPI.MessageSigning"/>.
	    No default algorithms are implied if this entry is omitted.
	    The value <spanx style="verb">none</spanx> MUST NOT be used.
	  </t>

	  <t hangText="resource_documentation">
	    <vspace/>
	    OPTIONAL.
	    URL of a page containing human-readable information that
	    developers might want or need to know when using the protected resource
	  </t>

	  <t hangText="resource_policy_uri">
	    <vspace/>
	    OPTIONAL.
	    URL that the protected resource provides
	    to read about the protected resource's requirements on how
	    the client can use the data provided by the protected resource
	  </t>

	  <t hangText="resource_tos_uri">
	    <vspace/>
	    OPTIONAL.
	    URL that the protected resource provides
	    to read about the protected resource's terms of service
	  </t>

	</list>
      </t>
      <t>
	Additional protected resource metadata parameters MAY also be used.
      </t>

      <section anchor="SignedMetadata" title="Signed Protected Resource Metadata">
	<t>
	  In addition to JSON elements, metadata values MAY also be provided
	  as a <spanx style="verb">signed_metadata</spanx> value,
	  which is a JSON Web Token (JWT) <xref target="JWT"/>
	  that asserts metadata values about the protected resource as a bundle.
	  A set of claims that can be used in signed metadata
	  are defined in <xref target="PRMetadata"/>.
	  The signed metadata MUST be digitally signed or MACed
	  using <xref target="JWS">JSON Web Signature (JWS)</xref>
	  and MUST contain an <spanx style="verb">iss</spanx> (issuer) claim
	  denoting the party attesting to the claims in the signed metadata.
	  Consumers of the metadata MAY ignore the signed metadata
	  if they do not support this feature.
	  If the consumer of the metadata supports signed metadata,
	  metadata values conveyed in the signed metadata
	  MUST take precedence over the corresponding values conveyed using plain JSON elements.
	</t>
	<t>
	  Signed metadata is included in the protected resource metadata JSON object
	  using this OPTIONAL member:
	  <list style="hanging">

	    <t hangText="signed_metadata">
	      <vspace/>
	      A JWT containing metadata values about the protected resource as claims.
	      This is a string value consisting of the entire signed JWT.
	      A <spanx style="verb">signed_metadata</spanx>
	      metadata value SHOULD NOT appear as a claim in the JWT.
	    </t>

	  </list>
	</t>
      </section>

    </section>

    <section anchor="PRConfig"
             title="Obtaining Protected Resource Metadata">

      <t>
	Protected resources supporting metadata
	MUST make a JSON document containing metadata as specified in <xref target="PRMetadata"/>
	available at a path formed by
	inserting a well-known URI string into the protected resource's resource identifier
	between the host component and the path component, if any.
	By default, the well-known URI string used is
	<spanx style="verb">/.well-known/oauth-protected-resource</spanx>.
	The syntax and semantics of <spanx style="verb">.well-known</spanx>
	are defined in <xref target="RFC8615"/>.
	The well-known URI path suffix used MUST be registered in the IANA
	"Well-Known URIs" registry <xref target="IANA.well-known"/>.
	Examples of this construction can be found in <xref target="PRConfigurationRequest"/>.
      </t>
      <t>
	The term "application", as used below (and as used in <xref target="RFC8414"/>),
	encompasses all the components used to accomplish the task for the use case.
	That can include OAuth clients, authorization servers, protected resources,
	and non-OAuth components, inclusive of the code running in each of them.
	Applications are built to solve particular problems
	and may utilize many components and services.
      </t>
      <t>
	Different applications utilizing OAuth protected resources in application-specific ways
	MAY define and register different well-known URI path suffixes
	for publishing protected resource metadata used by those applications.
	For instance, if the Example application uses an OAuth protected resource in an Example-specific way,
	and there are Example-specific metadata values that it needs to publish,
	then it might register and use the
	<spanx style="verb">example-protected-resource</spanx> URI path suffix and publish
	the metadata document at the path formed by inserting
	<spanx style="verb">/.well-known/example-protected-resource</spanx>
	between the host and path components of the
	protected resource's resource identifier.
	Alternatively, many such applications will use the default well-known URI string
	<spanx style="verb">/.well-known/oauth-protected-resource</spanx>,
	which is the right choice for general-purpose OAuth protected resources,
	and not register an application-specific one.
      </t>
      <t>
	An OAuth 2.0 application using this specification MUST specify
	what well-known URI suffix it will use for this purpose.
	The same protected resource MAY choose to publish its metadata at multiple
	well-known locations derived from its resource identifier,
	for example, publishing metadata at both
	<spanx style="verb">/.well-known/example-protected-resource</spanx> and
	<spanx style="verb">/.well-known/oauth-protected-resource</spanx>.
      </t>

      <section anchor="PRConfigurationRequest"
	       title="Protected Resource Metadata Request">
        <t>
	  A protected resource metadata document MUST be queried using an HTTP
	  <spanx style="verb">GET</spanx> request at the previously specified path.
	</t>
        <t>
	  The consumer of the metadata would make the following request when the
	  resource identifier is <spanx style="verb">https://resource.example.com</spanx>
	  and the well-known URI path suffix is <spanx style="verb">oauth-protected-resource</spanx>
	  to obtain the metadata,
	  since the resource identifier contains no path component:
	</t>
        <t>
	  <figure>
            <artwork><![CDATA[
  GET /.well-known/oauth-protected-resource HTTP/1.1
  Host: resource.example.com
]]></artwork>
          </figure>
	</t>

	<t>
	  If the
	  resource identifier value contains a path component, any terminating
	  <spanx style="verb">/</spanx> MUST be removed before inserting
	  <spanx style="verb">/.well-known/</spanx> and the well-known URI path suffix
	  between the host component and the path component.
	  The consumer of the metadata would make the following request when the
	  resource identifier is <spanx style="verb">https://resource.example.com/resource1</spanx>
	  and the well-known URI path suffix is <spanx style="verb">oauth-protected-resource</spanx>
	  to obtain the metadata,
	  since the resource identifier contains a path component:
	</t>
        <t>
	  <figure>
            <artwork><![CDATA[
  GET /.well-known/oauth-protected-resource/resource1 HTTP/1.1
  Host: resource.example.com
]]></artwork>
          </figure>
	</t>

	<t>
	  Using path components enables supporting multiple resources per host.
	  This is required in some multi-tenant hosting configurations.
	  This use of <spanx style="verb">.well-known</spanx> is for supporting
	  multiple resources per host; unlike its use in
	  <xref target="RFC8615"/>, it does not provide
	  general information about the host.
	</t>

      </section>

      <section anchor="PRConfigurationResponse"
	       title="Protected Resource Metadata Response">
        <t>
	  The response is a set of claims about the protected resource's
	  configuration.
	  A successful response MUST use the 200 OK HTTP status code and return
	  a JSON object using the <spanx style="verb">application/json</spanx> content type
	  that contains a set of claims as its members
	  that are a subset of the metadata values defined in
	  <xref target="PRMetadata"/>.
	  Other claims MAY also be returned.
	</t>
        <t>
	  Claims that return multiple values are represented as JSON arrays.
	  Claims with zero elements MUST be omitted from the response.
	</t>
	<t>
	  An error response uses the applicable HTTP status code value.
	</t>
        <t>
	  <figure>
	    <preamble>The following is a non-normative example response:</preamble>

            <artwork><![CDATA[
  HTTP/1.1 200 OK
  Content-Type: application/json

  {
   "resource":
     "https://resource.example.com",
   "authorization_servers":
     ["https://as1.example.com",
      "https://as2.example.net"],
   "bearer_methods_supported":
     ["header", "body"],
   "scopes_supported":
     ["profile", "email", "phone"],
   "resource_documentation":
     "http://resource.example.com/resource_documentation.html"
  }
]]></artwork>
          </figure>
	</t>
      </section>

      <section anchor="PRConfigurationValidation"
	       title="Protected Resource Metadata Validation">

        <t>
	  The <spanx style="verb">resource</spanx> value returned MUST be identical to
	  the protected resource's resource identifier value into which
	  the well-known URI path suffix was inserted to create the URL
	  used to retrieve the metadata.
	  If these values are not identical, the data contained in the response MUST NOT be used.
	</t>
	<t>
	  If the protected resource metadata was retrieved from a URL
	  returned by the protected resource via the WWW-Authenticate
	  <spanx style="verb">resource_metadata</spanx> parameter, then
	  the <spanx style="verb">resource</spanx> value returned MUST be identical to
	  the URL that the client used to make the request to the resource server.
	  If these values are not identical, the data contained in the response MUST NOT be used.
	</t>
	<t>
	  These validation actions can thwart impersonation attacks,
	  as described in <xref target="Impersonation"/>.
	</t>
      </section>
    </section>

    <section anchor="ASMetadata" title="Authorization Server Metadata">
      <t>
	To support use cases in which the set of legitimate protected resources
	to use with the authorization server is fixed and enumerable,
	this specification defines the authorization server metadata value
	<spanx style="verb">protected_resources</spanx>,
	which enables the authorization server to explicitly list the protected resources.
	Note that if the set of legitimate authorization servers
	to use with a protected resource is also fixed and enumerable,
	lists in the authorization server metadata and protected resource metadata
	should be cross-checked against one another for consistency
	when these lists are used by the application profile.
      </t>
      <t>
	The following authorization server metadata value
	is defined by this specification and is registered in the IANA
	"OAuth Authorization Server Metadata" registry established in
	<xref target="RFC8414">OAuth 2.0 Authorization Server Metadata</xref>.

	<list style="hanging">

	  <t hangText="protected_resources">
	    <vspace/>
	    OPTIONAL.
	    JSON array containing a list of resource identifiers for OAuth protected resources
	    for protected resources that can be used with this authorization server.
	    Authorization servers MAY choose not to advertise some supported protected resources
	    even when this parameter is used.
	    In some use cases, the set of protected resources will not be enumerable,
	    in which case this metadata parameter will not be present.
	  </t>

	</list>
      </t>
    </section>

    <section anchor="WWW-Authenticate" title="Use of WWW-Authenticate for Protected Resource Metadata">
      <t>
	A protected resource MAY use a <spanx style="verb">WWW-Authenticate</spanx> response to return a URL to its protected resource metadata to the client.
	The client can then retrieve protected resource metadata as described in <xref target="PRConfig"/>.
	The client might then, for instance, determine what authorization server to use for the resource
	based on protected resource metadata retrieved.
      </t>
      <t>
	A typical end-to-end flow doing so is as follows.
	Note that while this example uses the OAuth 2.0 Authorization Code flow,
	a similar sequence could also be implemented with any other OAuth flow.
      </t>

	<!--
			 Diagram Source:
	     https://www.websequencediagrams.com/?lz=cGFydGljaXBhbnQgQ2xpZW50CgAHDCJSZXNvdXJjZVxuU2VydmVyIiBhcyBSUwAXDkF1dGhvcml6YXRpb24AHQ1BUwoKAFEGLT5SUzogAEcIIFJlcXVlc3RcbldpdGhvdXQgQWNjZXNzIFRva2VuClJTLS0-AIEJBjogV1dXLUF1dGhlbnRpY2F0ZQBEDUZldGNoIFJTIE1ldGFkYXRhAC4OAA4LIFJlc3BvbnNlCm5vdGUgb3ZlcgCBawc6IFZhbGlkYXRlAD0MLFxuQnVpbGQgQQA5C1VSTACBRwlBAHYJABcLCkEAgS8MAC8MAGYZLCBBUzogT0F1dGggAII9DSBGbG93XG4AgxEGIE9idGFpbnMAghsOAII-HndpdGgAgj4bAIMCCwCCEwc&s=default
	-->
      <t>
<figure>
	<name>Sequence Diagram</name>
  <artset>
    <artwork type="svg" name="sequence.svg">
			<svg baseProfile="tiny" version="1.2" viewBox="0 0 452 587" xmlns="http://www.w3.org/2000/svg">
  			<path d="M-235,-405.0000000000001 L-235,0" fill="none" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<rect fill="white" height="48" stroke="black" stroke-width="1" width="62" x="61.5" y="52.5"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="73.19531249999997" y="81.79166666666653">
    			Client  </text>
  			<rect fill="white" height="48" stroke="black" stroke-width="1" width="62" x="61.5" y="505.5"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="73.19531249999997" y="534.3541666666667">
    			Client  </text>
  			<path d="M-53,-405.00000000000017 L-53,0" fill="none" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<rect fill="white" height="48" stroke="black" stroke-width="1" width="85" x="232.5" y="52.5"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="243.95833333333334" y="74.03124999999984">
    			Resource  </text>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="253.115234375" y="89.55208333333316">
    			Server  </text>
  			<rect fill="white" height="48" stroke="black" stroke-width="1" width="85" x="232.5" y="505.5"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="243.95833333333334" y="526.59375">
    			Resource  </text>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="253.115234375" y="542.1145833333334">
    			Server  </text>
  			<path d="M56,-405.00000000000017 L56,0" fill="none" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<rect fill="white" height="48" stroke="black" stroke-width="1" width="112" x="327.5" y="52.5"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="339.00390625" y="74.03124999999984">
    			Authorization  </text>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="361.7936197916667" y="89.55208333333316">
    			Server  </text>
  			<rect fill="white" height="48" stroke="black" stroke-width="1" width="112" x="327.5" y="505.5"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="339.00390625" y="526.59375">
    			Authorization  </text>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="361.7936197916667" y="542.1145833333334">
    			Server  </text>
  			<rect fill="white" height="15.333333333333314" width="121.03515625000003" x="123.21874999999997" y="113.8333333333332"/>
  			<rect fill="white" height="15.333333333333314" width="147.43489583333331" x="110.01888020833331" y="129.35416666666652"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="123.21874999999997" y="127.16666666666653">
    			Resource Request  </text>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="110.01888020833331" y="142.68749999999986">
    			Without Access Token  </text>
  			<path d="M-234.50455729166669,-360 L-53.02278645833337,-360" fill="none" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M-54,-360 L-54,-360 L-62,-368 L-62,-360 L-62,-352 L-54,-360" fill="black" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<rect fill="white" height="15.333333333333314" width="130.13020833333334" x="118.67122395833331" y="159.2083333333332"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="118.67122395833331" y="172.54166666666654">
    			WWW-Authenticate  </text>
  			<path d="M-234.50455729166669,-330 L-53.02278645833337,-330" fill="none" stroke="black" stroke-dasharray="5,3" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M-234,-330 L-234,-330 L-226,-338 L-226,-330 L-226,-322 L-234,-330" fill="black" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<rect fill="white" height="15.333333333333314" width="126.22395833333334" x="120.62434895833331" y="189.0624999999999"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="120.62434895833331" y="202.39583333333323">
    			Fetch RS Metadata  </text>
  			<path d="M-234.50455729166669,-300 L-53.02278645833337,-300" fill="none" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M-54,-300 L-54,-300 L-62,-308 L-62,-300 L-62,-292 L-54,-300" fill="black" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<rect fill="white" height="15.333333333333314" width="153.97786458333331" x="106.74739583333331" y="218.91666666666657"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="106.74739583333331" y="232.24999999999991">
    			RS Metadata Response  </text>
  			<path d="M-234.50455729166669,-270 L-53.02278645833337,-270" fill="none" stroke="black" stroke-dasharray="5,3" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M-234,-270 L-234,-270 L-226,-278 L-226,-270 L-226,-262 L-234,-270" fill="black" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M-317,-257 L-317,-257 L-161,-257 L-153,-249 L-153,-209 L-317,-209 L-317,-257" fill="white" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M-160.57291666666669,-256.72916666666674 L-160.57291666666669,-248.72916666666674 L-152.57291666666669,-248.72916666666674" fill="none" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="15.815755208333314" y="269.8645833333332">
    			Validate RS Metadata,  </text>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="15.815755208333314" y="285.3854166666666">
    			Build AS Metadata URL  </text>
  			<rect fill="white" height="15.333333333333371" width="126.08072916666669" x="175.03515625" y="309.66666666666663"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="175.03515625" y="322.99999999999994">
    			Fetch AS Metadata  </text>
  			<path d="M-234.50455729166669,-179 L55.655598958333314,-179" fill="none" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M55,-179 L55,-179 L47,-187 L47,-179 L47,-171 L55,-179" fill="black" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<rect fill="white" height="15.333333333333314" width="153.83463541666669" x="161.158203125" y="339.5208333333333"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="161.158203125" y="352.85416666666663">
    			AS Metadata Response  </text>
  			<path d="M-234.50455729166669,-149 L55.655598958333314,-149" fill="none" stroke="black" stroke-dasharray="5,3" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M-234,-149 L-234,-149 L-226,-157 L-226,-149 L-226,-141 L-234,-149" fill="black" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M-241,-136 L-241,-136 L54,-136 L62,-128 L62,-89 L-241,-89 L-241,-136" fill="white" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M53.655598958333314,-136.125 L53.655598958333314,-128.125 L61.655598958333314,-128.125" fill="none" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="143.41080729166666" y="390.46874999999994">
    			OAuth Authorization Flow  </text>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="143.41080729166666" y="405.9895833333333">
    			Client Obtains Access Token  </text>
  			<rect fill="white" height="15.333333333333314" width="121.03515625" x="123.21875" y="430.2708333333333"/>
  			<rect fill="white" height="15.333333333333371" width="123.3203125" x="122.076171875" y="445.79166666666663"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="123.21875" y="443.60416666666663">
    			Resource Request  </text>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="122.076171875" y="459.12499999999994">
    			With Access Token  </text>
  			<path d="M-234.50455729166669,-43 L-53.02278645833337,-43" fill="none" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M-54,-43 L-54,-43 L-62,-51 L-62,-43 L-62,-35 L-54,-43" fill="black" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<rect fill="white" height="15.333333333333371" width="130.91145833333334" x="118.28059895833331" y="475.6458333333333"/>
  			<text fill="black" font-family="sans-serif" font-size="13.333333333333334" x="118.28059895833331" y="488.97916666666663">
    			Resource Response  </text>
  			<path d="M-234.50455729166669,-13 L-53.02278645833337,-13" fill="none" stroke="black" stroke-dasharray="5,3" stroke-width="1" transform="translate(327.5 505.5)"/>
  			<path d="M-234,-13 L-234,-13 L-226,-21 L-226,-13 L-226,-5 L-234,-13" fill="black" stroke="black" stroke-width="1" transform="translate(327.5 505.5)"/>
			</svg>
    </artwork>
    <artwork type="ascii-art" name="sequence.txt"><![CDATA[
     +----------+              +----------+    +---------------+
     |  Client  |              | Resource |    | Authorization |
     |          |              |  Server  |    |    Server     |
     +----+-----+              +----+-----+    +-------+-------+
          |                         |                  |
          |  Resource Request       |                  |
          | ----------------------> |                  |
          |  Without Access Token   |                  |
          |                         |                  |
          |                         |                  |
          |    WWW-Authenticate     |                  |
          | <---------------------- |                  |
          |                         |                  |
          |                         |                  |
          |    Fetch RS Metadata    |                  |
          | ----------------------> |                  |
          |                         |                  |
          |                         |                  |
          |   RS Metadata Response  |                  |
          | <---------------------- |                  |
          |                         |                  |
+---------+-----------+             |                  |
|Validate RS Metadata |             |                  |
|Build AS Metadata URL|             |                  |
+---------+-----------+             |                  |
          |                         |                  |
          |   Fetch AS Metadata     |                  |
          | ------------------------+----------------> |
          |                         |                  |
          |                         |                  |
          |   AS Metadata Response  |                  |
          | <-----------------------+----------------- |
          |                         |                  |
        +-+-------------------------+------------------+-+
        |       OAuth Authorization Code Flow            |
        |       Client Obtains Access Token              |
        +-+-------------------------+------------------+-+
          |                         |                  |
          |  Resource Request       |                  |
          | ----------------------> |                  |
          |  With Access Token      |                  |
          |                         |                  |
          |                         |                  |
          |   Resource Response     |                  |
          | <---------------------- |                  |
          |                         |                  |
]]></artwork>
  </artset>
</figure>
      </t>
      <t>
	<list style="numbers">
	  <t>
	    The client makes a request to a protected resource without presenting an access token.
	  </t>
	  <t>
	    The resource server responds with a <spanx style="verb">WWW-Authenticate</spanx> header including the URL of the protected resource metadata.
	  </t>
	  <t>
	    The client fetches the protected resource metadata from this URL.
	  </t>
	  <t>
	    The resource server responds with the protected resource metadata
	    according to <xref target="PRConfigurationResponse"/>.
	  </t>
	  <t>
	    The client validates the protected resource metadata,
	    as described in <xref target="PRConfigurationValidation"/>.
	  </t>
	  <t>
	    The client builds the authorization server metadata URL from an issuer identifier in the resource metadata according to <xref target="RFC8414"/>
	    and makes a request to fetch the authorization server metadata.
	  </t>
	  <t>
	    The authorization server responds with the authorization server metadata document according to <xref target="RFC8414"/>.
	  </t>
	  <t>
	    The client directs the user agent to the authorization server to begin the authorization flow.
	  </t>
	  <t>
	    The authorization exchange is completed and the authorization server returns an access token to the client.
	  </t>
	  <t>
	    The client repeats the resource request from step 1, presenting the newly obtained access token.
	  </t>
	  <t>
	    The resource server returns the requested protected resource.
	  </t>
	</list>
      </t>

      <section anchor="WWW-Authenticate-Response" title="WWW-Authenticate Response">
	<t>
	  This specification introduces a new parameter in the <spanx style="verb">WWW-Authenticate</spanx> response
	  to indicate the protected resource metadata URL:
            <list style='hanging'>
              <t hangText='resource_metadata:'>
                <vspace/>
		The URL of the protected resource metadata.
	      </t>
	    </list>
	</t>
	<t>
	  <figure>
	    <preamble>The response below is an example of a <spanx style="verb">WWW-Authenticate</spanx> header that includes the resource identifier.</preamble>

	    <artwork><![CDATA[
  HTTP/1.1 400 Bad Request
  WWW-Authenticate: Bearer error="invalid_request",
    error_description="No access token was provided in this request",
    resource_metadata=
    "https://resource.example.com/.well-known/oauth-protected-resource"
]]></artwork>
	  </figure>
	</t>
	<t>
	  The HTTP status code and error string in the response are defined by <xref target="RFC6750"/>.
	</t>
	<t>
	  The <spanx style="verb">resource_metadata</spanx> parameter MAY be combined with other parameters defined in other extensions,
	  such as the <spanx style="verb">max_age</spanx> parameter defined by <xref target="RFC9470"/>.
	</t>
      </section>

      <section anchor="changes" title="Changes to Resource Metadata">
	<t>
	  At any point, for any reason determined by the protected resource,
	  the protected resource MAY respond with a new <spanx style="verb">WWW-Authenticate</spanx> challenge
	  that includes a value for the protected resource metadata URL to indicate that its metadata MAY have changed.
	  If the client receives such a <spanx style="verb">WWW-Authenticate</spanx> response,
	  it SHOULD retrieve the updated protected resource metadata
	  and use the new metadata values obtained.
	  Among other things,
	  this enables a resource server to change which authorization servers it uses without any other coordination with clients.
	</t>
      </section>

      <section anchor="assumptions" title="Client Identifier and Client Authentication">
	<t>
	  The way in which the client identifier is established at the authorization server is out of scope of this specification.
	</t>
	<t>
	  This specification is intended to be deployed in scenarios where the client has no prior knowledge about the resource server,
	  and the resource server might or might not have prior knowledge about the client.
	</t>
	<t>
	  There are some existing methods by which an unrecognized client can make use of an authorization server,
	  such as using Dynamic Client Registration <xref target="RFC7591"/>
	  to register the client prior to initiating the authorization flow.
	  Future extensions might define alternatives, such as using URLs to identify clients.
	</t>
      </section>

      <section anchor="compatibility" title="Compatibility with Other Authentication Methods">
	<t>
	  Resource servers MAY return other <spanx style="verb">WWW-Authenticate</spanx> headers indicating various authentication schemes.
	  This allows the resource server to support clients that may or may not implement this specification,
	  and allows clients to choose their preferred authentication scheme.
	</t>
      </section>

    </section>

    <section anchor="StringOps" title="String Operations">

      <t>
	Processing some OAuth 2.0 messages requires comparing
	values in the messages to known values. For example, the
	member names in the metadata response might be
	compared to specific member names such as <spanx
	style="verb">resource</spanx>.  Comparing Unicode <xref target="UNICODE"/> strings,
	however, has significant security implications.
      </t>
      <t>
	Therefore, comparisons between JSON strings and other Unicode
	strings MUST be performed as specified below:

	<list style="numbers">

          <t>
	    Remove any JSON applied escaping to produce an array of
	    Unicode code points.
	  </t>
          <t>
	    Unicode Normalization <xref target="USA15"/> MUST NOT
	    be applied at any point to either the JSON string or to
	    the string it is to be compared against.
	  </t>
          <t>
	    Comparisons between the two strings MUST be performed as a
	    Unicode code point to code point equality comparison.
	  </t>

        </list>
      </t>
      <t>
	Note that this is the same equality comparison procedure described in
	Section 8.3 of <xref target="RFC8259"/>.
      </t>

    </section>

    <section anchor="Security" title="Security Considerations">

      <section anchor="TLSRequirements" title="TLS Requirements">
	<t>
	  Implementations MUST support TLS.
	  Which version(s) ought to be implemented will vary over
	  time, and depend on the widespread deployment and known
	  security vulnerabilities at the time of implementation.
	  Implementations SHOULD follow the guidance in
	  BCP 195 <xref target="RFC8996"/> <xref target="RFC9325"/>,
	  which provides recommendations and requirements
	  for improving the security of deployed services that use TLS.
	</t>
	<t>
	  To protect against information disclosure and tampering,
	  confidentiality protection MUST be applied using TLS
	  with a ciphersuite that provides confidentiality and
	  integrity protection.
	</t>
      </section>

      <section anchor="Scopes" title="Scopes">
      	<t>
					The <spanx style="verb">scopes_supported</spanx> parameter is the list of scopes the resource server is willing to disclose that it supports. It is not meant to indicate that an OAuth client should request all scopes in the list. The client SHOULD still follow OAuth best practices and request tokens with as limited scope as possible for the given operation, as described in Section 2.3 of OAuth 2.0 Security Best Current Practice <xref target="I-D.ietf-oauth-security-topics"/>.
      	</t>
      </section>

      <section anchor="Impersonation" title="Impersonation Attacks">
	<t>
	  TLS certificate checking MUST be performed by the client,
	  as described in <xref target="TLSRequirements"/>,
	  when making a protected resource metadata request.
	  Checking that the server certificate is valid for the resource identifier URL
	  prevents man-in-middle and DNS-based attacks.
	  These attacks could cause a client to be tricked into using an attacker's
	  resource server, which would enable impersonation of the legitimate protected resource.
	  If an attacker can accomplish this, they can access the resources
	  that the affected client has access to
	  using the protected resource that they are impersonating.
	</t>
	<t>
	  An attacker may also attempt to impersonate a protected resource by publishing
	  a metadata document that contains a <spanx style="verb">resource</spanx> claim
	  using the resource identifier URL of the protected resource being impersonated,
	  but containing information of the attacker's choosing.
	  This would enable it to impersonate that protected resource, if accepted by the client.
	  To prevent this, the client MUST ensure that the resource identifier URL it is using
	  as the prefix for the metadata request exactly matches the value of
	  the <spanx style="verb">resource</spanx> metadata value
	  in the protected resource metadata document received by the client,
	  as described in <xref target="PRConfigurationValidation"/>.
	</t>
      </section>

      <section anchor="AudienceRestriction" title="Audience-Restricted Access Tokens">
      	<t>
      		If a client expects to interact with multiple resource servers, the client
      		SHOULD request audience-restricted access tokens using <xref target="RFC8707"/>,
      		and the authorization server SHOULD support audience-restricted access tokens.
      	</t>
      	<t>
      		Without audience-restricted access tokens, a malicious resource server (RS1) may be
      		able to use the <spanx style="verb">WWW-Authenticate</spanx> header to get a client
      		to request an access token with a scope used by a legitimate resource server (RS2), and
      		after the client sends a request to RS1, then RS1 could re-use the access token at RS2.
      	</t>
      	<t>
      		While this attack is not explicitly enabled by this specification, and is possible in
      		a plain OAuth 2.0 deployment, it is made somewhat more likely by the use of
      		dynamically-configured clients. As such, the use
      		of audience-restricted access tokens and Resource Indicators <xref target="RFC8707"/>
      		is RECOMMENDED when using the features in this specification.
      	</t>
      </section>

      <section anchor="StandardFormat" title="Publishing Metadata in a Standard Format">
	<t>
	  Publishing information about the protected resource in a standard format
	  makes it easier for both legitimate clients and attackers
	  to use the protected resource.
	  Whether a protected resource publishes its metadata in an ad-hoc manner
	  or in the standard format defined by this specification,
	  the same defenses against attacks that might be mounted
	  that use this information should be applied.
	</t>
      </section>

      <section anchor="AuthorizationServers" title="Authorization Servers">
	<t>
	  To support use cases in which the set of legitimate authorization servers
	  to use with the protected resource is fixed and enumerable,
	  this specification defines the <spanx style="verb">authorization_servers</spanx>
	  metadata value, which enables explicitly listing them.
	  Note that if the set of legitimate protected resources
	  to use with an authorization server is also fixed and enumerable,
	  lists in the protected resource metadata and authorization server metadata
	  should be cross-checked against one another for consistency
	  when these lists are used by the application profile.
	</t>
	<t>
	  Secure determination of appropriate authorization servers
	  to use with a protected resource for all use cases
	  is out of scope of this specification.
	  This specification assumes that the client has a means of determining
	  appropriate authorization servers to use with a protected resource
	  and that the client is using the correct metadata
	  for each protected resource.
	  Implementers need to be aware that if an inappropriate authorization server
	  is used by the client, that an attacker may be able to act as
	  a man-in-the-middle proxy to a valid authorization server without
	  it being detected by the authorization server or the client.
	</t>
	<t>
	  The ways to determine the appropriate authorization servers to use
	  with a protected resource are in general, application-dependent.
	  For instance, some protected resources are used with
	  a fixed authorization server or set of authorization servers,
	  the locations of which may be well known,
	  or which could be published as metadata values by the protected resource.
	  In other cases, the set of authorization servers that can be used with
	  a protected resource can by dynamically changed
	  by administrative actions
	  or by changes to the set of authorization servers adhering to a trust framework.
	  Many other means of determining appropriate associations between
	  protected resources and authorization servers are also possible.
	</t>
      </section>

      <section anchor="SSRF" title="Server-Side Request Forgery (SSRF)">
      	<t>
					The OAuth client is expected to fetch the authorization server metadata based on the value of the issuer in the resource server metadata. Since this specification enables clients to interoperate with RSs and ASs it has no prior knowledge of, this opens a risk for SSRF attacks by malicious users or malicious resource servers. Clients SHOULD take appropriate precautions against SSRF attacks, such as blocking requests to internal IP address ranges. Further recommendations can be found in the OWASP SSRF Prevention Cheat Sheet <xref target="OWASP.SSRF"/>.
				</t>
      </section>

      <section anchor="phishing" title="Phishing">
      	<t>
      		This specification may be deployed in a scenario where the desired HTTP resource is identified by a user-selected URL. If this resource is malicious or compromised, it could mislead the user into revealing their account credentials or authorizing unwanted access to OAuth-controlled capabilities. This risk is reduced, but not eliminated, by following best practices for OAuth user interfaces, such as providing clear notice to the user, displaying the authorization server's domain name, supporting origin-bound phishing-resistant authenticators, supporting the use of password managers, and applying heuristic checks such as domain reputation.
      	</t>
      </section>

      <section anchor="UnsignedMetadata"
	       title="Differences between Unsigned and Signed Metadata">
	<t>
	  Unsigned metadata is integrity protected by use of TLS at the site
	  where it is hosted.
	  This means that its security is dependent upon the Internet
	  Public Key Infrastructure (PKI) <xref target="RFC9525"/>.
	  Signed metadata is additionally integrity protected by the JWS signature
	  applied by the issuer, which is not dependent upon the Internet PKI.
	</t>
	<t>
	  When using unsigned metadata, the party issuing the metadata
	  is the protected resource itself, which is represented by the
	  <spanx style="verb">resource</spanx> value in the metadata.
	  Whereas, when using signed metadata, the party issuing the metadata
	  is represented by the <spanx style="verb">iss</spanx> (issuer) claim
	  in the signed metadata.
	  When using signed metadata, applications can make trust decisions
	  based on the issuer that performed the signing --
	  information that is not available when using unsigned metadata.
	  How these trust decisions are made is out of scope for this specification.
	</t>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">

      <t>
	The following registration procedure is used for the
	registry established by this specification.
      </t>
      <t>
	Values are registered on a Specification Required <xref target="RFC8126"/>
	basis after a two-week review period on the oauth-ext-review@ietf.org
	mailing list, on the advice of one or more Designated Experts.
	However, to allow for the allocation of values prior to publication,
	the Designated Experts may approve registration once they are satisfied
	that such a specification will be published.
       </t>
       <t>
	Registration requests sent to the mailing list for review should use
	an appropriate subject
	(e.g., "Request to register OAuth Protected Resource Metadata: example").
       </t>
      <t>
	Within the review period, the Designated Experts will either approve or
	deny the registration request, communicating this decision to the review list and IANA.
	Denials should include an explanation and, if applicable, suggestions as to how to make
	the request successful.
	Registration requests that are undetermined for
	a period longer than 21 days can be brought to the IESG's attention
	(using the iesg@ietf.org mailing list) for resolution.
      </t>
      <t>
	Criteria that should be applied by the Designated Experts includes
	determining whether the proposed registration duplicates existing functionality,
	determining whether it is likely to be of general applicability
	or whether it is useful only for a single application,
	and whether the registration makes sense.
      </t>
      <t>
	IANA must only accept registry updates from the Designated Experts and should direct
	all requests for registration to the review mailing list.
      </t>
      <t>
	It is suggested that multiple Designated Experts be appointed who are able to
	represent the perspectives of different applications using this specification,
	in order to enable broadly-informed review of registration decisions.
	In cases where a registration decision could be perceived as
	creating a conflict of interest for a particular Expert,
	that Expert should defer to the judgment of the other Experts.
      </t>

      <section title="OAuth Protected Resource Metadata Registry" anchor="PRMetadataReg">
	<t>
	  This specification establishes the
	  IANA "OAuth Protected Resource Metadata" registry
	  for OAuth 2.0 protected resource metadata names.
	  The registry records the protected resource metadata member
	  and a reference to the specification that defines it.
	</t>

        <section title="Registration Template" anchor="PRMetadataTemplate">
          <t>
            <list style='hanging'>
              <t hangText='Metadata Name:'>
                <vspace/>
                The name requested (e.g., "resource").
		This name is case-sensitive.
		Names may not match other registered names in a case-insensitive manner
		unless the Designated Experts state that there is a compelling reason
		to allow an exception.
              </t>
              <t hangText='Metadata Description:'>
                <vspace/>
                Brief description of the metadata (e.g., "Resource identifier URL").
              </t>
              <t hangText='Change Controller:'>
                <vspace/>
                For Standards Track RFCs, list the "IETF".
		For others, give the name of the responsible party.
		Other details (e.g., postal address, email address, home page URI) may also be included.
              </t>
              <t hangText='Specification Document(s):'>
                <vspace/>
                Reference to the document or documents that specify the parameter,
		preferably including URIs that
                can be used to retrieve copies of the documents.
		An indication of the relevant
                sections may also be included but is not required.
              </t>
            </list>
          </t>
        </section>

        <section title="Initial Registry Contents" anchor="PRMetadataContents">
          <t> <?rfc subcompact="yes"?>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">resource</spanx>
              </t>
              <t>
                Metadata Description:
		Protected resource's resource identifier URL
              </t>
              <t>
                Change Controller: IETF
              </t>
              <t>
                Specification Document(s): <xref target="PRMetadata"/> of [[ this specification ]]
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">authorization_servers</spanx>
              </t>
              <t>
                Metadata Description:
		JSON array containing a list of OAuth authorization server issuer identifiers
              </t>
              <t>
                Change Controller: IETF
              </t>
              <t>
                Specification Document(s): <xref target="PRMetadata"/> of [[ this specification ]]
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">jwks_uri</spanx>
              </t>
              <t>
                Metadata Description:
		URL of the protected resource's JWK Set document
              </t>
              <t>
                Change Controller: IETF
              </t>
              <t>
                Specification Document(s): <xref target="PRMetadata"/> of [[ this specification ]]
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">scopes_supported</spanx>
              </t>
              <t>
                Metadata Description:
		JSON array containing a list of the OAuth 2.0
		<spanx style="verb">scope</spanx> values that
		are used in authorization requests to request access this protected resource
              </t>
              <t>
                Change Controller: IETF
              </t>
              <t>
                Specification Document(s): <xref target="PRMetadata"/> of [[ this specification ]]
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">bearer_methods_supported</spanx>
              </t>
              <t>
                Metadata Description:
		JSON array containing a list of the OAuth 2.0 Bearer Token
		presentation methods that this protected resource supports
              </t>
              <t>
                Change Controller: IETF
              </t>
              <t>
                Specification Document(s): <xref target="PRMetadata"/> of [[ this specification ]]
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">resource_signing_alg_values_supported</spanx>
              </t>
              <t>
                Metadata Description:
		JSON array containing a list of the JWS signing algorithms
		(<spanx style="verb">alg</spanx> values)
		supported by the protected resource
		for signed content
              </t>
              <t>
                Change Controller: IETF
              </t>
              <t>
                Specification Document(s): <xref target="PRMetadata"/> of [[ this specification ]]
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">resource_documentation</spanx>
              </t>
              <t>
                Metadata Description:
		URL of a page containing human-readable information that
		developers might want or need to know when using the protected resource
              </t>
              <t>
                Change Controller: IETF
              </t>
              <t>
                Specification Document(s): <xref target="PRMetadata"/> of [[ this specification ]]
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">resource_policy_uri</spanx>
              </t>
              <t>
                Metadata Description:
		URL that the protected resource provides
		to read about the protected resource's requirements on how
		the client can use the data provided by the protected resource
              </t>
              <t>
                Change Controller: IETF
              </t>
              <t>
                Specification Document(s): <xref target="PRMetadata"/> of [[ this specification ]]
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">resource_tos_uri</spanx>
              </t>
              <t>
                Metadata Description:
		URL that the protected resource provides
		to read about the protected resource's terms of service
              </t>
              <t>
                Change Controller: IETF
              </t>
              <t>
                Specification Document(s): <xref target="PRMetadata"/> of [[ this specification ]]
              </t>
            </list>
          </t>
	  <t>
	    <list style='symbols'>
	      <t>
		Metadata Name: signed_metadata
	      </t>
	      <t>
		Metadata Description:
		Signed JWT containing metadata values about the protected resource as claims
	      </t>
	      <t>
		Change Controller: IETF
	      </t>
	      <t>
		Specification Document(s): <xref target="SignedMetadata"/> of [[ this specification ]]
	      </t>
	    </list>
	  </t>
	</section>
	<?rfc subcompact="no"?>
      </section>

      <section title="OAuth Authorization Server Metadata Registry" anchor="ASMetadataReg">
	<t>
	  The following authorization server metadata value
	  is registered in the IANA
	  "OAuth Authorization Server Metadata" registry established in
	  <xref target="RFC8414">OAuth 2.0 Authorization Server Metadata</xref>.
	</t>

	<section title="Registry Contents" anchor="ASMetadataContents">
          <t>
	    <?rfc subcompact="yes"?>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">protected_resources</spanx>
              </t>
              <t>
                Metadata Description:
		JSON array containing a list of resource identifiers for OAuth protected resources
              </t>
              <t>
                Change Controller: IETF
              </t>
              <t>
                Specification Document(s): <xref target="ASMetadata"/> of [[ this specification ]]
              </t>
            </list>
          </t>
	</section>
	<?rfc subcompact="no"?>
      </section>

      <section anchor="WellKnownRegistry" title="Well-Known URI Registry">
	<t>
	  This specification registers the well-known URI defined in
	  <xref target="PRConfig"/> in the IANA
	  "Well-Known URIs" registry <xref target="IANA.well-known"/>.
	</t>

	<section anchor='WellKnownContents' title='Registry Contents'>
	  <t> <?rfc subcompact="yes"?>
            <list style='symbols'>
	      <t>
		URI suffix: <spanx style="verb">oauth-protected-resource</spanx>
	      </t>
	      <t>
		Change controller: IETF
	      </t>
	      <t>
		Specification document: <xref target="PRConfig"/> of [[ this specification ]]
	      </t>
	      <t>
		Related information: (none)
	      </t>
	    </list>
	  </t>
	</section>
	<?rfc subcompact="no"?>

      </section>

    </section>
  </middle>

  <back>
    <references title="Normative References">
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6749.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6750.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7033.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7591.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8259.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8414.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8615.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8707.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8996.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9325.xml"/>

      <reference anchor="USA15" target="http://www.unicode.org/reports/tr15/">
	<front>
	  <title>Unicode Normalization Forms</title>

	  <author fullname="Mark Davis" initials="M." surname="Davis">
	  </author>

	  <author fullname="Ken Whistler" initials="K." surname="Whistler">
	  </author>

	  <date day="1" month="June" year="2015" />
	</front>

	<seriesInfo name="Unicode Standard Annex" value="15" />
      </reference>

      <reference anchor="JWT" target="http://tools.ietf.org/html/rfc7519">
        <front>
          <title>JSON Web Token (JWT)</title>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Ping Identity">Ping Identity</organization>
          </author>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nomura Research Institute, Ltd.</organization>
          </author>

          <date month="May" year="2015" />
        </front>

	<seriesInfo name="RFC" value="7519"/>
	<seriesInfo name="DOI" value="10.17487/RFC7519"/>
      </reference>

      <reference anchor="JWS" target="http://tools.ietf.org/html/rfc7515">
        <front>
          <title>JSON Web Signature (JWS)</title>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Ping Identity">Ping Identity</organization>
          </author>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nomura Research Institute, Ltd.</organization>
          </author>

          <date month="May" year="2015" />
        </front>

	<seriesInfo name="RFC" value="7515"/>
	<seriesInfo name="DOI" value="10.17487/RFC7515"/>
      </reference>

      <reference anchor="JWE" target="http://tools.ietf.org/html/rfc7516">
        <front>
          <title>JSON Web Encryption (JWE)</title>

	  <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
	    <organization>Microsoft</organization>
	  </author>

	  <author fullname="Joe Hildebrand" initials="J." surname="Hildebrand">
	    <organization>Cisco Systems, Inc.</organization>
	  </author>

	  <date month="May" year="2015" />
        </front>

	<seriesInfo name="RFC" value="7516"/>
	<seriesInfo name="DOI" value="10.17487/RFC7516"/>
      </reference>

      <reference anchor="JWA" target="http://tools.ietf.org/html/rfc7518">
        <front>
          <title>JSON Web Algorithms (JWA)</title>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft</organization>
          </author>

          <date month="May" year="2015" />
        </front>

	<seriesInfo name="RFC" value="7518"/>
	<seriesInfo name="DOI" value="10.17487/RFC7518"/>
      </reference>

      <reference anchor="JWK" target="http://tools.ietf.org/html/rfc7517">
        <front>
	  <title>JSON Web Key (JWK)</title>

	  <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
	    <organization>Microsoft</organization>
	  </author>

	  <date month="May" year="2015" />
        </front>

	<seriesInfo name="RFC" value="7517"/>
	<seriesInfo name="DOI" value="10.17487/RFC7517"/>
      </reference>

      <reference anchor="UNICODE" target="http://www.unicode.org/versions/latest/">
	<front>
	  <title abbrev="Unicode">The Unicode Standard</title>
	  <author>
	    <organization>The Unicode Consortium</organization>
	    <address />
	  </author>
	  <date />
	</front>
	<!--
	  Note that this reference is to the latest version of Unicode,
	  rather than to a specific release.  It is not expected that future changes in
	  the UNICODE specification will impact the syntax of JSON or the UTF-8 encoding.
	-->
      </reference>

    </references>

    <references title="Informative References">

      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9470.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9525.xml"/>

      <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-oauth-security-topics-29.xml"/>

      <reference anchor="OpenID.Discovery" target="https://openid.net/specs/openid-connect-discovery-1_0.html">
	<front>
	  <title>OpenID Connect Discovery 1.0</title>

	  <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
	    <organization abbrev="NAT.Consulting (was at NRI)">NAT.Consulting</organization>
	  </author>

	  <author fullname="John Bradley" initials="J." surname="Bradley">
	    <organization abbrev="Yubico (was at Ping Identity)">Yubico</organization>
	  </author>

	  <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
	    <organization abbrev="Self-Issued Consulting (was at Microsoft)">Self-Issued Consulting</organization>
	  </author>

	  <author fullname="Edmund Jay" initials="E." surname="Jay">
	    <organization abbrev="Illumila">Illumila</organization>
	  </author>

          <date day="15" month="December" year="2023"/>
	</front>
      </reference>

      <reference anchor="IANA.well-known" target="http://www.iana.org/assignments/well-known-uris">
        <front>
          <title>Well-Known URIs</title>
          <author>
            <organization>IANA</organization>
          </author>
	  <date/>
        </front>
      </reference>

      <reference anchor="OWASP.SSRF" target="https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html">
      	<front>
      		<title>OWASP SSRF Prevention Cheat Sheet</title>
      		<author>
      			<organization>OWASP</organization>
      		</author>
      	</front>
      </reference>

      <reference anchor="FAPI.MessageSigning" target="https://openid.net/specs/fapi-2_0-message-signing.html">
      	<front>
      		<title>FAPI 2.0 Message Signing</title>
      		<author fullname="Dave Tonge" initials="D." surname="Tonge">
      			<organization abbrev="Moneyhub">Moneyhub Financial Technology</organization>
      		</author>
      		<author fullname="Daniel Fett" initials="D." surname="Fett">
      			<organization>Authlete</organization>
      		</author>
      		<date day="24" month="March" year="2023" />
      	</front>
      </reference>

    </references>

    <section anchor="Acknowledgements" title="Acknowledgements">

      <t>
	The authors of this specification would like to thank the attendees of the IETF 115 OAuth and HTTP API Working Group meetings
	and the attendees of subsequent OAuth Working Group meetings for their input on this specification.
	We would would also like to thank
	Brian Campbell,
	Deb Cooley,
	Vladimir Dzhuvinov,
	George Fletcher,
	Pieter Kasselman,
	Tony Nadalin,
	Rifaat Shekh-Yusef,
	Filip Skokan,
	and
	Atul Tulshibagwale
	for their contributions to the specification.
      </t>
    </section>

    <section anchor="History" title="Document History">
      <t>[[ to be removed by the RFC Editor before publication as an RFC ]]</t>

      <t>
	-08
	<list style="symbols">
	  <t>
	    Added Security Considerations about the differences between
	    unsigned and signed metadata, as suggested by Deb Cooley.
	  </t>
	  <t>
	    Updated obsolete references.
	  </t>
	</list>
      </t>

      <t>
	-07
	<list style="symbols">
	  <t>
	    Removed extraneous paragraph about downgrade attacks discussing
	    an issue that's already addressed elsewhere in the specification.
	  </t>
	</list>
      </t>

      <t>
	-06
	<list style="symbols">
	  <t>
	    Addressed shepherd review comments by Rifaat Shekh-Yusef.
	  </t>
	</list>
      </t>

      <t>
			-05
      <list style="symbols">
			  <t>
			    Added SVG diagram
			  </t>
		  	</list>
		  </t>

      <t>
	-04
        <list style="symbols">
	  <t>
	    Applied working group last call suggestions by
	    Atul Tulshibagwale.
	  </t>
	  <t>
	    Better described the purpose of
	    <spanx style="verb">resource_signing_alg_values_supported</spanx> and
	    removed <spanx style="verb">resource_encryption_alg_values_supported</spanx> and
	    <spanx style="verb">resource_encryption_enc_values_supported</spanx>,
	    per WGLC comments by Vladimir Dzhuvinov and Brian Campbell.
	  </t>
	  <t>
	    Applied suggestions by Pieter Kasselman.
	  </t>
	</list>
      </t>

      <t>
	-03
        <list style="symbols">
	  <t>
	    Applied correction by Filip Skokan.
	  </t>
	</list>
      </t>

      <t>
	-02
	<list style="symbols">
	  <t>
	    Switched from concatenating .well-known to the end of the resource identifier
	    to inserting it between the host and path components of it.
	  </t>
	  <t>
	    Have WWW-Authenticate return <spanx style="verb">resource_metadata</spanx> rather than <spanx style="verb">resource</spanx>.
	  </t>
	</list>
      </t>

      <t>
	-01
        <list style="symbols">
	  <t>
	    Renamed scopes_provided to scopes_supported.
	  </t>
	  <t>
	    Added security consideration for scopes_supported.
	  </t>
	  <t>
	    Use BCP 195 for TLS recommendations.
	  </t>
	  <t>
	    Clarified that resource metadata can be used by clients and authorization servers.
	  </t>
	  <t>
	    Updated references.
	  </t>
	  <t>
	    Added security consideration recommending audience-restricted access tokens.
	  </t>
	  <t>
	    Mention FAPI Message Signing as a use case for publishing signing keys.
	  </t>
	</list>
      </t>

      <t>
	-00
        <list style="symbols">
	  <t>
	    Initial working group version based on draft-jones-oauth-resource-metadata-04.
	  </t>
	</list>
      </t>

    </section>

  </back>
</rfc>
