<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     ipr="trust200902"
     docName="draft-forten-oauth-scope-metadata-document-00"
     category="info"
     submissionType="IETF"
     xml:lang="en"
     tocInclude="true"
     sortRefs="true"
     symRefs="true"
     version="3">

  <front>
    <title abbrev="OAuth Scope Metadata Document">OAuth Scope Metadata Document</title>
    <seriesInfo name="Internet-Draft" value="draft-forten-oauth-scope-metadata-document-00"/>

    <author initials="S. F." surname="Lee" fullname="Su-hyeon Forten Lee">
      <address>
        <email>nine01223@naver.com</email>
      </address>
    </author>

    <date year="2026" month="October" day="16"/>

    <area>Security</area>
    <workgroup>Web Authorization Protocol</workgroup>
    <keyword>OAuth</keyword>
    <keyword>scope</keyword>
    <keyword>metadata</keyword>

    <abstract>
      <t>This document describes how an OAuth scope value that is an
      HTTPS URI can be dereferenced to obtain a JSON document describing
      that scope. The document is descriptive only and does not change
      the authorization meaning of the scope. Dereferencing follows the
      pattern and security rules of the OAuth Client ID Metadata
      Document.</t>
    </abstract>

    <note removeInRFC="true">
      <name>About This Document</name>
      <t>Discussion of this document takes place on the Web Authorization
      Protocol Working Group mailing list (mailto:oauth@ietf.org), which is
      archived at <eref target="https://mailarchive.ietf.org/arch/browse/oauth/"/>.</t>
    </note>
  </front>

  <middle>

    <section anchor="intro">
      <name>Introduction</name>
      <t>Scope values are opaque strings (<xref target="RFC6749" section="3.3"/>).
      A client or authorization server that receives a scope from a
      protected resource it has not seen before has no way to learn what
      the scope means.</t>
      <t>The problem is most visible when a single authorization server
      serves many protected resources behind a gateway. From the scope
      string alone, the authorization server cannot tell which resource
      defined it, and scope names may collide across resources. An AI
      agent acting as a client without prior arrangement has no basis
      for choosing which scope to request.</t>
      <t>This document lets the scope value itself be an HTTPS URI from
      which a description can be obtained. Because the value is the
      location of its description, no separate discovery and no mapping
      between scopes and resources is needed.</t>

      <section anchor="conventions">
        <name>Conventions and Definitions</name>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
        "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>",
        "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>",
        "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>",
        "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and
        "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
        described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/>
        when, and only when, they appear in all capitals, as shown here.</t>
      </section>
    </section>

    <section anchor="uri">
      <name>Scope Metadata URI</name>
      <t>A Scope Metadata URI is a scope value that adopts the constraints
      <xref target="CIMD"/> places on a client_id URL:</t>
      <ul>
        <li>its scheme is "https";</li>
        <li>it contains a path component;</li>
        <li>it <bcp14>MUST NOT</bcp14> contain a fragment, user information, or
        dot segments;</li>
        <li>it <bcp14>SHOULD NOT</bcp14> contain a query component.</li>
      </ul>
      <t>The entire scope-token (<xref target="RFC6749" section="3.3"/>)
      <bcp14>MUST</bcp14> be a single URI meeting these constraints. A
      scope value that does not is not a Scope Metadata URI and is
      processed as an opaque string as in <xref target="RFC6749"/>. In a
      space-delimited list of scopes, each scope-token is evaluated
      separately.</t>
    </section>

    <section anchor="document">
      <name>Scope Metadata Document</name>
      <t>A Scope Metadata Document is a JSON object <xref target="RFC8259"/>,
      served with a 200 status code and the media type "application/json".
      It has the following members, whose names and meanings are aligned
      with the type metadata of
      <xref target="I-D.ietf-oauth-rar-metadata-remediation"/>.</t>
      <dl>
        <dt>description</dt>
        <dd><bcp14>OPTIONAL</bcp14>. A JSON string containing a human-readable
        description of what the scope permits.</dd>
        <dt>documentation_uri</dt>
        <dd><bcp14>OPTIONAL</bcp14>. A JSON string containing a URI of
        further documentation.</dd>
      </dl>
      <t>Recipients <bcp14>MUST</bcp14> ignore members they do not
      understand. The document does not carry information used for
      authorization decisions, such as permitted ranges or inclusion
      relationships with other scopes.</t>
      <t>Example request and response:</t>
      <sourcecode type="http-message"><![CDATA[
GET /scopes/files/write HTTP/1.1
Host: gw.example.com
Accept: application/json

HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: max-age=86400

{
  "description": "Create and modify files in the drive.",
  "documentation_uri": "https://docs.example.com/scopes#files-write"
}
]]></sourcecode>
    </section>

    <section anchor="retrieval">
      <name>Retrieval</name>
      <t>A dereferencing party (an authorization server or a client)
      <bcp14>MUST</bcp14> dereference only Scope Metadata URIs that start
      with a trusted prefix. How trusted prefixes are configured is a
      matter of deployment policy.</t>
      <t>The dereferencing party sends an HTTP GET to the URI. As in
      <xref target="CIMD"/>:</t>
      <ul>
        <li>it <bcp14>MUST NOT</bcp14> automatically follow redirects;</li>
        <li>it treats any status code other than 200 as a failure;</li>
        <li>it <bcp14>MUST NOT</bcp14> retrieve a URI that resolves to a
        special-purpose IP address <xref target="RFC6890"/>;</li>
        <li>it <bcp14>SHOULD</bcp14> limit response size, and caches
        responses according to <xref target="RFC9111"/>.</li>
      </ul>
      <t>In addition to <xref target="CIMD"/>, the dereferencing party
      <bcp14>MUST</bcp14> apply the special-purpose address check to the
      address it actually connects to, not only to the result of an
      earlier DNS lookup, and <bcp14>SHOULD</bcp14> limit retrieval
      time.</t>
      <t>If retrieval fails or the document does not conform to
      <xref target="document"/>, then, unlike <xref target="CIMD"/>, which
      aborts the authorization request in that case, the dereferencing party
      <bcp14>MUST</bcp14> retain the scope value as received and
      <bcp14>MUST NOT</bcp14> reject an authorization request solely
      because dereferencing failed; the scope value continues to be
      processed as an opaque string as in <xref target="RFC6749"/>. It
      <bcp14>SHOULD</bcp14> cache the failure for a period to avoid
      repeated retrieval.</t>
    </section>

    <section anchor="processing">
      <name>Processing Rules</name>
      <t>The document is descriptive only. An authorization server
      <bcp14>MAY</bcp14> use it in a consent screen, and a client
      <bcp14>MAY</bcp14> use it when choosing scopes to request. The
      authorization server and the protected resource <bcp14>MUST NOT</bcp14>
      use it as the basis for granting or enforcing access.</t>
    </section>

    <section anchor="security">
      <name>Security Considerations</name>
      <t>SSRF: The dereferencing party retrieves a URI it received from
      elsewhere. The trusted prefix restriction and the special-purpose
      address prohibition (<xref target="retrieval"/>) apply together, and
      the SSRF considerations of <xref target="CIMD"/> apply in full. A
      check made only at an initial DNS lookup can be bypassed by DNS
      rebinding, which is why the address check applies to each
      connection.</t>
      <t>Forged descriptions: An attacker could publish a misleading
      description to induce user consent. Trusted prefixes reduce this
      risk, but the party controlling documents under a prefix still has
      to be trusted.</t>
      <t>Prompt injection: A client based on a large language model
      <bcp14>MUST</bcp14> treat the description as data, not as
      instructions.</t>
    </section>

    <section anchor="privacy">
      <name>Privacy Considerations</name>
      <t>The party hosting documents can observe from retrieval requests
      which client or authorization server handles which scope, and when.
      Dereferencing parties use caching to reduce retrieval frequency and
      <bcp14>MUST NOT</bcp14> include user-identifying information in
      requests.</t>
    </section>

    <section anchor="iana">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>

  </middle>

  <back>
    <references>
      <name>References</name>

      <references>
        <name>Normative References</name>

        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner"/>
            <date year="1997" month="March"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>

        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="B. Leiba"/>
            <date year="2017" month="May"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>

        <reference anchor="RFC6749" target="https://www.rfc-editor.org/info/rfc6749">
          <front>
            <title>The OAuth 2.0 Authorization Framework</title>
            <author initials="D." surname="Hardt" fullname="D. Hardt" role="editor"/>
            <date year="2012" month="October"/>
          </front>
          <seriesInfo name="RFC" value="6749"/>
          <seriesInfo name="DOI" value="10.17487/RFC6749"/>
        </reference>

        <reference anchor="RFC6890" target="https://www.rfc-editor.org/info/rfc6890">
          <front>
            <title>Special-Purpose IP Address Registries</title>
            <author initials="M." surname="Cotton" fullname="M. Cotton"/>
            <author initials="L." surname="Vegoda" fullname="L. Vegoda"/>
            <author initials="R." surname="Bonica" fullname="R. Bonica" role="editor"/>
            <author initials="B." surname="Haberman" fullname="B. Haberman"/>
            <date year="2013" month="April"/>
          </front>
          <seriesInfo name="BCP" value="153"/>
          <seriesInfo name="RFC" value="6890"/>
          <seriesInfo name="DOI" value="10.17487/RFC6890"/>
        </reference>

        <reference anchor="RFC8259" target="https://www.rfc-editor.org/info/rfc8259">
          <front>
            <title>The JavaScript Object Notation (JSON) Data Interchange Format</title>
            <author initials="T." surname="Bray" fullname="T. Bray" role="editor"/>
            <date year="2017" month="December"/>
          </front>
          <seriesInfo name="STD" value="90"/>
          <seriesInfo name="RFC" value="8259"/>
          <seriesInfo name="DOI" value="10.17487/RFC8259"/>
        </reference>

        <reference anchor="RFC9111" target="https://www.rfc-editor.org/info/rfc9111">
          <front>
            <title>HTTP Caching</title>
            <author initials="R." surname="Fielding" fullname="R. Fielding" role="editor"/>
            <author initials="M." surname="Nottingham" fullname="M. Nottingham" role="editor"/>
            <author initials="J." surname="Reschke" fullname="J. Reschke" role="editor"/>
            <date year="2022" month="June"/>
          </front>
          <seriesInfo name="STD" value="98"/>
          <seriesInfo name="RFC" value="9111"/>
          <seriesInfo name="DOI" value="10.17487/RFC9111"/>
        </reference>

        <reference anchor="CIMD" target="https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document-02">
          <front>
            <title>OAuth Client ID Metadata Document</title>
            <author initials="A." surname="Parecki" fullname="Aaron Parecki"/>
            <author initials="E." surname="Smith" fullname="Emelia Smith"/>
            <date year="2026" month="July" day="6"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-oauth-client-id-metadata-document-02"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
      </references>

      <references>
        <name>Informative References</name>

        <reference anchor="I-D.ietf-oauth-rar-metadata-remediation" target="https://datatracker.ietf.org/doc/html/draft-ietf-oauth-rar-metadata-remediation-00">
          <front>
            <title>OAuth 2.0 RAR Metadata and Error Remediation</title>
            <author initials="Y." surname="Zehavi" fullname="Yaron Zehavi"/>
            <date year="2026" month="August" day="23"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-oauth-rar-metadata-remediation-00"/>
          <refcontent>Work in Progress</refcontent>
        </reference>

        <reference anchor="RFC9396" target="https://www.rfc-editor.org/info/rfc9396">
          <front>
            <title>OAuth 2.0 Rich Authorization Requests</title>
            <author initials="T." surname="Lodderstedt" fullname="T. Lodderstedt"/>
            <author initials="J." surname="Richer" fullname="J. Richer"/>
            <author initials="B." surname="Campbell" fullname="B. Campbell"/>
            <date year="2023" month="May"/>
          </front>
          <seriesInfo name="RFC" value="9396"/>
          <seriesInfo name="DOI" value="10.17487/RFC9396"/>
        </reference>

        <reference anchor="UMA-RSR" target="https://docs.kantarainitiative.org/uma/rec-oauth-resource-reg-v1_0_1.html">
          <front>
            <title>OAuth 2.0 Resource Set Registration</title>
            <author initials="T." surname="Hardjono" fullname="Thomas Hardjono" role="editor"/>
            <date year="2015" month="December" day="28"/>
          </front>
          <refcontent>Kantara Initiative Recommendation, Version 1.0.1</refcontent>
        </reference>

        <reference anchor="UMA2-FEDAUTHZ" target="https://docs.kantarainitiative.org/uma/wg/rec-oauth-uma-federated-authz-2.0.html">
          <front>
            <title>Federated Authorization for User-Managed Access (UMA) 2.0</title>
            <author initials="E." surname="Maler" fullname="Eve Maler" role="editor"/>
            <author initials="M." surname="Machulak" fullname="Maciej Machulak"/>
            <author initials="J." surname="Richer" fullname="Justin Richer"/>
            <date year="2018" month="January" day="7"/>
          </front>
          <refcontent>Kantara Initiative Recommendation</refcontent>
        </reference>

        <reference anchor="AAUTH" target="https://datatracker.ietf.org/doc/html/draft-hardt-oauth-aauth-protocol-11">
          <front>
            <title>AAuth Protocol</title>
            <author initials="D." surname="Hardt" fullname="Dick Hardt"/>
            <date year="2026" month="September" day="25"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-hardt-oauth-aauth-protocol-11"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
      </references>
    </references>

    <section anchor="related">
      <name>Related Work</name>
      <ul>
        <li>UMA 1.0 <xref target="UMA-RSR"/> required that a scope URI
        resolve to a scope description document. UMA 2.0
        <xref target="UMA2-FEDAUTHZ"/> relaxed this to MAY and does not
        expect the authorization server to resolve scope descriptions at
        run time. This document extends the idea to OAuth in general and
        adds guardrails.</li>
        <li><xref target="CIMD"/> is the source of the dereferencing pattern
        and security rules.</li>
        <li><xref target="I-D.ietf-oauth-rar-metadata-remediation"/> is the
        source of the member names.</li>
        <li>AAuth <xref target="AAUTH"/> places scope descriptions inline in
        resource metadata. In this document, the scope value itself is the
        location of its description.</li>
      </ul>
    </section>

    <section anchor="open-issues" removeInRFC="true">
      <name>Open Issues</name>
      <ol>
        <li>If <xref target="I-D.ietf-oauth-rar-metadata-remediation"/>
        factors out a common metadata object, whether <xref target="document"/>
        should reference it instead.</li>
        <li>Whether a Scope Metadata URI should also be usable as an
        authorization details type identifier <xref target="RFC9396"/>.</li>
        <li>How a dereferencing party trusts Scope Metadata URIs of a
        previously unknown resource, for which no trusted prefix is
        configured (for example, based on the origin from which the
        protected resource metadata was obtained).</li>
      </ol>
    </section>
  </back>
</rfc>
