<?xml version="1.0" encoding="UTF-8"?>
<?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">
<!--
  NOTE:  This XML file is input used to produce the authoritative copy of an
  OpenID Foundation specification.  The authoritative copy is the HTML output.
  This XML source file is not authoritative.  The statement ipr="none" is
  present only to satisfy the document compilation tool and is not indicative
  of the IPR status of this specification.  The IPR for this specification is
  described in the "Notices" section.  This is a public OpenID Foundation
  document and not a private document, as the private="..." declaration could
  be taken to indicate.
-->
<rfc category="std" docName="openid-federation-1_0" ipr="none" xmlns:xi="http://www.w3.org/2001/XInclude">

  <?rfc toc="yes" ?>
  <?rfc tocdepth="5" ?>
  <?rfc symrefs="yes" ?>
  <?rfc sortrefs="yes"?>
  <?rfc strict="yes" ?>
  <?rfc iprnotified="no" ?>
  <?rfc private="Draft" ?>

  <front>
    <title abbrev="OpenID Federation">OpenID Federation 1.0 -
      draft 32
    </title>

    <author fullname="Roland Hedberg" initials="R." role="editor"
            surname="Hedberg">
      <organization>independent</organization>

      <address>
        <email>roland@catalogix.se</email>
      </address>
    </author>

    <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
      <organization abbrev="Self-Issued Consulting">Self-Issued Consulting</organization>

      <address>
        <email>michael_b_jones@hotmail.com</email>

        <uri>https://self-issued.info/</uri>
      </address>
    </author>

    <author fullname="Andreas Åkre Solberg" initials="A.Å."
            surname="Solberg">
      <organization>Sikt</organization>

      <address>
        <email>Andreas.Solberg@sikt.no</email>

        <uri>https://www.linkedin.com/in/andreassolberg/</uri>
      </address>
    </author>

    <author fullname="John Bradley" initials="J." surname="Bradley">
      <organization abbrev="Yubico">Yubico</organization>

      <address>
        <email>ve7jtb@ve7jtb.com</email>

        <uri>http://www.thread-safe.com/</uri>
      </address>
    </author>

    <author fullname="Giuseppe De Marco" initials="G." surname="De Marco">
      <organization>independent</organization>

      <address>
        <email>demarcog83@gmail.com</email>

        <uri>https://www.linkedin.com/in/giuseppe-de-marco-bb054245/</uri>
      </address>
    </author>

    <author fullname="Vladimir Dzhuvinov" initials="V." surname="Dzhuvinov">
      <organization>Connect2id</organization>

      <address>
        <email>vladimir@connect2id.com</email>

        <uri>https://twitter.com/dzhuvi</uri>
      </address>
    </author>

    <date day="4" month="December" year="2023"/>

    <workgroup>OpenID Connect Working Group</workgroup>

    <keyword>OpenID</keyword>
    <keyword>Connect</keyword>
    <keyword>Federation</keyword>

    <abstract>
      <t>
        A federation can be expressed as an agreement between parties that trust each other.
        In bilateral federations, direct trust can be established between
        two organizations belonging to the same federation.
        In a multilateral federation, bilateral agreements might not be practical,
        in which case, trust can be mediated by a third party.
        That is the model used in this specification.
      </t>
      <t>
        An Entity in the federation must be able to trust that other Entities
        it interacts with belong to the same federation.
        It must also be able to trust that the information the other Entities
        publish about themselves has not been tampered with during transport
        and that it adheres to the federation's policies.
          </t>
      <t>
        This specification defines basic components used to build
        multilateral federations and describes how to apply them when
        the underlying authentication protocol used is OpenID Connect or
        the underlying authorization protocol is OAuth 2.0.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>
        This specification describes how two Entities that would like to
        interact can establish trust between them by means of a trusted third party
        called a Trust Anchor.
        A Trust Anchor is an Entity whose main purpose is to issue statements
        about Entities.
        An identity federation can be realized using this specification using
        one or more levels of authorities.
        Examples of authorities are federation operators, organizations,
        departments within organizations, and individual sites.
	This
        specification provides the basic technical trust infrastructure building
        blocks needed to create a dynamic and distributed trust network, such as a
        federation.
      </t>
      <t>
        Note that this specification only concerns itself with how Entities
        in a federation get to know about each other.
        An organization
        MAY be represented by more than one Entity in a federation.
        An Entity MAY also belong to more than one federation.
      </t>
      <figure>
	<preamble>
	  Below is an example of two federations rooted at two different
	  Trust Anchors with some members in common.

	  Every Leaf Entity is able to establish mutual trust with any
	  other Leaf Entity by means of having at least one
	  common Trust Anchor between them.
	</preamble>
	<name>
	  Two Coexisting Federations with Some Members in Common
	</name>
	<artwork><![CDATA[
.-----------------.            .-----------------.
|  Trust Anchor A |            |  Trust Anchor B |
'------.--.-------'            '----.--.--.------'
       |  |                         |  |  |
    .--'  '---. .-------------------'  |  |
    |         | |                      |  |
.---v.  .-----v-v------.   .-----------'  |
| OP |  | Intermediate |   |              |
'----'  '--.--.--.-----'   |    .---------v----.
           |  |  |         |    | Intermediate |
   .-------'  |  '------.  |    '---.--.--.----'
   |          |         |  |        |  |  |
.--v-.      .-v--.     .v--v.   .---'  |  '----.
| RP |      | RS |     | OP |   |      |       |
'----'      '----'     '----'   |   .--v-.   .-v--.
                                |   | RP |   | RP |
                                |   '----'   '----'
                                |
                        .-------v------.
                        | Intermediate |
                        '----.--.--.---'
                             |  |  |
                       .-----'  |  '----.
                       |        |       |
                    .--v-.   .--v-.   .-v--.
                    | OP |   | RP |   | AS |
                    '----'   '----'   '----'
]]>
        </artwork>
      </figure>

      <section title="Requirements Language">
        <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"/>.
        </t>
      </section>
      <section anchor="Terminology" title="Terminology">
        <t>
          This specification uses the terms
          "Claim Name", "Claim Value", "JSON Web Token (JWT)", and "JWT Claims Set"
          defined by <xref target="RFC7519">JSON Web Token (JWT)</xref>
          and the terms "OpenID Provider (OP)" and "Relying Party (RP)" defined
          by <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>.
        </t>
        <t>
          This specification also defines the following terms:
          <list style="hanging">
            <t hangText="Entity">
              <vspace/>
              Something that has a separate and distinct existence and that can
              be identified in a context.
            </t>
            <t hangText="Entity Identifier">
              <vspace/>
              A globally unique URI that is bound to one Entity.
            </t>
            <t hangText="Trust Anchor">
              <vspace/>
              An Entity that represents a trusted third party.
            </t>
            <t hangText="Federation Entity">
              <vspace/>
              An Entity for which it is possible to construct a Trust Chain
              from the Entity to a Trust Anchor.
            </t>
            <t hangText="Entity Statement">
              <vspace/>
              A signed JWT that contains the information needed
              for an Entity to participate in federation(s),
              including metadata about itself
              and policies that apply to other Entities that it is authoritative for.
            </t>
            <t hangText="Entity Configuration">
              <vspace/>
              An Entity Statement issued by an Entity about itself. It contains
              the Entity's signing keys and further data used to control the
              Trust Chain resolution process, such as authority hints.
            </t>
            <t hangText="Subordinate Statement">
              <vspace/>
              An Entity Statement issued by a Superior Entity about
	      an Entity that is immediately Subordinate to it.
            </t>
            <t hangText="Entity Type">
              <vspace/>
              A role and function that an Entity plays
              within a federation. An Entity MUST be of at
              least one type and MAY be of many types.
              For example, an Entity can be both an OpenID Provider
              and Relying Party at the same time.
            </t>
            <t hangText="Entity Type Identifier">
              <vspace/>
              String identifier for an Entity Type.
            </t>
            <t hangText="Federation Operator">
              An organization that is authoritative for a federation.
              A federation operator administers the Trust Anchor(s) for Entities in its federation.
            </t>
            <t hangText="Intermediate Entity">
              <vspace/>
              An Entity that issues
              an Entity Statement appearing somewhere in between those
              issued by the Trust Anchor and the Leaf Entity in a Trust Chain.
              The terms Intermediate Entity and Intermediate are used
              interchangeably in this specification.
            </t>
            <t hangText="Leaf Entity">
              <vspace/>
	      An Entity with no Subordinate Entities.
	      Leaf Entities typically play a protocol role,
	      such as an OpenID Connect Relying Party or OpenID Provider.
            </t>
            <t hangText="Subordinate Entity">
              <vspace/>
                An Entity that is a direct descendant of a Superior Entity
                (a Trust Anchor or Intermediate).
            </t>
            <t hangText="Superior Entity">
              <vspace/>
                An Entity with one or more Entities that are Subordinate to it.
            </t>
            <t hangText="Federation Entity Discovery">
              <vspace/>
              A process that starts with an Entity Identifier and collects
              a number of Entity Statements until the chosen Trust Anchor is reached.
              From the collected Entity Statements, a Trust Chain
              is constructed and verified.
              The result of the Federation Entity Discovery is that the
              Leaf Entity's metadata is constructed from the Trust Chain.
            </t>
            <t hangText="Trust Chain">
              <vspace/>
              A sequence of Entity Statements that represents a chain
              starting at a Leaf Entity and ending in a Trust Anchor.
            </t>
            <t hangText="Trust Mark">
              Statement of conformance to a
              well-scoped set of trust and/or interoperability requirements
              as determined by an accreditation authority.
            </t>
            <t hangText="Federation Entity Keys">
              Keys used for the cryptogaphic signatures required by
              the trust mechanisms defined in this specification.
              Every participant in a Federation publishes its
              Federation Entity Keys in its Entity Configuration.
            </t>
          </list>
        </t>
      </section>
    </section>

    <section title="Overall Architecture" anchor="architecture">
      <t>
        The basic component is the Entity Statement, which is a cryptographically
        signed <xref target="RFC7519">JSON Web Token (JWT)</xref>.
        A set of Entity Statements can form a path from a Leaf Entity to
        a Trust Anchor. Entity Configurations
        issued by Entities about themselves control the Trust Chain
        resolution process.
      </t>
      <t>
        The Entity Configuration of a Leaf Entity contains one or more
        references to its Superiors, found in the
	<spanx style="verb">authority_hints</spanx> parameter
	described in <xref target="authority_hints"/>.
        These references can be used to download the Entity Configuration of each Superior.
        One or more Entity Configurations are traversed during the Federation Entity Discovery
        until the Trust Anchor is reached.
      </t>
      <t>
        The Trust Anchor and its Intermediates issue Entity Statements
        about their Subordinates called Subordinate Statements.
	The sequence of Entity Configurations
        and Subordinate Statements that validate the relationship between
        a Superior and a Subordinate, along a path towards the Trust Anchor,
        forms the proof that a Leaf Entity is a member of
        the federation rooted at the Trust Anchor.
      </t>
      <t>
        The chain that links the statements to one another is verified with
        the signature of each statement, as described in <xref target="trust_chain"/>.
      </t>
      <t>
        With a verified Trust Chain, the federation policy is finally applied
        and the metadata describing a Leaf Entity within the Federation is derived,
        as described in <xref target="federation_policy"/>.
      </t>
      <t>
        This specification deals with trust operations;
        it does not cover or touch protocol operations
        other than metadata derivation and exchange.
        In OpenID Connect terms, these are the protocol operations specified in
        <xref target="OpenID.Discovery">OpenID Connect Discovery 1.0</xref>
        and
        <xref target="OpenID.Registration">OpenID Connect Dynamic Client Registration 1.0</xref>.
      </t>
      <t>
        OpenID Connect is used in all of the examples in this
        specification, however this does not mean that this specification can only be used
        together with OpenID Connect. On the contrary, it can also be
        used to build federations using any other protocols.
      </t>

      <section title="Cryptographic Trust Mechanism" anchor="CryptographicTrustMechanism">
	<t>
	  The objects defined by this specification
	  that are used to establish cryptographic trust between participants
	  are secured as signed JWTs using public key cryptography.
	  In particular, the keys used for securing these objects are managed by
	  the Entities controlling those objects, with the public keys securing them
	  being distributed through those objects themselves.
	  This kind of trust mechanism has been utilized by
	  research and academic federations for over a decade.
	</t>
	<t>
	  Note that this cryptographic trust mechanim intentionally does not rely on
	  Web PKI / TLS certificates for signing keys.
	  Which TLS certificates are considered trusted can vary considerably between systems
	  depending upon which certificate authorities are considered trusted
	  and there are have been notable examples of ostensibly trusted certificates being compromised.
	  For those reasons, this specification explicitly eschews reliance on Web PKI
	  in favor of self-managed public keys, in this case,
	  keys represented as JSON Web Keys (JWKs) <xref target="RFC7517"/>.
	</t>
      </section>
    </section>

      <section anchor="entity-statement" title="Entity Statement">
        <t>
          An Entity Statement contains the information needed for the Entity
          that is the subject of the Entity Statement to participate in federation(s).
          An Entity Statement is a signed JWT.
          The subject of the JWT is the Entity itself.
          The issuer of the JWT is the party that issued the Entity Statement.
          All Entities in a federation publish an Entity Statement about themselves
	  called an Entity Configuration.
	  Superior Entities in a federation publish Entity Statements about
	  their immediate Subordinate Entities called Subordinate Statements.
        </t>
        <t>
          Entity Statement JWTs MUST be explicitly typed, by setting the
          <spanx style="verb">typ</spanx> header parameter to
          <spanx style="verb">entity-statement+jwt</spanx>. This
          prevents cross-JWT confusion, per Section 3.11 of <xref target="RFC8725"/>.
        </t>
        <t>
          The Entity Statement is signed using the private key of the issuer
          Entity in the form of a <xref target="RFC7515">JSON Web Signature
          (JWS)</xref>.
          Implementations SHOULD support signature verification with
          the RSA SHA-256 algorithm because OpenID Connect Core
          requires support for it (<spanx style="verb">alg</spanx>
          value of <spanx style="verb">RS256</spanx>).
          Federations MAY also specify different mandatory-to-implement algorithms.
        </t>
        <t>
          An Entity Statement is composed of the following claims:
        </t>
        <t>
          <list style="hanging">
            <t hangText="iss">
              <vspace/>
              REQUIRED. The Entity Identifier of the issuer of
              the Entity Statement.
	      If the <spanx style="verb">iss</spanx> and
              the <spanx style="verb">sub</spanx> are identical,
	      the issuer is making an Entity Statement about itself
	      called an Entity Configuration.
            </t>
            <t hangText="sub">
              <vspace/>
              REQUIRED. The Entity Identifier of the subject.
            </t>
            <t hangText="iat">
              <vspace/>
              REQUIRED. The time the statement was issued.
              Its value is a JSON number representing the number of seconds from
              1970-01-01T0:0:0Z as measured in UTC until the date/time.
              See <xref target="RFC3339"/> for
              details regarding date/times in general and UTC in particular.
            </t>
            <t hangText="exp">
              <vspace/>
              REQUIRED.
              Expiration time after which the statement MUST NOT be
              accepted for processing. Its value is a JSON number representing
              the number of seconds from 1970-01-01T0:0:0Z as measured in UTC
              until the date/time.
            </t>
            <t hangText="jwks">
              <vspace/>
              REQUIRED. A <xref target="RFC7517">JSON Web Key Set (JWKS)</xref>
              representing the public part of the subject's Federation Entity
              signing keys. The corresponding private key is
              used by the Entity to sign the Entity Configuration about itself,
              and by Trust Anchors and Intermediate Entities to sign Subordinate Statements about their immediate Subordinates.
              The public keys are used to verify the signatures of the
              issued Entity Statements and Trust Marks and SHOULD NOT be used in other protocols.
	      (Keys to be used in other protocols, such as OpenID Connect, are conveyed
              in the <spanx style="verb">metadata</spanx> elements of the respective Entity Statements.)
              This claim is only OPTIONAL for the Entity Statement returned
              from an OP when the client is doing Explicit Registration.
              In all other cases, it is REQUIRED.
              Every JWK in the JWK Set MUST have a unique <spanx style="verb">kid</spanx> (Key ID) value.
              It is RECOMMENDED that the Key ID be the JWK Thumbprint <xref target="RFC7638"/>
              using the SHA-256 hash function of the key.
            </t>
            <t hangText="authority_hints" anchor="authority_hints">
              <vspace/>
              OPTIONAL. An array of strings representing
              the Entity Identifiers of Intermediate Entities or Trust Anchors
              that MAY issue Subordinate Statements about the Entity.
              This claim is REQUIRED in the Entity Configurations of
              the Entities that have at least one Superior above them, 
              such as Leaf and Intermediate Entities.
              Its value MUST NOT be the empty array
              <spanx style="verb">[]</spanx>.
              This claim MUST NOT be present in the Entity Configurations
              of Trust Anchors with no Superiors.
	      It MUST NOT be present in Subordinate Statements.
            </t>
            <t hangText="metadata">
              <vspace/>
              OPTIONAL. JSON object with protocol-specific claims that represent the
              Entity's Types within its federations and metadata for those Entity Types.
	      Each member name of the JSON object is an Entity Type Identifier,
	      and each value MUST be a JSON object representing
	      metadata according to the metadata schema of that Entity Type.
	      When an Entity participates in a federation or federations
	      with one or more Entity Types,
	      its Entity Configuration MUST contain a <spanx style="verb">metadata</spanx> claim
	      with entries for each of the corresponding Entity Type Identifiers,
	      even if the values for those entries are
	      the empty JSON object <spanx style="verb">{}</spanx>.
	      (The value might contain no entries when Superiors supply any needed metadata).
	      <vspace blankLines="1" />

	      In some cases, a Superior may want to be explicit about what metadata
              should be used for a Subordinate. In that case
              <spanx style="verb">metadata</spanx> MAY be used in a Subordinate Statement.
              If <spanx style="verb">metadata</spanx> is used in a Subordinate Statement,
	      it is only valid for the subject of the Subordinate Statement
	      and has no impact on the subject's Subordinates.
              If a <spanx style="verb">metadata</spanx> claim appears along with a
              <spanx style="verb">metadata_policy</spanx> claim in an
              Entity Statement, then for each Entity Type Identifier, claims that appear in
              <spanx style="verb">metadata</spanx> MUST NOT appear in
              <spanx style="verb">metadata_policy</spanx>.
            </t>
            <t hangText="metadata_policy">
              <vspace/>
              OPTIONAL. JSON object that defines a metadata policy.
              The metadata policy applies to the Entity that is the subject of this
              Subordinate Statement as well as to all Entities that are Subordinate to it.
              Applying to Subordinate Entities distinguishes
              <spanx style="verb">metadata_policy</spanx> from
              <spanx style="verb">metadata</spanx>, which only applies to the
              subject itself.
	      Each member name of the JSON object is an Entity Type Identifier,
	      and each value MUST be a JSON object representing
	      the metadata policy according to the metadata schema of that Entity Type.
	      A Subordinate Statement MAY contain multiple
	      sets of metadata policy statements, but only one for each Entity Type.
              Entity Configurations MUST NOT contain a
              <spanx style="verb">metadata_policy</spanx> claim.
            </t>
            <t hangText="constraints">
              <vspace/>
              OPTIONAL. JSON object that describes constraints that apply to the Trust Chain,
	      as described in <xref target="chain_constraints"/>.
              If the claim appears in an Entity Configuration, it MUST be applied
              to all Subordinates of that Entity.
              If the claim appears in a Subordinate Statement,
              then it MUST be applied to the subject of the Subordinate Statement
	      and all the subject's Subordinates.
            </t>
            <t hangText="crit">
              <vspace/>
              OPTIONAL.
              The <spanx style="verb">crit</spanx> (critical) Entity Statement
              claim
              indicates that extensions to Entity Statement claims defined by
              this specification
              are being used that MUST be understood and processed.
              It is used in the same way that
              <spanx style="verb">crit</spanx>
              is used for extension JWS header parameters
              that MUST be understood and processed.
              Its value is an array listing the Entity Statement claims
              present in the Entity Statement that use those extensions.
              If any of the listed extension Entity Statement claims are not
              understood and supported by the recipient, then the Entity Statement is invalid.
              Producers MUST NOT include Entity Statement claim names defined by
              this specification or
              names that do not occur as claim names in the Entity Statement
              in the <spanx style="verb">crit</spanx> list.
              Producers MUST NOT use the empty array
              <spanx style="verb">[]</spanx>
              as the <spanx style="verb">crit</spanx> value.
            </t>
            <t hangText="metadata_policy_crit">
              <vspace/>
              OPTIONAL.
              The <spanx style="verb">metadata_policy_crit</spanx> (critical)
              Entity Statement claim
              indicates that extensions to the policy language defined by this
              specification
              are being used that MUST be understood and processed.
              It is used in the same way that
              <spanx style="verb">crit</spanx>
              is used for extension
              JWS header parameters that MUST be
              understood and processed.
              Its value is an array listing the policy language extensions
              present in the policy language statements that use those
              extensions.
              If any of the listed extension policy language extensions are not
              understood and supported by the recipient, then the Entity Statement is invalid.
              Producers MUST NOT include policy language names defined by this
              specification or
              names that do not occur in metadata policy statements in the
              Entity Statement
              in the <spanx style="verb">metadata_policy_crit</spanx> list.
              Producers MUST NOT use the empty array
              <spanx style="verb">[]</spanx>
              as the <spanx style="verb">metadata_policy_crit</spanx> value.
            </t>
            <t hangText="trust_marks">
              <vspace/>
              OPTIONAL. An array of JSON objects, each representing
              a Trust Mark.
              Each JSON object MUST contain the following two claims
              and MAY contain other claims. All the claims in the
              JSON object MUST have the same values as those
              contained in the Trust Mark JWT.

              <list style="hanging">
                <t hangText="id">
                  The Trust Mark identifier.
                  It MUST be the same value as the
                  <spanx style="verb">id</spanx>
                  claim contained in the
                  Trust Mark JWT.
                </t>
                <t hangText="trust_mark">
                  A signed JSON Web Token that represents a Trust Mark.
                </t>
              </list>
	      This claim MUST NOT be present in Subordinate Statements.
              Trust Marks are described in <xref target="trust_marks"/>.
            </t>
            <t hangText="trust_mark_issuers">
              <vspace/>
              OPTIONAL.
              A Trust Anchor MAY use this claim to tell which combination of
              Trust Mark identifiers and issuers are trusted by the federation.
              This claim MUST be ignored if present in an Entity Configuration
              for an Entity that is not a Trust Anchor.
              It is a JSON object with member names that are Trust Mark identifiers and
              each corresponding value being an array of Entity Identifiers
	      that are trusted to represent the accreditation authority
	      for Trust Marks with that identifier.
              If the array following a Trust Mark identifier is empty,
              anyone MAY issue Trust Marks with that identifier.
	      This claim MUST NOT be present in Subordinate Statements.
              Trust Marks are described in <xref target="trust_marks"/>.
            </t>
            <t hangText="trust_mark_owners">
              <vspace/>
              OPTIONAL.
              If a Federation Operator knows that a Trust Mark identifier is owned
              by an Entity different from the Trust Mark issuer, then that
              knowledge MUST be expressed in this claim.
              This claim MUST be ignored if present in an Entity Configuration
              for an Entity that is not a Trust Anchor.
              It is a JSON object with member names that are Trust Mark identifiers and
              each corresponding value being a JSON object with these members:
              <list style="hanging">
                <t hangText="sub">
                  <vspace/>
                  REQUIRED
                  Identifier of the Trust Mark owner.
                </t>
                <t hangText="jwks">
                  <vspace/>
                  REQUIRED
                  <xref target="RFC7517">JSON Web Key Set (JWKS)</xref>
                  containing the owner's Federation Entity Keys used for signing.
                </t>
              </list>
	      Other members MAY also be defined and used.
	      This claim MUST NOT be present in Subordinate Statements.
	    </t>
            <t hangText="source_endpoint">
              <vspace/>
              OPTIONAL. String containing the fetch endpoint URL
              from which the Entity Statement was issued,
              as specified in <xref target="fetch_endpoint"/>.
              This parameter enables an optimized refresh of the Subordinate Statements
	      and hence the Trust Chain, by skipping the
              request to the Entity Configuration
              that is normally required to discover the
              <spanx style="verb">federation_fetch_endpoint</spanx>
              of the issuing authority.
              If an Entity Statement cannot be retrieved from the
	      <spanx style="verb">source_endpoint</spanx>,
	      which can occur if the endpoint URL has changed,
	      the current <spanx style="verb">federation_fetch_endpoint</spanx>
	      location can be determined by retrieving
	      the Entity Configuration of the issuer.
            </t>
          </list>
        </t>
        <t>
          Applications and protocols utilizing Entity Statements MAY specify
          and use additional claims.
        </t>

        <figure>
          <preamble>
            The following is a non-normative example of the JWT Claims Set for an Entity Statement.
            The example contains
            a critical extension <spanx style="verb">jti</spanx> (JWT ID) to the
            Entity Statement and one critical extension to the policy language
            <spanx style="verb">regexp</spanx>
            (Regular expression).
          </preamble>
          <name>
            Example Entity Statement JWT Claims Set
          </name>

          <artwork><![CDATA[
{
  "iss": "https://feide.no",
  "sub": "https://ntnu.no",
  "iat": 1516239022,
  "exp": 1516298022,
  "crit": ["jti"],
  "jti": "7l2lncFdY6SlhNia",
  "source_endpoint": "https://feide.no/federation_api/fetch",
  "metadata_policy_crit": ["regexp"],
  "metadata": {
    "openid_provider": {
      "issuer": "https://ntnu.no",
      "organization_name": "NTNU",
    },
    "oauth_client": {
      "organization_name": "NTNU"
    }
  },
  "metadata_policy": {
    "openid_provider": {
      "id_token_signing_alg_values_supported":
        {"subset_of": ["RS256", "RS384", "RS512"]},
      "op_policy_uri": {
        "regexp":
          "^https:\/\/[\\w-]+\\.example\\.com\/[\\w-]+\\.html"}
    },
    "oauth_client": {
      "grant_types": {
        "subset_of": ["authorization_code", "client_credentials"]
      },
  },
  "constraints": {
    "max_path_length": 2
  },
  "jwks": {
    "keys": [
      {
        "alg": "RS256",
        "e": "AQAB",
        "key_ops": ["verify"],
        "kid": "key1",
        "kty": "RSA",
        "n": "pnXBOusEANuug6ewezb9J_...",
        "use": "sig"
      }
    ]
  }
}
]]></artwork>
        </figure>

        <figure>
          <preamble>
            The following is a non-normative example of
            a <spanx style="verb">trust_mark_owners</spanx> claim value:
          </preamble>
          <name>
            Example <spanx style="verb">trust_mark_owners</spanx> Claim Value
          </name>
          <artwork><![CDATA[
{
  "https://refeds.org/wp-content/uploads/2016/01/Sirtfi-1.0.pdf":
    {
      "sub": "https://refeds.org/sirtfi",
      "jwks" : {
        "keys": [
          {
            "alg": "RS256",
            "e": "AQAB",
            "kid": "key1",
            "kty": "RSA",
            "n": "pnXBOusEANuug6ewezb9J_...",
            "use": "sig"
          }
        ]
      }
    }
}
]]></artwork>
        </figure>

        <figure>
          <preamble>
            The following is a non-normative example of
            a <spanx style="verb">trust_mark_issuers</spanx> claim value:
          </preamble>
          <name>
            Example <spanx style="verb">trust_mark_issuers</spanx> Claim Value
          </name>
          <artwork><![CDATA[
{
  "https://openid.net/certification/op": [],
  "https://refeds.org/wp-content/uploads/2016/01/Sirtfi-1.0.pdf":
    ["https://swamid.se"]
}
]]></artwork>
        </figure>
      </section>

      <section title="Trust Chain" anchor="trust_chain">
        <t>
          Entities whose statements build a Trust Chain are categorized as:
          <list style="hanging">
            <t hangText="Trust Anchor">
              <vspace/>
              An Entity that represents a trusted third party.
            </t>
            <t hangText="Leaf">
              <vspace/>
              In an OpenID Connect identity federation, an RP or an OP,
	      or in an OAuth 2.0 federation, a Client, Authorization Server, or Protected Resource.
            </t>
            <t hangText="Intermediate">
              <vspace/>
              Neither a Leaf Entity nor a Trust Anchor.
            </t>
          </list>
        </t>
        <t>
          A Trust Chain begins with a Leaf Entity Configuration,
          and has zero or more Subordinate Statements
          issued by Intermediates about Subordinates,
          and includes the Subordinate Statement issued by the
          Trust Anchor about the top-most Intermediate
          (if there are Intermediates) or the Leaf Entity
          (if there are no Intermediates).
          The Trust Chain logically always ends with the
          Entity Configuration of the Trust Anchor,
	  even though it MAY be omitted from
	  the JSON array representating the Trust Chain in some cases.
        </t>
        <t>
	  The Trust Chain contains the configuration of the federation
	  as it applies to the Leaf
          at the time of the evaluation of the chain.
        </t>
        <t>
          A simple example: If we have an RP that belongs to Organization A
          that is a member of Federation F, the Trust Chain for such a setup
          will contain the following Entity Statements:
          <list style="numbers">
            <t>
              an Entity Configuration about the RP published by itself,
            </t>
            <t>
              a Subordinate Statement about the RP published by Organization A,
            </t>
            <t>
              a Subordinate Statement about Organization A published by the Trust Anchor for F,
            </t>
	    <t>
	      an Entity Configuration about the Trust Anchor for F published by itself.
	    </t>
          </list>
        </t>
        <t>
	  Let us refer to the Entity Statements in the Trust Chain as
	  ES[j], where j = 0,...,i,
	  with 0 being the index of the first Entity Statement
	  and i being the zero-based index of the last.
	  Then:
          <list style="symbols">
	    <t>
	      ES[0] (the Leaf's Entity Configuration in the Trust Chain)
	      is signed using a key in ES[0]["jwks"].
	    </t>
            <t>
	      The <spanx style="verb">iss</spanx> claim in an Entity Statement
	      is equal to the <spanx style="verb">sub</spanx> claim in the next.
	      Restating this symbolically,
	      for each j = 0,...,i-1,
	      ES[j]["iss"] == ES[j+1]["sub"].
            </t>
            <t>
	      An Entity Statement is signed using a key from
	      the <spanx style="verb">jwks</spanx> claim in the next.
	      Restating this symbolically,
	      for each j = 0,...,i-1,
	      ES[j] is signed by a key in ES[j+1]["jwks"].
            </t>
	    <t>
	      ES[i] (the Trust Anchor's Entity Configuration in the Trust Chain)
	      is signed using a key in ES[i]["jwks"].
	    </t>
          </list>
        </t>
        <t>
	  The Trust Anchor's public keys are used to verify the signatures on
	  ES[i] (the Trust Anchor's Entity Configuration) and
	  ES[i-1] (the Trust Anchor's Subordinate Statement about the Entity
	  immediately Subordinate to it in the Trust Chain).
	  The Trust Anchor's public keys are distributed
	  to Entities that need to verify a
          Trust Chain in some secure out-of-band way not described in this
          document.
        </t>
	<figure>
          <preamble>
            The following is an example of a Trust Chain consisting of
            a Leaf's Entity Configuration and Subordinate Statements issued
            by an Intermediate Entity and a Trust Anchor. It shows
            the relationship between the three Entities,
	    their Entity Configurations and their Subordinate Statements.
	    The Subordinate Statements are obtained from the
            <spanx style="verb">federation_fetch_endpoint</spanx> of
            the subject's Superior. The URL of the
            <spanx style="verb">federation_fetch_endpoint</spanx> is
            discovered in the Superior's Entity Configuration.
            Note that the first member of the Trust Chain (the Leaf)
            is depicted at the bottom of the diagram and that the last
            member (the Trust Anchor) is depicted at the top.
          </preamble>
          <name>
            Relationships between Federation Entities and Statements Issued in a Trust Chain
          </name>
          <artwork><![CDATA[
.----------------.  .---------------------------.         .---------------------------.
| ROLE           |  | .well-known/              |         | TRUST CHAIN               |
|                |  | openid-federation         |         |                           |
+----------------+  +---------------------------+         +---------------------------+
|                |  |                           |         |                           |
| .------------. |  | .-----------------------. | Fetch   | .-----------------------. |
| |            | |  | | ENTITY CONFIGURATION  | | Endpoint| | ENTITY STATEMENT      | |
| |Trust Anchor| |  | |                       +------------->                       | |
| |            +------> Federation Entity Keys| |         | | Federation Entity Keys| |
| '------------' |  | | Metadata              | |         | | Metadata Policy       | |
|                |  | | Trust Mark issuers    | |         | | Metadata              | |
|                |  | | Constraints           | |         | | Constraints           | |
|                |  | |                       | |         | '-----------+-----------' |
|                |  | '-----------------------' |         |             |sub and      |
|                |  |                           |         |             |cryptographic|
|                |  |                           |         |             |binding      |
| .------------. |  | .-----------------------. | Fetch   | .-----------v-----------. |
| |            | |  | | ENTITY CONFIGURATION  | | Endpoint| | ENTITY STATEMENT      | |
| |Intermediate+------>                       +------------->                       | |
| |            | |  | | Federation Entity Keys| |         | | Federation Entity Keys| |
| '------------' |  | | Metadata              | |         | | Metadata Policy       | |
|                |  | | Trust Marks           | |         | | Metadata              | |
|                |  | |                       | |         | |                       | |
|                |  | |                       | |         | '-----------+-----------' |
|                |  | '-----------------------' |         |             |sub and      |
|                |  |                           |         |             |cryptographic|
|                |  |                           |         |             |binding      |
| .------------. |  | .-----------------------. |         | .-----------v-----------. |
| |            | |  | | ENTITY CONFIGURATION  | |         | | ENTITY CONFIGURATION  | |
| |Leaf        +------>                       |------------->                       | |
| |            | |  | | Federation Entity Keys| |         | | Federation Entity Keys| |
| '------------' |  | | Metadata              | |         | | Metadata              | |
|                |  | | Trust Marks           | |         | | Trust Marks           | |
|                |  | |                       | |         | |                       | |
|                |  | |                       | |         | |                       | |
|                |  | '-----------------------' |         | '-----------------------' |
'----------------'  '---------------------------'         '---------------------------'
]]>
	  </artwork>
	</figure>

        <section title="Trust Chain Header Parameter" anchor="trust_chain_head_param">
         <t>
          The <spanx style="verb">trust_chain</spanx> JWS header parameter is a
          JSON array containing the sequence of the statements
          that proves the trust relationship between the issuer of the
          <xref target="RFC7515">JWS</xref>
          and the selected Trust Anchor, sorted as shown in <xref target="trust_chain"/>.
          The Trust Chain contains the public key used to verify the
          <xref target="RFC7515">JWS</xref>.
          The issuer of the JWS SHOULD select the Trust Anchor that it has in common
          with the audience of the JWS.
	  Otherwise, the issuer is free to select a Trust Anchor.
          All signed JWTs MAY include the
          <spanx style="verb">trust_chain</spanx> JWS header parameter,
          with the exception of Entity Configurations and Subordinate Statements.
          These MUST NOT contain the
          <spanx style="verb">trust_chain</spanx> header parameter,
          as they are integral components of a Trust Chain themselves.
          Use of this header parameter is OPTIONAL.
          </t>

	  <figure>
	    <preamble>
	      The following is a non-normative example of a JWS header with
	      the <spanx style="verb">trust_chain</spanx> parameter.
	    </preamble>
	    <name>
	      Example JWS Header with a <spanx style="verb">trust_chain</spanx> Parameter
	    </name>
	    <artwork><![CDATA[
{
  "alg": "RS256",
  "kid": "SUdtUndEWVY2cUFDeDV5NVlBWDhvOXJodVl2am1mNGNtR0pmd",
  "trust_chain": [
      "eyJhbGciOiJSUzI1NiIsImtpZCI6ImMzWnlUR1ZTY0RNeFowd3dka1pQVVZZMFMyRkVRMnBYVjE4dFVFd3ROVlZIV21WVVEwTmlTM2xVU1EiLCJ0eXAiOiJlbnRpdHktc3RhdGVtZW50K2p3dCJ9.eyJleHAiOjE2OTY1ODMzMzQsImlhdCI6MTY5NjI4MzMzNCwiaXNzIjoiaHR0cHM6Ly9jcmVkZW50aWFsX2lzc3Vlci5leGFtcGxlLm9yZyIsInN1YiI6Imh0dHBzOi8vY3JlZGVudGlhbF9pc3N1ZXIuZXhhbXBsZS5vcmciLCJqd2tzIjp7ImtleXMiOlt7Imt0eSI6IlJTQSIsImtpZCI6ImMzWnlUR1ZTY0RNeFowd3dka1pQVVZZMFMyRkVRMnBYVjE4dFVFd3ROVlZIV21WVVEwTmlTM2xVU1EiLCJlIjoiQVFBQiIsIm4iOiIwNmZfWUd0ejhyY29WQWZSUnlNbldYbmNteVRFc3lmUHh6OVlXdlRjT0c1WGtIQ244c1ZCa3hjVENleDFvdWtxZVlVLU0xcUE3ZXE4RmNMRDJHUEVxVHNITDBRNVNMLXVYSUlYd2hSSmx3bWpRNWh1dEdnV3ptMUVOc0g0SENyV3EwNmJGLTRpUFFpUVUxRm1kVXdxVTI5clVqTnlmeUlLTmd1cFJPZ2p1Y3ozcWYtWE1ZdU5SRnFFcld0b3N0dHE1bm4zdFlSNWh5UWpVWnVwNHZPUnFhUUROMUxiVEk5d2cxRzlxRjlxQUxDcGk0WlNmclJyWEphZDUtamwtS1VOdFM1cG5hbGlHRFF2a3AxTnJCaXBJT19haTFvR21BMTlHd1E4VGpNVkNFc3ZXUXpKcTVrd0N1eHVKZTlBODE1RzRuU2I1WFp1RXZ6anhNU1M4b3hpLVEifV19LCJtZXRhZGF0YSI6eyJvcGVuaWRfY3JlZGVudGlhbF9pc3N1ZXIiOnsiandrcyI6eyJrZXlzIjpbeyJrdHkiOiJSU0EiLCJraWQiOiJSMlJ6UlhBMFJWQnlkekZPVkcxZmRXUlRNVFozWVRSbU5uRTFWM0ZmTUUxb01VWkxla2xpWTFOWU9BIiwiZSI6IkFRQUIiLCJuIjoiNUhfWGg3eGdEV1R4UVZiSnFtT0d1cm9rRThrcjJlMUtnTVdjWU9BNzRPXzFQWGQydWdqeUlxOXQxbVZQU3V3eC10eVNrMlBLcGpwLS1XckhuM0E0VUtKa3VSMTF6aG1kTEJzVThUT0JCdTVNWjhhdER1amZSd0lMWGRLc0VYa2x2YUI2UExUNHpkWm9kZ0NzMDVLeTJlNXNiNXo2X0NpRHFnVVZuV1BtSkxNa2dwQnRaLWtNZF9sYjlTb29abGxmVUdsVGtzYXVKMl9nVlEtVnBGVU1YWWpvSmpOeDk3ZXVrYVluUkVvQ0MzVGFfLThiY1Jvc2x4MnhySWJ1X1VHVnFpcGVOM05QLW1lZmY5VlRaV1lNM2dtb2x3dXBuTUNYWGlpa2NSNVVTTFZnMGVfZ3o2T2ZvUlZHS0FXSXBSUkxUejJhaXF1a1ZIWmRaWDl0Tm16MG13In1dfX0sImZlZGVyYXRpb25fZW50aXR5Ijp7Im9yZ2FuaXphdGlvbl9uYW1lIjoiT3BlbklEIENyZWRlbnRpYWwgSXNzdWVyIGV4YW1wbGUiLCJob21lcGFnZV91cmkiOiJodHRwczovL2NyZWRlbnRpYWxfaXNzdWVyLmV4YW1wbGUub3JnL2hvbWUiLCJwb2xpY3lfdXJpIjoiaHR0cHM6Ly9jcmVkZW50aWFsX2lzc3Vlci5leGFtcGxlLm9yZy9wb2xpY3kiLCJsb2dvX3VyaSI6Imh0dHBzOi8vY3JlZGVudGlhbF9pc3N1ZXIuZXhhbXBsZS5vcmcvc3RhdGljL2xvZ28uc3ZnIiwiY29udGFjdHMiOlsidGVjaEBjcmVkZW50aWFsX2lzc3Vlci5leGFtcGxlLm9yZyJdfX0sImF1dGhvcml0eV9oaW50cyI6WyJodHRwczovL2ludGVybWVkaWF0ZS5laWRhcy5leGFtcGxlLm9yZyJdfQ.WM0dOdLOhC9UTRi_y6lwwu6PmUWv1wc5f8MhKP2qz6b1haa-eyf4Y60iZ2SDeFeg105wHwPSKN8AfRoNyqubOGZMAFmP-sYBeqZatNsGNWjFEHzI9dJwx1oBab5_TDoULarpKSdvuub4NBOBTKFUSDffBG6jzlaK5JiQzMR30-jqSt9qPPWrJepyLQvyFxmvn94OiNQQwJ0oYB1MecJ7r8gmQMCAH4LixD6amKQoCuN0UeN7iEHTs3z_8ZUDihQ7BHf0dtwDCmG_G7xvaNkLPkG6cP2e2-l5kcYbNaUaK0IsX2yB0BkoQOOHlT-_M2TC2Zzg6Nmmw8WpTeraMrSkIQ",
      "eyJhbGciOiJSUzI1NiIsImtpZCI6IlpsSndObTQ1VDJsVWNYbEhUR2cxWldobGJsZGpVV2xsY21RdFNVbFFXWHBIUzFKRVEwOHlUV1Z2TkEiLCJ0eXAiOiJlbnRpdHktc3RhdGVtZW50K2p3dCJ9.eyJleHAiOjE2OTY1ODMzMzQsImlhdCI6MTY5NjI4MzMzNCwiaXNzIjoiaHR0cHM6Ly9pbnRlcm1lZGlhdGUuZWlkYXMuZXhhbXBsZS5vcmciLCJzdWIiOiJodHRwczovL2NyZWRlbnRpYWxfaXNzdWVyLmV4YW1wbGUub3JnIiwiandrcyI6eyJrZXlzIjpbeyJrdHkiOiJSU0EiLCJraWQiOiJjM1p5VEdWU2NETXhaMHd3ZGtaUFVWWTBTMkZFUTJwWFYxOHRVRXd0TlZWSFdtVlVRME5pUzNsVVNRIiwiZSI6IkFRQUIiLCJuIjoiMDZmX1lHdHo4cmNvVkFmUlJ5TW5XWG5jbXlURXN5ZlB4ejlZV3ZUY09HNVhrSENuOHNWQmt4Y1RDZXgxb3VrcWVZVS1NMXFBN2VxOEZjTEQyR1BFcVRzSEwwUTVTTC11WElJWHdoUkpsd21qUTVodXRHZ1d6bTFFTnNINEhDcldxMDZiRi00aVBRaVFVMUZtZFV3cVUyOXJVak55ZnlJS05ndXBST2dqdWN6M3FmLVhNWXVOUkZxRXJXdG9zdHRxNW5uM3RZUjVoeVFqVVp1cDR2T1JxYVFETjFMYlRJOXdnMUc5cUY5cUFMQ3BpNFpTZnJSclhKYWQ1LWpsLUtVTnRTNXBuYWxpR0RRdmtwMU5yQmlwSU9fYWkxb0dtQTE5R3dROFRqTVZDRXN2V1F6SnE1a3dDdXh1SmU5QTgxNUc0blNiNVhadUV2emp4TVNTOG94aS1RIn1dfX0.GxUAOCfVHTyBvJzq9BIV76fX-bRqIVcL-Y36B8NLO17lE0rkfDQQGUh-Vh1JmF_MF3Q4QhXjW-agXoKST3q9x5nDoYHTleQ-10Lw9qiU9I6K8mn1JMNXahzNaX_MLOA7R3_O0-HhxtARIEKpiGQTjup_f5PyqBLrwcERxhnbg0YrpgsvVQHC1SUgXiMtKxMZDWLUtk7q8YaNNhJ4nuEV2M1ZWcEVFloWYKWBJbJvmZ9jqsop6svMDOqusih3sNGWKZ9XmPqtUeGR8o1vsKsOk0WKVnEMH9ESGu54pUJahX05jd4UmTPOzfRJ61k9-_te6xNZUwJqtU9wJ--IrHz7ig",
      "eyJhbGciOiJSUzI1NiIsImtpZCI6IlpXRlRRbWhmVFdaSVRuRlRZM0ZTV2pKdU5HMWZWV05hZWxkNmNtUjFRa0pEYlhaWlRYQm1hM1JWUVEiLCJ0eXAiOiJlbnRpdHktc3RhdGVtZW50K2p3dCJ9.eyJleHAiOjE2OTY1ODMzMzQsImlhdCI6MTY5NjI4MzMzNCwiaXNzIjoiaHR0cHM6Ly90cnVzdC1hbmNob3IuZXhhbXBsZS5vcmciLCJzdWIiOiJodHRwczovL2ludGVybWVkaWF0ZS5laWRhcy5leGFtcGxlLm9yZyIsImp3a3MiOnsia2V5cyI6W3sia3R5IjoiUlNBIiwia2lkIjoiWmxKd05tNDVUMmxVY1hsSFRHZzFaV2hsYmxkalVXbGxjbVF0U1VsUVdYcEhTMUpFUTA4eVRXVnZOQSIsImUiOiJBUUFCIiwibiI6ImtSQUlzLVRBblF6T29lc195RW9oaDNUeGlaWFlPRC1xekI2T25JalZCaVI0WFNGbkw4djhRQ0IxamJiSlZTQ1hBZmdObTlBZjdVRDNBX0E2T1pQOUtacldSUk00NEp0TVAzZmxVSU5CQ2xzNFBrdVd2RklmWEtaaWVUNGhBMzNYdUlTSndqT2NlNnRrbUZTUl9wQmI3S0JHbnB4d3dnRlJjeUM2RU1VQWtWUGdQRl9mbXM3NEEyTF83TGVaNzh2X053VUhsY2VxVHB1OUx6VTRuTTd1RTZQY0JPSmJweXI2SFFuUTR1VHN6WThsWHVmT3pHZ2IzVXNDNmRnQWVVVERIZlFROE4xYXV2bkJUNmR0SHNHNWMxS2NCT2QzLVp6ZTZ5WVE5c2JLUlUtWVoydDZKdUJIbS1xLTVOamxiRWVwNDAwbFgxSXlKdG9Tc3F0d3lCX1djdyJ9XX19.CvBvN0aG-r13UG4uITH72tC5CbAG0rT4qYQ5wwHOtGE021etZFQd40RFnQT5e-Gy_Y8Wiin-Zmc1hWW2rVyZ1RRInjYGUt26QI6ujR-5w9Y_LHVp-6RzYEF0lg9otpAyszQE4hf5qBZYAj8t39FvCYWTYVci6mtpovJQ380ha8I4QL__fZtEgDLQ-7VKS58nN1DOVdcIICMMfxpDR81bkY5i5Qxcy7AaZTN6xxE2SlCO-pKKub0jBUtnug20-BL2YgcPhLFOYWfj2cuyapOA9Omwu6CPhmZHgsL1P2oK_f4jA9JxNDYcV0losDbD86r8Wg3anM2lVM5BTHkiUr2grg",
      "eyJhbGciOiJSUzI1NiIsImtpZCI6IlpXRlRRbWhmVFdaSVRuRlRZM0ZTV2pKdU5HMWZWV05hZWxkNmNtUjFRa0pEYlhaWlRYQm1hM1JWUVEiLCJ0eXAiOiJlbnRpdHktc3RhdGVtZW50K2p3dCJ9.eyJleHAiOjE2OTY1ODMzMzQsImlhdCI6MTY5NjI4MzMzNCwiaXNzIjoiaHR0cHM6Ly90cnVzdC1hbmNob3IuZXhhbXBsZS5vcmciLCJzdWIiOiJodHRwczovL3RydXN0LWFuY2hvci5leGFtcGxlLm9yZyIsImp3a3MiOnsia2V5cyI6W3sia3R5IjoiUlNBIiwia2lkIjoiWldGVFFtaGZUV1pJVG5GVFkzRlNXakp1TkcxZlZXTmFlbGQ2Y21SMVFrSkRiWFpaVFhCbWEzUlZRUSIsImUiOiJBUUFCIiwibiI6InhPQnN0YnJUUE9SQ3JnTXowQ254Skk4cjd4TkwwYjZITExKY05NSkNQbGl0SmUzNUZUdGw1bVdMVXFoeFdiRXFYYnpVLW80VHd1ZHA5NHFrckI3Zks5cEk0bDBldEoxMFZTbTQ0dXNiakxoMTUwVXFlSnlmQmdyMzRWbWhINWo3ZFMzS3V5bjNvOEdER2ZjNDVjcmdsR3lNOUgzbFp6SGl6SXdncDVzSUhCeGFPRWQ1eXlOdXhBLXFFQU4zaFIxQi1LQ2JYaWVDRVRrcWNMWU1zX2psRHVsTVE0MzI5TEgwNkhaclhINElfUHVnWXd0WldUN0VqZUR6c3Y2Ny14TFFhOEg3cnV1N3JVME1FREl0TkVpS3ljdVk5b0pLWWtrX2hBQzFMNkt2VkNmeXpVOGVvem9KQzM4eGhXUklNTXJZd2hiSmFaa3dUdDZCRDByalNNRUp6USJ9XX0sIm1ldGFkYXRhIjp7ImZlZGVyYXRpb25fZW50aXR5Ijp7ImZlZGVyYXRpb25fZmV0Y2hfZW5kcG9pbnQiOiJodHRwczovL3RydXN0LWFuY2hvci5leGFtcGxlLm9yZy9mZXRjaCIsImZlZGVyYXRpb25fcmVzb2x2ZV9lbmRwb2ludCI6Imh0dHBzOi8vdHJ1c3QtYW5jaG9yLmV4YW1wbGUub3JnL3Jlc29sdmUiLCJmZWRlcmF0aW9uX2xpc3RfZW5kcG9pbnQiOiJodHRwczovL3RydXN0LWFuY2hvci5leGFtcGxlLm9yZy9saXN0Iiwib3JnYW5pemF0aW9uX25hbWUiOiJUQSBleGFtcGxlIiwiaG9tZXBhZ2VfdXJpIjoiaHR0cHM6Ly90cnVzdC1hbmNob3IuZXhhbXBsZS5vcmcvaG9tZSIsInBvbGljeV91cmkiOiJodHRwczovL3RydXN0LWFuY2hvci5leGFtcGxlLm9yZy9wb2xpY3kiLCJsb2dvX3VyaSI6Imh0dHBzOi8vdHJ1c3QtYW5jaG9yLmV4YW1wbGUub3JnL3N0YXRpYy9sb2dvLnN2ZyIsImNvbnRhY3RzIjpbInRlY2hAdHJ1c3QtYW5jaG9yLmV4YW1wbGUub3JnIl19fSwiY29uc3RyYWludHMiOnsibWF4X3BhdGhfbGVuZ3RoIjoxfX0.ZenICRAm4zrd65A3tsSN77VLjheJAK09s8sBXQVo2l3r7RrN8pXFKqulZebxfSALF4am58Ry8GeK2N1ZK7B1GlfskAnnIINfi-IpjqquvPW_MXrSo0bLoXnnmruHJ1D0KbONbwdZaOZg4oJRo2PBU009pojheUwcRcNDujCRiQimsvEYlL4YLwpPHjEmt46WviPESnZCgez_oEdoXkNjN3PsOta9de_abjkASYdGgAlBTIbUjAutmErbubjKptxpvycibBLuJ58nkiQZ_KesLRPnDY9hbPf0ZMbtCB_gx8yLlQ9-8nE5_fuxICz1uKR4536txsQFmrCvireBchaZ1A"
  ]
}
]]>
	    </artwork>
	  </figure>
        </section>

      </section>

    <section anchor="metadata" title="Metadata">
      <t>
	This section defines how to represent and use metadata about Entities.
	It reuses existing OpenID Connect and OAuth 2.0 metadata standards
	that are applicable to each Entity Type.
      </t>
      <t>
	As described in <xref target="entity-statement"/>,
	Entity metadata is located in the <spanx style="verb">metadata</spanx>
	claim of an Entity Statement, whose value is a JSON object.
	The member names of this object are Entity Type Identifiers,
	as specified in <xref target="entity_types"/>.
	The metadata data structure following each Entity Type Identifier is a JSON object;
	it MAY be the empty JSON object <spanx style="verb">{}</spanx>,
	which may be the case when Superiors supply any needed metadata values.
      </t>
      <t>
	Top-level JSON object members in the metadata data structures MAY use
	any JSON value other than <spanx style="verb">null</spanx>;
	the use of <spanx style="verb">null</spanx> is prohibited to prevent likely
	implementation errors caused by confusing members having
	<spanx style="verb">null</spanx> values with omitted members.
      </t>

      <section anchor="entity_types" title="Entity Type Identifiers">
	<t>
	  This specification defines Entity Type Identifiers
	  for OpenID Connect and OAuth 2.0 objects.
	  The Entity Type Identifier uniquely identifies the Entity Type
	  of the participant and the format of metadata for that Entity Type.
	</t>
	<t>
	  Additional Entity Type Identifiers MAY be defined to
	  support use cases outside OpenID Connect and OAuth 2.0 federations.
	</t>

      <section title="OpenID Connect Relying Party" anchor="RP_metadata">
        <t>
          The Entity Type Identifier is
          <spanx style="verb">openid_relying_party</spanx>.
        </t>
        <t>
          All parameters defined in Section 2 of
          <xref target="OpenID.Registration">OpenID Connect Dynamic Client Registration 1.0</xref>
          and <xref target="common_metadata"/> are applicable,
	  as well as additional parameters registered in the
	  IANA "OAuth Dynamic Client Registration Metadata" registry
	  <xref target="IANA.OAuth.Parameters"/>.
        </t>
        <t>
          In addition, the following RP metadata parameter is defined:
          <list style="hanging">
            <t hangText="client_registration_types">
              <vspace/>
              REQUIRED. An array of strings specifying the client registration
              types the RP wants to use. Values defined by this specification
              are
              <spanx style="verb">automatic</spanx>
              and <spanx style="verb">explicit</spanx>.
            </t>
          </list>
        </t>
	<figure>
	  <preamble>
	    The following is a non-normative example of the JWT Claims Set for an RP's Entity Configuration:
	  </preamble>
	  <name>
	    Example Relying Party Entity Configuration JWT Claims Set
	  </name>
	  <artwork><![CDATA[
    {
      "iss": "https://openid.sunet.se",
      "sub": "https://openid.sunet.se",
      "iat": 1516239022,
      "exp": 1516298022,
      "metadata": {
        "openid_relying_party": {
          "application_type": "web",
          "redirect_uris": [
            "https://openid.sunet.se/rp/callback"
          ],
          "organization_name": "SUNET",
          "logo_uri": "https://www.sunet.se/sunet/images/32x32.png",
          "grant_types": [
            "authorization_code",
            "implicit"
          ],
          "signed_jwks_uri":"https://openid.sunet.se/rp/signed_jwks.jose",
          "jwks_uri": "https://openid.sunet.se/rp/jwks.json"
        }
      },
      "jwks": {
        "keys": [
          {
            "alg": "RS256",
            "e": "AQAB",
            "key_ops": [
              "verify"
            ],
            "kid": "key1",
            "kty": "RSA",
            "n": "pnXBOusEANuug6ewezb9J_...",
            "use": "sig"
          }
        ]
      },
      "authority_hints": [
        "https://edugain.org/federation"
      ]
    }
]]>
	  </artwork>
	</figure>
      </section>

      <section title="OpenID Provider" anchor="OP_metadata">
        <t>
          The Entity Type Identifier is
          <spanx style="verb">openid_provider</spanx>.
        </t>
        <t>
          All parameters defined in Section 3 of
          <xref target="OpenID.Discovery">OpenID Connect Discovery 1.0</xref>
          and <xref target="common_metadata"/> are applicable,
	  as well as additional parameters registered in the
	  IANA "OAuth Authorization Server Metadata" registry
	  <xref target="IANA.OAuth.Parameters"/>.
        </t>
        <t>
          In addition, the following OP metadata parameters are defined:
        </t>
        <t>
          <list style="hanging">
            <t hangText="client_registration_types_supported">
              <vspace/>
              REQUIRED. Array specifying the federation types supported.
              Federation-type values defined by this specification are
              <spanx style="verb">automatic</spanx>
              and <spanx style="verb">explicit</spanx>.
            </t>
            <t hangText="federation_registration_endpoint">
              <vspace/>
              OPTIONAL.
              URL of the OP's federation-specific Dynamic Client Registration
              Endpoint. If the OP supports Explicit Client Registration Endpoint
              this URL MUST use the <spanx style="verb">https</spanx>
              scheme and MAY contain port,
              path, and query parameter components encoded in
              <spanx style="verb">application/x-www-form-urlencoded</spanx>
              format;
              it MUST NOT contain a fragment component.
              If the OP supports Explicit Client
              Registration as described in <xref target="explicit"/>,
              then this claim is REQUIRED.
            </t>
            <t hangText="request_authentication_methods_supported">
              <vspace/>
              OPTIONAL.
	      An OP MUST be able to verify that a request comes from an RP
	      that is a member of a federation that the OP is a member of.
	      This is done via request authentication methods.
	      These methods achieve this by proving that
	      the RP is in possession of a key that appears in its metadata.
	      This parameter declares the request authentication methods that the OP supports.
	      <vspace blankLine="1"/>

	      The <spanx style="verb">request_authentication_methods_supported</spanx>
	      value is a JSON object where the member names are names of endpoints
	      where the request authentication occurs.
	      This MAY be either at
	      the OP's Authorization Endpoint or
	      the OP's Pushed Authorization Request (PAR) endpoint.
	      Supported endpoint identifiers are
	      <spanx style="verb">authorization_endpoint</spanx> and
	      <spanx style="verb">pushed_authorization_request_endpoint</spanx>.
	      The values of the JSON object members for the endpoint names are
	      JSON arrays containing the names of the request authentication methods
	      used at those endpoints.
	      <vspace blankLine="1"/>

	      Some OAuth 2.0 client authentication methods can be used at the
	      <spanx style="verb">pushed_authorization_request_endpoint</spanx>
	      to achieve request authentication.
	      They are the subset of those listed in the
	      IANA "OAuth Token Endpoint Authentication Methods" registry <xref target="IANA.OAuth.Parameters"/>
	      that perform client authentication by proving possession of a private key.
              These client authentication methods are:
              <list style="hanging">
                <t hangText="private_key_jwt">
                  <vspace/>
                  This client authentication method is described in Section 9 of
                  <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>.
                  Note that if <spanx style="verb">private_key_jwt</spanx> is
                  used, the audience of the signed JWT MUST be either the URL of
                  the Authorization Server's Authorization Endpoint or the
                  Authorization Server's Entity Identifier.
                </t>
                <t hangText="tls_client_auth">
                  <vspace/>
                  Section 2.1 of
                  <xref target="RFC8705"/>.
                </t>
                <t hangText="self_signed_tls_client_auth">
                  <vspace/>
                  Section 2.2 of
                  <xref target="RFC8705"/>.
                </t>
              </list>
              <vspace blankLine="1"/>

              A request authentication method that is not a client authentication method is:
              <list style="hanging">
                <t hangText="request_object">
                  <vspace/>
                  Use of a Request Object, as described in
                  <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>.
		  The request authentication is performed by verifying that
		  the request object is signed with a key that the RP controls.
		  Use of Request Objects by Automatic Registration is described at
                  <xref target="automatic"/>.
                </t>
              </list>
	      The <spanx style="verb">request_object</spanx> method MAY be used at either endpoint.
              <vspace blankLine="1"/>

	      Other request authentication methods MAY be defined and used.
	    </t>

            <t hangText="request_authentication_signing_alg_values_supported">
              <vspace/>
              OPTIONAL.
              JSON array containing a list of the supported
              <xref target="RFC7515">JWS</xref> algorithms
              (<spanx style="verb">alg</spanx> values)
              for signing the <xref target="RFC7519">JWT</xref>
              used in the Request Object
              contained in the request parameter of an authorization request or
              in the <spanx style="verb">private_key_jwt</spanx> of a pushed authorization request.
              This entry MUST be present if either of these authentication methods are specified
              in the <spanx style="verb">request_authentication_methods_supported</spanx> entry.
              No default algorithms are implied if this entry is omitted.
              Servers SHOULD support <spanx style="verb">RS256</spanx>.
              The value <spanx style="verb">none</spanx> MUST NOT be used.
            </t>
          </list>
        </t>

        <figure>
	  <preamble>
	    The following is a non-normative example of the JWT Claims Set for an OP's Entity Configuration:
	  </preamble>
          <name>
            Example OpenID Provider Entity Configuration JWT Claims Set
          </name>
          <artwork><![CDATA[
{
   "iss":"https://op.umu.se",
   "sub":"https://op.umu.se",
   "exp":1568397247,
   "iat":1568310847,
   "metadata":{
      "openid_provider":{
         "issuer":"https://op.umu.se/openid",
         "signed_jwks_uri":"https://op.umu.se/openid/signed_jwks.jose",
         "authorization_endpoint":"https://op.umu.se/openid/authorization",
         "client_registration_types_supported":[
            "automatic",
            "explicit"
         ],
         "grant_types_supported":[
            "authorization_code",
            "implicit",
            "urn:ietf:params:oauth:grant-type:jwt-bearer"
         ],
         "id_token_signing_alg_values_supported":[
            "ES256",
            "RS256"
         ],
         "logo_uri":"https://www.umu.se/img/umu-logo-left-neg-SE.svg",
         "op_policy_uri":"https://www.umu.se/en/legal-information/",
         "response_types_supported":[
            "code",
            "code id_token",
            "token"
         ],
         "subject_types_supported":[
            "pairwise",
            "public"
         ],
         "token_endpoint":"https://op.umu.se/openid/token",
         "federation_registration_endpoint":"https://op.umu.se/openid/fedreg",
         "token_endpoint_auth_methods_supported":[
            "client_secret_post",
            "client_secret_basic",
            "client_secret_jwt",
            "private_key_jwt"
         ],
         "pushed_authorization_request_endpoint":"https://op.umu.se/openid/par",
         "request_authentication_methods_supported": {
            "authorization_endpoint": [
                "request_object"
            ],
            "pushed_authorization_request_endpoint": [
                "request_object",
                "private_key_jwt",
                "tls_client_auth",
                "self_signed_tls_client_auth"
            ]
        }
      }
   },
   "authority_hints":[
      "https://umu.se"
   ],
   "jwks":{
      "keys":[
         {
            "e":"AQAB",
            "kid":"dEEtRjlzY3djcENuT01wOGxrZlkxb3RIQVJlMTY0...",
            "kty":"RSA",
            "n":"x97YKqc9Cs-DNtFrQ7_vhXoH9bwkDWW6En2jJ044yH..."
         }
      ]
   }
}
]]></artwork>
        </figure>

      </section>
      <section title="OAuth Authorization Server">
        <t>
          The Entity Type Identifier is
          <spanx style="verb">oauth_authorization_server</spanx>.
        </t>
        <t>
          All parameters defined in Section 2 of
          <xref target="RFC8414"/>
          and <xref target="common_metadata"/> are applicable,
	  as well as additional parameters registered in the
	  IANA "OAuth Authorization Server Metadata" registry
	  <xref target="IANA.OAuth.Parameters"/>.
        </t>
      </section>

      <section title="OAuth Client">
        <t>
          The Entity Type Identifier is
          <spanx style="verb">oauth_client</spanx>.
        </t>
        <t>
          All parameters defined in Section 2 of
          <xref target="RFC7591">OAuth 2.0 Dynamic Client Registration Protocol</xref>
          and <xref target="common_metadata"/> are applicable,
	  as well as additional parameters registered in the
	  IANA "OAuth Dynamic Client Registration Metadata" registry
	  <xref target="IANA.OAuth.Parameters"/>.
        </t>
      </section>

      <section title="OAuth Protected Resource">
        <t>
          The Entity Type Identifier is
          <spanx style="verb">oauth_resource</spanx>.
	  The parameters defined in <xref target="common_metadata"/> are applicable.
	  In addition, while it is not yet a standard,
	  deployments MAY use the protected resource metadata parameters
	  defined in <xref target="I-D.ietf-oauth-resource-metadata"/>.
        </t>
      </section>

      <section anchor="federation_entity" title="Federation Entity">
        <t>
          The Entity Type Identifier is
          <spanx style="verb">federation_entity</spanx>.
        </t>
        <t>
          All Entities in a federation MAY use this Entity Type.
          The Entities that provide federation API endpoints
          MUST use this Entity Type.
        </t>
        <t>
          The following Federation Entity properties are defined:
          <list style="hanging">
            <t hangText="federation_fetch_endpoint">
              <vspace/>
              OPTIONAL.
              The fetch endpoint described in
              <xref target="fetch_endpoint"/>.
              This URL MUST use the <spanx style="verb">https</spanx>
              scheme and MAY contain port,
              path, and query parameter components encoded in
              <spanx style="verb">application/x-www-form-urlencoded</spanx>
              format;
              it MUST NOT contain a fragment component.
              Intermediate Entities and
              Trust Anchors MUST publish a
              <spanx style="verb">federation_fetch_endpoint</spanx>.
              Leaf Entities MUST NOT.
            </t>
            <t hangText="federation_list_endpoint">
              <vspace/>
              OPTIONAL.
              The list endpoint described in
              <xref target="entity_listing"/>.
              This URL MUST use the <spanx style="verb">https</spanx>
              scheme and MAY contain port,
              path, and query parameter components encoded in
              <spanx style="verb">application/x-www-form-urlencoded</spanx>
              format;
              it MUST NOT contain a fragment component.
              Intermediate Entities and
              Trust Anchors MUST publish a
              <spanx style="verb">federation_list_endpoint</spanx>.
              Leaf Entities MUST NOT.
            </t>
            <t hangText="federation_resolve_endpoint">
              <vspace/>
              OPTIONAL.
              The resolve endpoint described in
              <xref target="resolve"/>.
              This URL MUST use the <spanx style="verb">https</spanx>
              scheme and MAY contain port,
              path, and query parameter components encoded in
              <spanx style="verb">application/x-www-form-urlencoded</spanx>
              format;
              it MUST NOT contain a fragment component.
              Any federation Entity MAY publish a
              <spanx style="verb">federation_resolve_endpoint</spanx>.
            </t>
            <t hangText="federation_trust_mark_status_endpoint">
              <vspace/>
              OPTIONAL.
              The Trust Mark status endpoint described in
              <xref target="status_endpoint"/>. Trust Mark issuers SHOULD
              publish a
              <spanx style="verb">federation_trust_mark_status_endpoint</spanx>.
              This URL MUST use the <spanx style="verb">https</spanx>
              scheme and MAY contain port,
              path, and query parameter components encoded in
              <spanx style="verb">application/x-www-form-urlencoded</spanx>
              format;
              it MUST NOT contain a fragment component.
            </t>
            <t hangText="federation_trust_mark_list_endpoint">
              <vspace/>
              OPTIONAL.
              The endpoint described in
              <xref target="tm_listing"/>.
              This URL MUST use the <spanx style="verb">https</spanx>
              scheme and MAY contain port,
              path, and query parameter components encoded in
              <spanx style="verb">application/x-www-form-urlencoded</spanx>
              format;
              it MUST NOT contain a fragment component.
              Trust Mark issuers MAY publish a
              <spanx style="verb">federation_trust_mark_list_endpoint</spanx>.
            </t>
            <t hangText="federation_trust_mark_endpoint">
              <vspace/>
              OPTIONAL.
              The endpoint described in
              <xref target="tm_endpoint"/>.
              This URL MUST use the <spanx style="verb">https</spanx>
              scheme and MAY contain port,
              path, and query parameter components encoded in
              <spanx style="verb">application/x-www-form-urlencoded</spanx>
              format;
              it MUST NOT contain a fragment component.
              Trust Mark issuers MAY publish a
              <spanx style="verb">federation_trust_mark_endpoint</spanx>.
            </t>
	    <t hangText="federation_historical_keys_endpoint">
	      <vspace/>
	      OPTIONAL.
	      The endpoint described in <xref target="historical_keys"/>.
	      This URL MUST use the <spanx style="verb">https</spanx>
	      scheme and MAY contain port,
	      path, and query parameter components encoded in
	      <spanx style="verb">application/x-www-form-urlencoded</spanx> format;
	      it MUST NOT contain a fragment component.
	      All federation Entities MAY publish a historical keys endpoint.
	    </t>
          </list>
        </t>
	<t>
	  It is RECOMMENDED that each Federation Entity contain
	  an <spanx style="verb">organization_name</spanx> claim,
	  as defined in <xref target="informational_metadata"/>.
	</t>
        <figure>
	  <preamble>
	    The following is a non-normative example of the <spanx style="verb">federation_entity</spanx> Entity Type:
	  </preamble>
          <name>
            Example of <spanx style="verb">federation_entity</spanx> Entity Type
          </name>
          <artwork><![CDATA[
"federation_entity": {
  "federation_fetch_endpoint":
    "https://amanita.caesarea.example.com/federation_fetch",
  "federation_list_endpoint":
    "https://amanita.caesarea.example.com/federation_list",
  "federation_trust_mark_status_endpoint": "https://amanita.caesarea.example.com/status",
  "federation_trust_mark_list_endpoint": "https://amanita.caesarea.example.com/trust_marked_list",
  "organization_name": "Ovulo Mushroom",
  "homepage_uri": "https://amanita.caesarea.example.com"
}
]]></artwork>
        </figure>
      </section>

      </section>

      <section title="Metadata Extensions for OpenID Connect and OAuth 2.0" anchor="common_metadata">
        <t>
        This section defines additional metadata properties
        that MAY be used with all the Entity Types above.
        </t>

	<section anchor="jwks_metadata" title="Metadata Extensions for JWK Sets">
	  <t>
	    The following metadata properties define ways of obtaining
	    JWK Sets for an Entity Type of the Entity.
	  </t>
	  <t>
	    <list style="hanging">
	      <t hangText="signed_jwks_uri">
		<vspace/>
		OPTIONAL. URL referencing a signed JWT having the Entity's
		JWK Set document for that Entity Type as its payload.
		The JWT MUST be signed using a Federation Entity Key.
		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>
		The following claims are specified for use in the payload,
		all of which except <spanx style="verb">keys</spanx>
		are defined in <xref target="RFC7519"/>:
		<list style="hanging">
		  <t hangText="keys">
		    <vspace/>
		    REQUIRED. Array of JWK values.
		  </t>
		  <t hangText="iss">
		    <vspace/>
		    REQUIRED. The "iss" (issuer) claim identifies the principal
		    that issued the JWT.
		  </t>
		  <t hangText="sub">
		    <vspace/>
		    REQUIRED. This claim identifies the owner of the keys.
		    It SHOULD be the same as the issuer.
		  </t>
		  <t hangText="iat">
		    <vspace/>
		    OPTIONAL. This claim identifies the time when the JWT was
		    issued.
		  </t>
		  <t hangText="exp">
		    <vspace/>
		    OPTIONAL. This claim identifies the time when the JWT is
		    no longer valid.
		  </t>
		</list>
		More claims are defined in <xref target="RFC7519"/>; of
		these, <spanx style="verb">aud</spanx> SHOULD NOT be used since
		the issuer cannot know who the audience is.
		<spanx style="verb">nbf</spanx> and <spanx style="verb">jti</spanx>
		are not particularly useful in this context and SHOULD be omitted.

		<figure>
		  <preamble>
		    The following is a non-normative example of the JWT Claims Set for a signed JWK Set.
		  </preamble>
		  <name>
		    Example JWT Claims Set for a Signed JWK Set
		  </name>
		  <artwork><![CDATA[
    {
      "keys": [
        {
          "kty": "RSA",
          "kid": "SUdtUndEWVY2cUFDeDV5NVlBWDhvOXJodVl2am1mNGNtR0pmd",
          "n": "y_Zc8rByfeRIC9fFZrDZ2MGH2ZnxLrc0ZNNwkNet5rwCPYeRF3Sv
                5nihZA9NHkDTEX97dN8hG6ACfeSo6JB2P7heJtmzM8oOBZbmQ90n
                EA_JCHszkejHaOtDDfxPH6bQLrMlItF4JSUKua301uLB7C8nzTxm
                tF3eAhGCKn8LotEseccxsmzApKRNWhfKDLpKPe9i9PZQhhJaurwD
                kMwbWTAeZbqCScU1o09piuK1JDf2PaDFevioHncZcQO74Obe4nN3
                oNPNAxrMClkZ9s9GMEd5vMqOD4huXlRpHwm9V3oJ3LRutOTxqQLV
                yPucu7eHA7her4FOFAiUk-5SieXL9Q",
          "e": "AQAB"
        },
        {
          "kty": "EC",
          "kid": "MFYycG1raTI4SkZvVDBIMF9CNGw3VEZYUmxQLVN2T21nSWlkd3",
          "crv": "P-256",
          "x": "qAOdPQROkHfZY1daGofOmSNQWpYK8c9G2m2Rbkpbd4c",
          "y": "G_7fF-T8n2vONKM15Mzj4KR_shvHBxKGjMosF6FdoPY"
        }
      ],
      "iss": "https://example.org/op",
      "sub": "https://example.org/op",
      "iat": 1618410883
    }
]]>
		  </artwork>
		</figure>
	      </t>

	      <t hangText="jwks_uri">
		<vspace/>
		OPTIONAL.
		URL referencing a JWK Set document
		containing the Entity's keys for that Entity Type.
		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="jwks">
		<vspace/>
		OPTIONAL.
		JSON Web Key Set document, passed by value,
		containing the Entity's keys for that Entity Type.
		This parameter is intended
		to be used by participants that, for some reason,
		cannot use the <spanx style="verb">signed_jwks_uri</spanx>
		parameter.
		An upside of using <spanx style="verb">jwks</spanx> is that
		the Entity's keys for the Entity Type are recorded in Trust Chains.
	      </t>

	    </list>
	  </t>

	  <section title="Usage of jwks, jwks_uri, and signed_jwks_uri" anchor="jwks_usage">
	    <t>
	      It is RECOMMENDED that an Entity Configuration
	      use only one of
	      <spanx style="verb">jwks</spanx>,
	      <spanx style="verb">jwks_uri</spanx>, and
	      <spanx style="verb">signed_jwks_uri</spanx> in its OpenID Connect or OAuth 2.0 metadata.
	      However, there may be circumstances in which is it desirable to use multiple
	      JWK Set representations, such as when an Entity is in multiple federations and the
	      federations have different policies about the JWK Set representation to be used.
	      When multiple JWK Set representations are used, the keys present in each
	      representation SHOULD be the same.  Even if they are not completely the
	      same at a given instant in time (which may be the case during key rollover operations),
	      implementations MUST make them consistent in a timely manner.
	    </t>
	  </section>
	</section>

	<section anchor="informational_metadata" title="Informational Metadata Extensions">
	  <t>
	    The following metadata properties define ways of obtaining
	    information about the Entity for an Entity Type.
	  </t>
          <list style="hanging">
            <t hangText="organization_name">
              <vspace/>
              OPTIONAL. A human-readable
              name representing the organization owning this Entity.
              If the owner is a physical person,
              this MAY be, for example, the person's name. Note
              that this information will be publicly available.
            </t>
            <t hangText="contacts">
              <vspace/>
              OPTIONAL. JSON array with one or more
              strings representing contact persons at the Entity.
              These MAY contain names, e-mail addresses, descriptions, phone
              numbers, etc.
            </t>
            <t hangText="logo_uri">
              <vspace/>
              OPTIONAL. String. A URL that points to the logo of this Entity.
              The file containing the logo SHOULD be published
              in a format that can be viewed via the web.
            </t>
            <t hangText="policy_uri">
              <vspace/>
              OPTIONAL. URL of the documentation of
              conditions and policies relevant to this Entity.
            </t>
            <t hangText="homepage_uri">
              <vspace/>
              OPTIONAL. URL of a Web page for the organization owning this Entity.
            </t>
	  </list>
	  <t>
	    It is RECOMMENDED that, when present, these metadata properties occur in
	    an Entity's <spanx style="verb">federation_entity</spanx> metadata section.
	    They MAY also be present in the Entity's metadata for other Entity Types,
	    particularly when the values for those Entity Types differ from
	    those for the <spanx style="verb">federation_entity</spanx> metadata.
	  </t>
	</section>
      </section>

    </section>
    <section title="Federation Policy" anchor="federation_policy">
      <section title="Metadata Policy" anchor="metadata_policy">
        <t>
          Trust Anchors and Intermediate Entities MAY publish Entity Type-specific
	  policies that apply to the metadata of their immediate
          Subordinates as well as any further Subordinates along the Trust Chain.
        </t>
        <t>
          As described in <xref target="entity-statement"/>, the metadata
          policy operators are located in the <spanx style="verb">metadata_policy</spanx>
          claim of an Entity Statement, whose value is a JSON object.
        </t>
        <t>
          Each member in this object is an Entity Type-specific metadata policy,
          whose member name is an Entity Type Identifier, as specified in
          <xref target="entity_types"/>, for example
          <spanx style="verb">openid_relying_party</spanx>. The member value is
          a JSON object that represents metadata policies for the Entity Type
          and has the following structure:
          <list style="symbols">
            <t>
              It consists of one or more policy entries, each entry being
              represented by a JSON object.</t>
            <t>
              A policy entry applies to a single metadata parameter, for
              example <spanx style="verb">id_token_signed_response_alg</spanx>.
            </t>
            <t>
              A policy entry is represented by a JSON object and consists of
              one or more operators, to check or modify the metadata parameter,
              as described in <xref target="policy_operators"/>.
            </t>
            <t>
              A policy entry MAY include at most one operator of each kind.
            </t>
          </list>
        </t>
        <t>
          Note that metadata policies MUST regard any metadata parameter with
          a language tag in its name, as described in <xref target="ClaimsLanguagesAndScripts"/>,
          as distinct from the same metadata parameter without a language tag.
        </t>
          <t>
            <figure>
              <preamble>
                The following is a non-normative example of a policy entry
		providing metadata policy for an OpenID Connect RP:
              </preamble>
	      <name>
		  Example <spanx style="verb">metadata_policy</spanx> Claim
	      </name>
              <artwork><![CDATA[
"metadata_policy" : {
  "openid_relying_party": {
    "id_token_signed_response_alg": {
      "default": "ES256",
      "one_of" : ["ES256", "ES384", "ES512"]
    }
  }
}
]]></artwork>
            </figure>
          </t>
        <section title="Operators" anchor="policy_operators">
          <t>
            This specification defines the following metadata policy operators.
          </t>
          <t>
            Metadata policy operators that modify values are:
            <list style="hanging">
              <t hangText="value">
                <vspace/>
                The metadata parameter MUST be assigned the value that is the
                value of this operator.
              </t>
              <t hangText="add">
                <vspace/>
                The value or values of this operator MUST be added to the
                metadata parameter. If any of these values are already present
                in the metadata parameter, they MUST NOT be added another time.
                If the metadata parameter is absent, the parameter MUST be
                initialized with the value of this operator.
              </t>
              <t hangText="default">
                <vspace/>
                If the metadata parameter is absent, it MUST be set to the
                value of this operator.
              </t>
            </list>
          </t>
          <t>
            Metadata policy operators that check values are:
            <list style="hanging">
              <t hangText="essential">
                <vspace/>
                If the value of this operator is <spanx style="verb">true</spanx>,
                then the metadata parameter MUST be present.
                If <spanx style="verb">false</spanx> the metadata parameter is
                voluntary and may be absent.
                If the <spanx style="verb">essential</spanx> operator is omitted,
                this is equivalent to including it with a value of
                <spanx style="verb">false</spanx>.
              </t>
              <t hangText="one_of">
                <vspace/>
                If the metadata parameter is present its value MUST be one of
                those listed in the operator value.
              </t>
              <t hangText="subset_of">
                <vspace/>
                If the metadata parameter is present this operator computes the
                intersection between the values of the operator and the metadata
                parameter.
                If the intersection is non-empty, the parameter is set to the
                values in the intersection.
                If the intersection is empty, the result is determined by the
                <spanx style="verb">essential</spanx> operator: For an essential
                metadata parameter, the result is an error; for a voluntary
                metadata parameter, it MUST be removed from the metadata.
                Note that this behavior makes <spanx style="verb">subset_of</spanx>
                a potential value modifier in addition to it being a value check.
              </t>
              <t hangText="superset_of">
                <vspace/>
                If the metadata parameter is present its values MUST contain
                those specified in the operator. By mathematically defining
                supersets, equality is included.
              </t>
            </list>
          </t>

          <t>
            Applications and protocols utilizing metadata policies MAY specify
            and use additional policy operators.
          </t>

          <t>
            All policy operators MUST consider it an error if a metadata
            parameter that is being operated on has a <spanx style="verb">null</spanx>
            value. Policy operators MUST NOT output metadata parameters with a
            <spanx style="verb">null</spanx> value.
          </t>

          <t>
            A "set equals" value check can be expressed by combining a
            <spanx style="verb">subset_of</spanx> and a
            <spanx style="verb">superset_of</spanx> with identical string
            list values.
          </t>
          <t>
            Note that when a metadata parameter is defined as a space-separated
            list of strings, like <spanx style="verb">scope</spanx> in
            <xref target="RFC7591"/>, the <spanx style="verb">subset_of</spanx>,
            <spanx style="verb">superset_of</spanx> and
            <spanx style="verb">default</spanx> operator values are still
            expressed as lists of strings.
            This language from <xref target="RFC6749"/> also applies to
            metadata parameters for which values can be expressed as a
            space-separated lists of strings: "If the value contains multiple
            space-delimited strings, their order does not matter, and each
            string adds an additional access range to the requested scope."
          </t>

        <table>
          <preamble>
              The following table is a map of the outputs produced by the
              combination of the <spanx style="verb">essential</spanx> and
              <spanx style="verb">subset_of</spanx> policy operators with
              different input metadata parameter values.
              Note, the <spanx style="verb">subset_of</spanx> check is ignored
              when the metadata parameter is absent and designated as voluntary,
              as shown in the last row.
          </preamble>
	  <name>
	    Examples of outputs with Combinations of <spanx style="verb">essential</spanx>
        and <spanx style="verb">subset_of</spanx> inputs
	  </name>
          <thead>
            <tr>
              <td colspan="2">Policy</td>
              <td colspan="2">Metadata Parameter</td>
            </tr>
            <tr>
              <td colspan="">essential</td>
              <td colspan="">subset_of</td>
              <td colspan="">input</td>
              <td colspan="">output</td>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td>true</td>
              <td>[a,b,c]</td>
              <td>[a,e]</td>
              <td>[a]</td>
            </tr>

            <tr>
              <td>false</td>
              <td>[a,b,c]</td>
              <td>[a,e]</td>
              <td>[a]</td>
            </tr>

            <tr>
              <td>true</td>
              <td>[a,b,c]</td>
              <td>[d,e]</td>
              <td>error</td>
            </tr>

            <tr>
              <td>false</td>
              <td>[a,b,c]</td>
              <td>[d,e]</td>
              <td>no parameter</td>
            </tr>

            <tr>
              <td>true</td>
              <td>[a,b,c]</td>
              <td>no parameter</td>
              <td>error</td>
            </tr>

            <tr>
              <td>false</td>
              <td>[a,b,c]</td>
              <td>no parameter</td>
              <td>no parameter</td>
            </tr>
          </tbody>
        </table>

        </section>
        <section title="Restrictions on Policy Entries" anchor="policy_restr">
          <t>
            As stated, a policy entry can contain one or more operators.
            Not all operators are allowed to appear together in a policy entry.
          </t>
          <t>
            <list style="hanging">
              <t hangText="subset_of/superset_of and one_of">
                <vspace/>
                <spanx style="verb">subset_of</spanx>
                and
                <spanx style="verb">superset_of</spanx>
                apply to parameters
                that can have more than
                one value (for instance, <spanx style="verb">contacts</spanx>),
                while <spanx style="verb">one_of</spanx> applies to
                parameters that can only have one value (for instance,
                <spanx style="verb">id_token_signed_response_alg</spanx>).
                Therefore, <spanx style="verb">one_of</spanx> cannot
                appear beside
                <spanx style="verb">subset_of</spanx>/
                <spanx style="verb">superset_of</spanx>
                in a policy entry.
              </t>
              <t hangText="value">
                <vspace/>
                <spanx style="verb">value</spanx>
                overrides everything else.
                So having <spanx style="verb">value</spanx> together with any
                other operator (except for
                <spanx style="verb">essential</spanx>) does not make sense.
              </t>
            </list>
          </t>
          <t>
            Other restrictions are:
          </t>
          <t>
            <list style="symbols">
              <t>
                If <spanx style="verb">subset_of</spanx> and
                <spanx style="verb">superset_of</spanx>
                both appear as operators, then the
                list of values in
                <spanx style="verb">subset_of</spanx>
                MUST be a superset of the values in
                <spanx style="verb">superset_of</spanx>.
              </t>
              <t>
                If <spanx style="verb">add</spanx> appears in a policy entry
                together with
                <spanx style="verb">subset_of</spanx>
                then the value/values of <spanx style="verb">add</spanx> MUST
                be a subset of <spanx style="verb">subset_of</spanx>.
              </t>
              <t>
                If <spanx style="verb">add</spanx> appears in a policy entry
                together with
                <spanx style="verb">superset_of</spanx>
                then
                the values of <spanx style="verb">add</spanx> MUST be a
                superset of <spanx style="verb">superset_of</spanx>.
              </t>
              <t>
                If <spanx style="verb">default</spanx> appears in a policy
                entry together with
                <spanx style="verb">subset_of</spanx>
                then
                the values of <spanx style="verb">default</spanx> MUST be a
                subset of <spanx style="verb">subset_of</spanx>.
              </t>
              <t>
                If <spanx style="verb">default</spanx> appears in a policy entry
                together with
                <spanx style="verb">superset_of</spanx>
                then the values of <spanx style="verb">default</spanx> MUST be a
                superset of
                <spanx style="verb">superset_of</spanx>.
              </t>
              <t>
                If <spanx style="verb">add</spanx> appears in a policy entry
                together with <spanx style="verb">one_of</spanx> then
                the
                value of <spanx style="verb">add</spanx> MUST be a member
                of <spanx style="verb">one_of</spanx>.
              </t>
              <t>
                If <spanx style="verb">default</spanx> appears in a policy entry
                together with
                <spanx style="verb">one_of</spanx>
                then the
                value <spanx style="verb">default</spanx> MUST be a member
                of <spanx style="verb">one_of</spanx>.
              </t>
            </list>
          </t>
        </section>
        <section title="Combining Policies" anchor="combining_policies">
          <t>
            If there is more than one Entity Statement with metadata policy in a
            Trust Chain, then the policies MUST be combined before they are applied
            to the metadata statement.
          </t>
          <t>
            Using the notation defined in <xref target="trust_chain"/>, policies are
            combined by starting with ES[i] and then adding the policies from ES[j]
            j=i-1,..,1. When for a given metadata parameter both the combined policy
            at the current step and the Subordinate Entity specify a policy operator,
            for example <spanx style="verb">subset_of</spanx>, the two operators are
            merged, as described in <xref target="merging_policy_operators"/>. After
            each combination step the policy for each parameter MUST adhere to the
            rules in <xref target="policy_restr"/>. The final combined policy is then
            applied to the Entity's metadata, as described in
            <xref target="applying_policies"/>.
          </t>
          <t>
            If during the combination process an operator merge rule or a policy
            restriction is violated or otherwise an error is produced, the process
            MUST stop and the policy combination MUST be considered invalid.
          </t>

          <section title="Merging Operators" anchor="merging_policy_operators">
            <t>
              The policy operators (as defined in <xref target="policy_operators"/>)
              for a metadata parameter MUST be merged as follows:
            </t>
            <t>
              <list style="hanging">
                <t hangText="subset_of">
                  <vspace/>
                  The result of merging the values of two
                  <spanx style="verb">subset_of</spanx> operators is the
                  intersection of the operator values.
                </t>
                <t hangText="one_of">
                  <vspace/>
                  The result of merging the values of two
                  <spanx style="verb">one_of</spanx> operators is the
                  intersection of the operator values.
                </t>
                <t hangText="superset_of">
                  <vspace/>
                  The result of merging the values of two
                  <spanx style="verb">superset_of</spanx> operators is the
                  union of the operator values.
                </t>
                <t hangText="add">
                  <vspace/>
                  The result of merging the values of two
                  <spanx style="verb">add</spanx>
                  operators is the union of the values.
                </t>
                <t hangText="value">
                  <vspace/>
                  Merging two <spanx style="verb">value</spanx> operators
                  requires the two operator values to be equal. If the values
                  are not equal this MUST be treated as error.
                </t>
                <t hangText="default">
                  <vspace/>
                  Merging two <spanx style="verb">default</spanx> operators
                  requires the two operator values to be equal. If the values
                  are not equal this MUST be treated as error.
                </t>
                <t hangText="essential">
                  <vspace/>
                  If a Superior has specified <spanx style="verb">essential=true</spanx>,
                  then a Subordinate cannot change that.
                  If a Superior has specified <spanx style="verb">essential=false</spanx>,
                  then a Subordinate is allowed to change that to
                  <spanx style="verb">essential=true</spanx>.
                  If a Superior has not specified <spanx style="verb">essential</spanx>,
                  then a Subordinate can set <spanx style="verb">essential</spanx> to
                  <spanx style="verb">true</spanx> or <spanx style="verb">false</spanx>.
                  If those rules are not met this MUST be treated as error.
                </t>
              </list>
            </t>
          </section>
        </section>

        <section title="Applying Policies" anchor="applying_policies">
          <t>
            The policies that apply to the Entity's metadata are those that
            result from the combining of the policies from the Entity Statements
            that make up the Trust Chain, as specified in
            <xref target="combining_policies"/>.
          </t>
          <t>
            For every Entity Type metadata parameter for which a policy entry
            is present, the policy operators MUST be applied in accordance to
            their definitions in <xref target="policy_operators"/> and in a
            sequence as follows:
          </t>
          <t>
            <list style="numbers">
              <t>
		<spanx style="verb">value</spanx>:
                If this policy operator is present, further policy operators on
                the metadata parameter MUST NOT be applied.
              </t>
              <t><spanx style="verb">add</spanx></t>
              <t><spanx style="verb">default</spanx></t>
              <t>
		<spanx style="verb">essential</spanx>:
                If this parameter value is <spanx style="verb">false</spanx> or
                it is absent, then any subsequent policy operators that
                represent a value check MUST be skipped.
              </t>
              <t><spanx style="verb">one_of</spanx></t>
              <t><spanx style="verb">subset_of</spanx></t>
              <t><spanx style="verb">superset_of</spanx></t>
            </list>
          </t>
          <t>
            Applications and protocols that specify additional policy operators
            MUST define their order relative to the above sequence of operator
            application.
          </t>
        </section>
        <section title="Policy Combination Example">
          <figure>
            <preamble>
              We start with a federation's policy for OAuth 2.0 clients:
            </preamble>
	    <name>
	      Example Federation's Policy for OAuth 2.0 Clients
	    </name>
            <artwork><![CDATA[
"metadata_policy": {
  "oauth_client": {
    "grant_types": {
      "subset_of": ["authorization_code", "implicit", "refresh_token"],
      "superset_of": ["authorization_code"],
      "default": ["authorization_code", "refresh_token"]
    },
    "token_endpoint_auth_method": {
      "one_of": [
        "client_secret_post",
        "client_secret_basic"
      ]
    },
    "contacts": {
      "add": "helpdesk@federation.example.org"
    }
  }
}
]]></artwork>
          </figure>
          <figure>
            <preamble>
              Next, we have an organization's policy for OAuth 2.0 clients:
            </preamble>
	    <name>
	      Example Organization's Policy for OAuth 2.0 Clients
	    </name>
            <artwork><![CDATA[
"metadata_policy": {
  "oauth_client": {
    "grant_types": {
      "subset_of": ["authorization_code", "refresh_token", "implicit"],
      "default": ["authorization_code", "refresh_token"]
    },
    "token_endpoint_auth_method": {
      "one_of": [
        "client_secret_post",
        "client_secret_basic"
      ],
      "default": "client_secret_basic"
    },
    "contacts": {
      "add": "helpdesk@org.example.org"
    }
  }
}
]]></artwork>
          </figure>
          <figure>
            <preamble>
              The resulting combined metadata policy is:
            </preamble>
	    <name>
	      Combined Policies from the Previous Two Examples
	    </name>
            <artwork><![CDATA[
"metadata_policy": {
  "oauth_client": {
    "grant_types": {
      "subset_of": ["authorization_code", "refresh_token"],
      "superset_of": ["authorization_code"],
      "default": ["authorization_code", "refresh_token"]
    },
    "token_endpoint_auth_method": {
      "one_of": [
	"client_secret_post",
	"client_secret_basic"
      ],
      "default": "client_secret_basic"
    },
    "contacts": {
      "add": [
	"helpdesk@federation.example.org",
	"helpdesk@org.example.org"
      ]
    }
  }
}
]]></artwork>
          </figure>
        </section>
        <section title="Enforcing Policy">
          <t>
            If applying policies to a metadata statement results in incorrect
            metadata, then such a metadata statement MUST
            be regarded as broken and MUST NOT be used.
          </t>
	  <t>
	    It is the responsibility of the implementation to verify that the metadata
	    resulting from applying the policies of a federation that it is using
	    is supported by the implementation.
	    For instance, the implementation needs to support any cryptographic algorithms
	    required by the resulting metadata.
	    Implementations may need to reevaluate their compliance when policies change.
	  </t>
        </section>
        <section title="Extending the Policy Language">
          <t>
            There might be parties that want to extend the policy language
            defined here. If that happens, then the rule is that if
            software compliant with this specification
            encounters a keyword it does not understand,
            it MUST ignore it unless it is listed in a
            <spanx style="verb">metadata_policy_crit</spanx> list,
            as is done for JWS header parameters
            with the <spanx style="verb">crit</spanx> parameter.
            If the policy language extension keyword
            is listed in the <spanx style="verb">metadata_policy_crit</spanx> list
            and not understood, then the metadata MUST be rejected.
          </t>
        </section>
        <section title="Example of Applying Policies">
          <t>
            The following is a non-normative example of a set of policies being
            applied to an RP's metadata.
          </t>
          <figure>
            <preamble>
              The RP's metadata from its Entity Configuration is:
            </preamble>
	    <name>
	      RP's Metadata from its Entity Configuration
	    </name>
            <artwork><![CDATA[
"metadata": {
  "openid_relying_party": {
    "contacts": [
      "rp_admins@cs.example.com"
    ],
    "redirect_uris": [
      "https://cs.example.com/rp1"
    ],
    "response_types": [
      "code"
    ]
  }
}
]]></artwork>
          </figure>
          <figure>
            <preamble>
              The federation's policy for RPs is:
            </preamble>
	    <name>
	      Federation's Policy for RPs
	    </name>
            <artwork><![CDATA[
"metadata_policy": {
  "openid_relying_party": {
    "id_token_signed_response_alg": {
      "one_of": [
        "ES256",
        "ES384"
      ],
      "default": "ES256",
    },
    "response_types": {
      "subset_of": [
        "code",
        "code id_token"
      ]
    }
  }
}
]]></artwork>
          </figure>
          <figure>
            <preamble>
              The organization's policy for RPs is:
            </preamble>
	    <name>
	      Organization's Policy for RPs
	    </name>
            <artwork><![CDATA[
{
  "metadata_policy": {
    "openid_relying_party": {
      "contacts": {
        "add": "helpdesk@example.com"
      },
      "logo_uri": {
        "one_of": [
          "https://example.com/logo_small.svg",
          "https://example.com/logo_big.svg"
        ],
        "default": "https://example.com/logo_small.svg"
      }
    }
  },
  "metadata": {
    "openid_relying_party": {
      "policy_uri": "https://example.com/policy.html",
      "tos_uri": "https://example.com/tos.html"
    }
  }
}
]]></artwork>
          </figure>
          <figure>
	    <preamble>
	      After applying the policies above,
	      the metadata for the Entity in question would become:
	    </preamble>
	    <name>
	      RP's Metadata After Application of Policies
	    </name>
            <artwork><![CDATA[
"metadata": {
  "openid_relying_party": {
    "contacts": [
      "rp_admins@cs.example.com",
      "helpdesk@example.com"
    ],
    "logo_uri": "https://example.com/logo_small.svg",
    "policy_uri": "https://example.com/policy.html",
    "tos_uri": "https://example.com/tos.html",
    "id_token_signed_response_alg": "ES256",
    "response_types": [
      "code"
    ],
    "redirect_uris": [
      "https://cs.example.com/rp1"
    ]
  }
}
]]></artwork>
          </figure>
        </section>
      </section>
      <section title="Constraints" anchor="chain_constraints">
	<t>
	  Constraints define criteria applied to Trust Chains,
	  as described in the <spanx style="verb">constraints</spanx>
	  claim definition in <xref target="entity-statement"/>.
	  Constraints are applied to all Entity Statements
	  that are subordinates of the one containing them.
	</t>
        <t>A set of constraints can contain the following claims:</t>
        <t>
          <list style="hanging">
            <t hangText="max_path_length">
              <vspace/>
              OPTIONAL. Integer. The maximum number of Entity Statements
              between this Entity Statement and the last Entity Statement in
              the Trust Chain.
            </t>
            <t hangText="naming_constraints">
              <vspace/>
              OPTIONAL. JSON object. Restriction on the Entity Identifiers of
              the
              Entities below this Entity. The behavior of this claim mimics
              what is defined in Section 4.2.1.10 of <xref target="RFC5280"/>.
              Restrictions are defined in terms of permitted or excluded name
              subtrees.
            </t>
            <t hangText="allowed_leaf_entity_types">
              <vspace/>
              OPTIONAL. An array of strings. Each string is an Entity Type.
              Entity Type Identifiers defined in this specification
              can be found in <xref target="entity_types"/>.
              This constraint restricts what types of Leaf Entities MAY
              appear beneath the Entity described in this Entity Statement.
            </t>
          </list>
        </t>
        <figure>
	  <preamble>
	    The following is a non-normative example of a set of constraints:
	  </preamble>
	  <name>
            Example Set of Constraints
          </name>
          <artwork><![CDATA[
{
  "naming_constraints": {
    "permitted": [
      "https://.example.com"
    ],
    "excluded": [
      "https://east.example.com"
    ]
  },
  "max_path_length": 2,
  "allowed_leaf_entity_types": ["openid_provider", "openid_relying_party"]
}
]]></artwork>
        </figure>
        <t>
          When an Entity has a <spanx style="verb">constraints</spanx> claim in its
          Entity Configuration and issues a Subordinate Statement,
          then if the same type of constraint, for example a
          <spanx style="verb">max_path_length</spanx>,
          appears in both the Entity Configuration and the Subordinate Statement,
          the more restrictive of the two MUST take precedence.
        </t>
        <t>
          If a Subordinate Statement contains a constraint specification
          that is more restrictive than the one in effect, then the more
          restrictive constraint MUST take effect from here on.
          If a Subordinate Statement contains a constraint specification
          that is less restrictive than the one in effect, then it MUST be
          ignored.
        </t>

        <section title="Max Path Length" anchor="max_path_length">
          <t>
            The <spanx style="verb">max_path_length</spanx> constraint specifies
            the maximum number of
            Entity Statements a Trust Chain can have between the Entity Statement
            that contains the constraint specification and the Leaf's Entity Statement.
          </t>
          <t>
            A <spanx style="verb">max_path_length</spanx> constraint of zero
            indicates that no
            Intermediates MAY appear between this Entity and the
            Leaf Entity. Where it appears, the
            <spanx style="verb">max_path_length</spanx> constraint
            MUST have a value greater than or equal to zero.
          </t>
          <t>
            Not including a <spanx style="verb">max_path_length</spanx> constraint means that there are
            no additional constraints apart from those already in effect.
          </t>
          <t>
            Assuming that we have a Trust Chain with four Entity Statements:
            <list style="numbers">
              <t>Entity Configuration of the Leaf Entity (LE)</t>
              <t>Subordinate Statement by Intermediate 1 (I1) about LE</t>
              <t>Subordinate Statement by Intermediate 2 (I2) about I1</t>
              <t>Subordinate Statement by the Trust Anchor (TA) about I2</t>
            </list>
          </t>
          <t>
            Then the Trust Chain fulfills the constraints if, for instance:
            <list style="symbols">
              <t>
                The TA specifies a <spanx style="verb">max_path_length</spanx> that
                is greater than or equal to 2.
              </t>
              <t>
                TA specifies a <spanx style="verb">max_path_length</spanx> of 2,
                I2 specifies a <spanx style="verb">max_path_length</spanx> of 1,
                and I1 sets no <spanx style="verb">max_path_length</spanx> constraint.
              </t>
              <t>Neither TA nor I2 specifies any
                <spanx style="verb">max_path_length</spanx> constraint
                while I1 sets <spanx style="verb">max_path_length</spanx> to 0.
              </t>
            </list>
          </t>
          <t>
            The Trust Chain does not fulfill the constraints if, for instance, the:
            <list style="symbols">
              <t>TA's Subordinate Statement has set the <spanx style="verb">max_path_length</spanx> to
                1.
              </t>
            </list>
          </t>
        </section>

        <section title="Naming Constraints" anchor="naming_constraints">
          <t>
            The <spanx style="verb">naming_constraints</spanx> member
            specifies a namespace within which all subject
            Entity Identifiers in Subordinate Entity Statements in a Trust Chain
            MUST be located.
          </t>
          <t>
            Restrictions are defined in terms of permitted or excluded domain name
            subtrees. Any name matching a restriction in the excluded
            claim is invalid regardless of the information appearing in the
            permitted claim.
          </t>
          <t>
            Domain name constraints are as specified in Section 4.2.1.10 of <xref target="RFC5280"/>.
            As stated there, a domain name constraint MUST be specified as a fully qualified domain name
            and MAY specify a host or a domain. Examples are
            "host.example.com" and ".example.com". When the domain name constraint begins
            with a period, it MAY be expanded with one or more labels.
            That is, the domain name constraint ".example.com" is satisfied by both
            host.example.com and my.host.example.com. However, the domain name constraint
            ".example.com" is not satisfied by "example.com". When the
            domain name constraint does not begin with a period, it specifies a host.
          </t>
        </section>
        <section title="Leaf Entity Type Constraints"
                 anchor="leaf_entity_type_constraints">
          <t>
            The <spanx style="verb">allowed_leaf_entity_types</spanx> constraint
            specifies what Entity Types are acceptable for Leaf Entities beneath an
            Entity. If there is no <spanx style="verb">allowed_leaf_entity_types</spanx>
            constraint, it means that any Entity Type is allowed.
          </t>
        </section>
      </section>

      <section title="Trust Marks" anchor="trust_marks">
	<t>
	  Per the definition in <xref target="Terminology"/>,
	  Trust Marks are statements of conformance to sets of criteria
	  determined by an accreditation authority.
	  Trust Marks used by this specification are signed JWTs.
	  Entity Statements MAY include Trust Marks,
	  as described in the <spanx style="verb">trust_marks</spanx>
	  claim definition in <xref target="entity-statement"/>.
        </t>
        <t>
	  A Trust Mark issuer is a Federation Entity that issues Trust Marks.
          A Trust Mark owner is an Entity the owns the right to a Trust Mark
          identifier.
        </t>
        <t>
          Trust Marks are signed by a federation-accredited
          authority called a Trust Mark issuer.
	  All Trust Mark issuers MUST be represented in the
          federation by an Entity. The fact that a Trust Mark issuer is
          accepted by the federation is expressed in the
          <spanx style="verb">trust_mark_issuers</spanx> claim of the
          Trust Anchor's Entity Configuration.
        </t>
        <t>
          The key used by the Trust Mark
          issuer to sign its Trust Marks MUST be one of the private keys
          related to its
          <spanx style="verb">Federation Entity Keys</spanx>.
        </t>
        <t>
          Note that a federation MAY allow an Entity to self-sign
          Trust Marks.
        </t>
        <t>
          Trust Mark JWTs MUST be explicitly typed by setting the
          <spanx style="verb">typ</spanx> header parameter to
          <spanx style="verb">trust-mark+jwt</spanx>. This is done to prevent
          cross-JWT confusion, per Section 3.11 of <xref target="RFC8725"/>.
        </t>

        <section title="Trust Mark Delegation" anchor="trust_mark_delegation">
          <t>
            There will be cases where the owner of a Trust Mark for some reason
            may not match the Trust Mark issuer due to administrative or
            technical requirements. Take as an example vehicle
            inspection. Vehicle inspection is a procedure mandated by national
            or subnational governments in many countries, in which a vehicle is
            inspected to ensure that it conforms to regulations governing
            safety, emissions, or both. The body that mandates the inspections
            does not perform them; instead, there may be commercial companies
            performing the inspections, after which they issue the Trust Mark.
          </t>
          <t>
            The fact that a Trust Mark is issued by a Trust Mark issuer that is
            not the owner of the Trust Mark is expressed by including
	    a <spanx style="verb">delegation</spanx> claim in the Trust Mark,
	    whose value is a signed JWT.
            The format of the delegation JWT is described below.
          </t>
          <t>
            If the Federation Operator knows that Trust Marks with a
            certain Trust Mark identifier may legitimately be issued by Trust Mark issuers
            that are not the owner of the Trust Mark identifier, then information
            about the owner and the Trust Mark identifier MUST be included in the
            <spanx style="verb">trust_mark_owners</spanx> claim in
	    the Trust Anchor's Entity Configuration.
          </t>
        </section>

        <section title="Trust Mark Claims" anchor="trust_mark_claims">
          <t>
	    These claims are used in Trust Marks:
	  </t>
          <t>
            <list style="hanging">
              <t hangText="iss">
                <vspace/>
                REQUIRED. String. Issuer of the Trust Mark.
              </t>
              <t hangText="sub">
                <vspace/>
                REQUIRED. String. Entity this Trust Mark applies to.
              </t>
              <t hangText="id">
                <vspace/>
		The <spanx style="verb">id</spanx> (identifier) claim
		provides an identifier for a property of the JWT.
		Like the <spanx style="verb">sub</spanx> (subject) claim,
		the processing of this claim is generally application specific.
		The <spanx style="verb">id</spanx> value is a case-sensitive string
		containing a StringOrURI value.
		Use of this claim in JWTs is OPTIONAL.
		<vspace blankLine="1"/>

		This claim is REQUIRED when the JWT is a Trust Mark.
		In this case, its value is the identifier of the Trust Mark.
                The Trust Mark identifier
                MUST be collision-resistant
                across multiple federations.
                It is RECOMMENDED that the
		identifier
                value is built
                using a URL that uniquely identifies the federation
                or the trust framework
                within which it was issued. This is required to prevent
                Trust Marks issued in different federations
                from having colliding identifiers.
              </t>
              <t hangText="iat">
                <vspace/>
                REQUIRED. Number. Time when this Trust Mark was issued.
                This is expressed as Seconds Since the Epoch, per <xref target="RFC7519"/>.
              </t>
              <t hangText="logo_uri">
                <vspace/>
                OPTIONAL. String. URL that references a logo for the Entity.
		The value of this field MUST point to a valid image file.
              </t>
              <t hangText="exp">
                <vspace/>
                OPTIONAL. Number. Time when this Trust Mark is no longer valid.
                This is expressed as Seconds Since the Epoch, per <xref target="RFC7519"/>.
                If not present, it means that
                the Trust Mark does not expire.
              </t>
              <t hangText="ref">
                <vspace/>
		The <spanx style="verb">ref</spanx> (reference) claim
		provides a URI property for the JWT.
		Like the <spanx style="verb">sub</spanx> (subject) claim,
		the processing of this claim is generally application specific.
		The <spanx style="verb">ref</spanx> value is a case-sensitive string
		containing a URI value.
		Use of this claim in JWTs is OPTIONAL.
		<vspace blankLine="1"/>

		When the JWT is a Trust Mark,
		its value is a URL that refers to human-readable information
		connected to the issuance of the Trust Mark.
		Use of this claim in Trust Marks is OPTIONAL.
              </t>
              <t hangText="delegation">
                <vspace/>
		The <spanx style="verb">delegation</spanx> claim
		expresses a delegation relationship.
		Like the <spanx style="verb">sub</spanx> (subject) claim,
		the processing of this claim is generally application specific.
		The <spanx style="verb">delegation</spanx> value is a case-sensitive string.
		Use of this claim in JWTs is OPTIONAL.
		<vspace blankLine="1"/>

		When the JWT is a Trust Mark,
		its value is a signed JWT containing information about
		a delegation of the right to issue Trust Marks with a particular identifier
                created by the owner of the Trust Mark
		that identifies the delegated issuer of the Trust Mark.
		Use of this claim in Trust Marks is OPTIONAL.
              </t>
            </list>
          </t>
          <t>
            Other claims MAY be defined and used in conjunction with the claims above.
            The recommendations for claim naming in Section 5.1.2 of
            <xref target="OpenID.Core">OpenID Connect Core 1.0</xref> apply.
          </t>
        </section>
        <section title="Trust Mark Delegation Claims" anchor="delegation_claim">
          <t>
            Trust Mark delegation JWTs MUST be explicitly typed, by setting the
            <spanx style="verb">typ</spanx> header parameter to
            trust-mark-delegation+jwt. This prevents
            cross-JWT confusion, per Section 3.11 of <xref target="RFC8725"/>.
          </t>
          <t>
            The delegation claims:
          </t>
          <t>
            <list style="hanging">
              <t hangText="iss">
                <vspace/>
                REQUIRED. String. The owner of the Trust Mark.
              </t>
              <t hangText="sub">
                <vspace/>
                REQUIRED. String. The Entity this delegation applies to.
              </t>
              <t hangText="id">
                <vspace/>
                REQUIRED. String. The identifier of the Trust Mark.
              </t>
              <t hangText="iat">
                <vspace/>
                REQUIRED. Number. Time when this delegation was issued.
                This is expressed as Seconds Since the Epoch, per <xref target="RFC7519"/>.
              </t>
              <t hangText="exp">
                <vspace/>
                OPTIONAL. Number. Time when this delegation stops being valid.
                This is expressed as Seconds Since the Epoch, per <xref target="RFC7519"/>.
                If not present, it means that the delegation does not expire
                and is valid until revoked.
              </t>
              <t hangText="ref">
                <vspace/>
                OPTIONAL. String. URL that points to human-readable information
                connected to the Trust Mark.
              </t>
            </list>
          </t>
        </section>
        <section title="Validating a Trust Mark" anchor="trust_valid">
          <t>
	    An Entity SHOULD NOT try to validate a Trust Mark until
	    it knows which Trust Anchor it is using.
	    To validate a Trust Mark issuer, follow the procedure
	    defined in <xref target="resolving_trust"/>.
	    To validate a Trust Mark:
            <list style="numbers">
              <t>
                Check the signature of the signed JWT and verify that
                it has not expired.
              </t>
              <t>
                If the Trust Mark identifier appears in the
                <spanx style="verb">trust_mark_owners</spanx> claim,
                verify that the Trust Mark contains
                a <spanx style="verb">delegation</spanx>
                claim.
                The set of claims for the the Trust Mark identifier
                in the <spanx style="verb">trust_mark_owners</spanx> value
                are used in the following way:
                <list style="symbols">
                  <t>
                    The signature of the <spanx style="verb">delegation</spanx> JWT
                    MUST verify with a key from <spanx style="verb">jwks</spanx> claim.
                  </t>
                  <t>
                    The issuer of the <spanx style="verb">delegation</spanx> JWT
		    MUST match the <spanx style="verb">sub</spanx> value
		    in this set of claims.
                  </t>
                </list>
              </t>
              <t>
                Using the Trust Mark issuer status endpoint to verify that the
                Trust Mark is still active
                is described in <xref target="status_endpoint"/>.
              </t>
            </list>
          </t>
          <t>
            Note that the Entity representing the accreditation authority
            SHOULD be well known and trusted for a given Trust Mark identifier.
            A Trust Anchor MAY publish a list of accreditation authorities
            of Trust Marks that SHOULD be trusted by other Entities.
            A Trust Anchor uses the <spanx style="verb">trust_mark_issuers</spanx> claim
            in its Entity Configuration to publish this information.
          </t>
          <t>
            If a Trust Mark issuer is issuing Trust Marks on behalf of a
            Trust Mark owner, then the Trust Anchor MUST publish the
            connection between the Trust Mark identifier
	    and the corresponding Trust Mark issuer in the
            <spanx style="verb">trust_mark_issuers</spanx> claim. This
            signifies that the Trust Anchor has validated
            the Trust Mark owner and that the
            Trust Mark owner has delegated the right to issue Trust Marks
            with a designated Trust Mark identifier to a specified Trust Mark issuer.
          </t>
          <t>
            Trust Marks that are not recognized within a federation SHOULD be ignored when
            evaluating trust in the Entity that presented them. Such Trust Marks can
            appear for various reasons, such as the Entity Configuration including Trust Marks
            associated with another federation, or Trust Marks intended for specific
            purposes or Entity audiences.
          </t>
          <t>
            An Entity MAY choose, at its own discretion, to utilize Trust Marks presented
            to it that are not recognized within the federation, and where the
            accreditation authority is established by some out-of-band mechanism.
          </t>
        </section>
        <section title="Trust Mark Examples" anchor="trust_example">
          <figure>
            <preamble>
              A non-normative example of a <spanx style="verb">trust_marks</spanx>
	      claim in the JWT Claims Set for an Entity Configuration is:
            </preamble>
	    <name>
	      Trust Mark in an Entity Configuration JWT Claims Set
	    </name>
            <artwork><![CDATA[
{
  "iss": "https://rp.example.it/spid/",
  "sub": "https://rp.example.it/spid/",
  "iat": 1516239022,
  "exp": 1516298022,
  "trust_marks": [
    {
     "id": "https://www.spid.gov.it/certification/rp",
     "trust_mark":
       "eyJraWQiOiJmdWtDdUtTS3hwWWJjN09lZUk3Ynlya3N5a0E1bDhPb2RFSXVyOH
        JoNFlBIiwidHlwIjoidHJ1c3QtbWFyaytqd3QiLCJhbGciOiJSUzI1NiJ9.eyJ
        pc3MiOiJodHRwczovL3d3dy5hZ2lkLmdvdi5pdCIsInN1YiI6Imh0dHBzOi8vc
        nAuZXhhbXBsZS5pdC9zcGlkIiwiaWF0IjoxNTc5NjIxMTYwLCJpZCI6Imh0dHB
        zOi8vd3d3LnNwaWQuZ292Lml0L2NlcnRpZmljYXRpb24vcnAiLCJsb2dvX3Vya
        SI6Imh0dHBzOi8vd3d3LmFnaWQuZ292Lml0L3RoZW1lcy9jdXN0b20vYWdpZC9
        sb2dvLnN2ZyIsInJlZiI6Imh0dHBzOi8vZG9jcy5pdGFsaWEuaXQvZG9jcy9zc
        GlkLWNpZS1vaWRjLWRvY3MvaXQvdmVyc2lvbmUtY29ycmVudGUvIn0.AGf5Y4M
        oJt22rznH4i7Wqpb2EF2LzE6BFEkTzY1dCBMCK-8P_vj4Boz7335pUF45XXr2j
        x5_waDRgDoS5vOO-wfc0NWb4Zb_T1RCwcryrzV0z3jJICePMPM_1hZnBZjTNQd
        4EsFNvKmUo_teR2yzAZjguR2Rid30O5PO8kJtGaXDmz-rWaHbmfLhlNGJnqcp9
        Lo1bhkU_4Cjpn2bdX7RN0JyfHVY5IJXwdxUMENxZd-VtA5QYiw7kPExT53XcJO
        89ebe_ik4D0dl-vINwYhrIz2RPnqgA1OdbK7jg0vm8Tb3aemRLG7oLntHwqLO-
        gGYr6evM2_SgqwA0lQ9mB9yhw"
    }
  ],
  "metadata": {
    "openid_relying_party": {
      "application_type": "web",
      "client_registration_types": ["automatic"],
      "client_name": "https://rp.example.it/spid/",
      "contacts": [
        "ops@rp.example.it"
      ]
    }
  }
}
]]></artwork>
          </figure>

          <figure>
            <preamble>
              An example of a decoded Trust Mark payload issued to an RP,
              attesting to conformance to a national
              public service profile:
            </preamble>
	    <name>
	      Trust Mark for a National Profile
	    </name>
            <artwork><![CDATA[
{
  "id":"https://mushrooms.federation.example.com/openid_relying_party/public/",
  "iss": "https://epigeo.tm-issuer.example.it",
  "sub": "https://porcino.example.com/rp",
  "iat": 1579621160,
  "organization_name": "Porcino Mushrooms & Co.",
  "policy_uri": "https://porcino.example.com/privacy_policy",
  "tos_uri": "https://porcino.example.com/info_policy",
  "service_documentation": "https://porcino.example.com/api/v1/get/services",
  "ref": "https://porcino.example.com/documentation/manuale_operativo.pdf"
}

]]></artwork>
          </figure>

          <figure>
            <preamble>
              An example of a decoded Trust Mark payload issued to an RP,
              attesting to its conformance to the rules for
              data management of underage users:
            </preamble>
	    <name>
	      Trust Mark Issued to an RP
	    </name>
            <artwork><![CDATA[
{
  "id":"https://mushrooms.federation.example.com/openid_relying_party/private/under-age",
  "iss": "https://trustissuer.pinarolo.example.it",
  "sub": "https://vavuso.example.com/rp",
  "iat": 1579621160,
  "organization_name": "Pinarolo Suillus luteus",
  "policy_uri": "https://vavuso.example.com/policy",
  "tos_uri": "https://vavuso.example.com/tos"
}

]]></artwork>
          </figure>

          <figure>
            <preamble>
              An example of a decoded Trust Mark payload attesting a stipulation of an
              agreement between two organization's Entities:
	    </preamble>
	    <name>
	      Trust Mark Attesting to an Agreement Between Entities
	    </name>
            <artwork><![CDATA[
{
  "id": "https://mushrooms.federation.example.com/arrosto/agreements",
  "iss": "https://agaricaceae.example.it",
  "sub": "https://coppolino.example.com",
  "iat": 1579621160,
  "logo_uri": "https://coppolino.example.com/sgd-cmyk-150dpi-90mm.svg",
  "organization_type": "public",
  "id_code": "123456",
  "email": "info@coppolino.example.com",
  "organization_name#it": "Mazza di Tamburo",
  "policy_uri#it": "https://coppolino.example.com/privacy_policy",
  "tos_uri#it": "https://coppolino.example.com/info_policy",
  "service_documentation": "https://coppolino.example.com/api/v1/get/services",
  "ref": "https://agaricaceae.example.it/documentation/agaricaceae.pdf"
}
]]></artwork>
          </figure>
          <figure>
            <preamble>
              An example of a decoded Trust Mark payload asserting
              conformance to a security profile:
            </preamble>
            <name>
              Trust Mark Asserting Conformance to a Security Profile
            </name>
            <artwork><![CDATA[
{
  "id": "https://mushrooms.federation.example.com/ottimo/commestibile",
  "iss": "https://cantharellus.cibarius.example.org",
  "sub": "https://gallinaccio.example.com/op",
  "iat": 1579621160,
  "logo_uri": "https://cantharellus.cibarius/static/images/cantharellus-cibarius.svg",
  "ref": "hhttps://cantharellus.cibarius/cantharellus/cibarius"
}
]]></artwork>
          </figure>

          <figure>
            <preamble>An example of a decoded self-signed Trust Mark:</preamble>
            <name>
	      Self-Signed Trust Mark
	    </name>
            <artwork><![CDATA[
{
  "id": "https://mushrooms.federation.example.com/trust-marks/self-signed",
  "iss": "https://amanita.muscaria.example.com",
  "sub": "https://amanita.muscaria.example.com",
  "iat": 1579621160,
  "logo_uri": "https://amanita.muscaria.example.com/img/amanita-mus.svg",
  "ref": "https://amanita.muscaria.example.com/uploads/cookbook.zip"
}
]]></artwork>
          </figure>

          <figure>
            <preamble>
	      An example of a third-party accreditation authority for Trust Marks:
            </preamble>
            <name>
	      Third-Party Accreditation Authority for Trust Marks
            </name>
            <artwork><![CDATA[
{
  "iss": "https://swamid.se",
  "sub": "https://umu.se/op",
  "iat": 1577833200,
  "exp": 1609369200,
  "id": "https://refeds.org/wp-content/uploads/2016/01/Sirtfi-1.0.pdf"
}
]]></artwork>
          </figure>
        </section>
      </section>
    </section>
    <section
            title="Obtaining Federation Entity Configuration Information"
            anchor="federation_configuration">
      <t>
        The Entity Configuration of every participant SHOULD be exposed at a well-known endpoint.
        The configuration endpoint is found using the
        <xref target="RFC8615">Well-Known URIs</xref>
        specification, with the suffix
        <spanx style="verb">openid-federation</spanx>.
        The scheme, host, and port
        are taken directly from the Entity Identifier combined with the following
        path: <spanx style="verb">/.well-known/openid-federation</spanx>.
      </t>
      <t>
        If the Entity Identifier contains a path, it is concatenated after
        <spanx style="verb">/.well-known/openid-federation</spanx>
        in the same
        manner
        that path components are concatenated to the well-known identifier in
        the OAuth 2.0 Authorization Server Metadata
        <xref target="RFC8414"/>
        specification.
        Of course, in real multi-tenant deployments, in which the Entity Identifier
        might be of the form
        <spanx style="verb">https://multi-tenant-service.example.com/my-tenant-identifier</spanx>
        the tenant is very likely to not have control over the path
        <spanx style="verb">https://multi-tenant-service.example.com/.well-known/openid-federation/my-tenant-identifier</spanx>
        whereas it is very likely to have control over the path
        <spanx style="verb">https://multi-tenant-service.example.com/my-tenant-identifier/.well-known/openid-federation</spanx>.
        Therefore, if using the configuration endpoint at the URL with the
        tenant path
        after the well-known part fails,
        it is RECOMMENDED that callers retry at the URL with the tenant path
        before the well-known part
        (even though this violates <xref target="RFC8615"/>).
      </t>
      <t>
        Entities SHOULD make an Entity Configuration document
        available at the configuration endpoint.
        There is only one exception to this
        rule and that is for an RP that only does Explicit Registration.
        Since it posts the Entity Configuration to the OP during client
        registration, the OP has everything it needs from the RP.
      </t>
      <section title="Federation Entity Configuration Request">
        <t>
          An Entity Configuration document MUST be queried using an
          HTTP GET request at the previously specified path.
        </t>
        <t>
          <figure>
	    <preamble>
	      In this example, the requesting party would make the following request to the Entity
	      <spanx style="verb">https://openid.sunet.se</spanx>
	      to obtain its Entity Configuration:
	    </preamble>
            <name>
	      Request for Entity Configuration
            </name>
            <artwork><![CDATA[
  GET /.well-known/openid-federation HTTP/1.1
  Host: openid.sunet.se
]]></artwork>
          </figure>
        </t>
      </section>
      <section title="Federation Entity Configuration Response">
        <t>The response is an Entity Configuration, as described in
          <xref target="entity-statement"/>.
          If the Entity is an Intermediate Entity or a Trust Anchor, the
          response MUST contain metadata for a federation Entity
          (<spanx style="verb">federation_entity</spanx>).
        </t>
        <t>
          A successful response MUST use the HTTP status code 200
          with the content type
          <spanx style="verb">application/entity-statement+jwt</spanx>,
          to make it clear that the response contains an Entity Statement.
          In case of an error, the response
          is as defined in
          <xref target="error_response"/>.
        </t>
        <t>
          <figure>
	    <preamble>
	      The following is a non-normative example JWT Claims Set for a response from an
	      Intermediate Entity:
	    </preamble>
            <name>
	      Entity Configuration Response JWT Claims Set
            </name>
            <artwork><![CDATA[
{
  "iss": "https://openid.sunet.se",
  "sub": "https://openid.sunet.se",
  "iat": 1516239022,
  "exp": 1516298022,
  "metadata": {
    "openid_provider": {
      "issuer": "https://openid.sunet.se",
      "signed_jwks_uri": "https://openid.sunet.se/jwks.jose",
      "authorization_endpoint":
        "https://openid.sunet.se/authorization",
      "client_registration_types_supported": [
        "automatic",
        "explicit"
      ],
      "grant_types_supported": [
        "authorization_code"
      ],
      "id_token_signing_alg_values_supported": [
        "ES256", "RS256"
      ],
      "logo_uri":
        "https://www.umu.se/img/umu-logo-left-neg-SE.svg",
      "op_policy_uri":
        "https://www.umu.se/en/website/legal-information/",
      "response_types_supported": [
        "code"
      ],
      "subject_types_supported": [
        "pairwise",
        "public"
      ],
      "token_endpoint": "https://openid.sunet.se/token",
      "federation_registration_endpoint":
        "https://op.umu.se/openid/fedreg",
      "token_endpoint_auth_methods_supported": [
        "private_key_jwt"
      ]

    }
  },
  "jwks": {
    "keys": [
      {
        "alg": "RS256",
        "e": "AQAB",
        "key_ops": [
          "verify"
        ],
        "kid": "key1",
        "kty": "RSA",
        "n": "pnXBOusEANuug6ewezb9J_...",
        "use": "sig"
      }
    ]
  },
  "authority_hints": [
    "https://edugain.org/federation"
  ]
}
]]></artwork>
          </figure>
        </t>
      </section>
    </section>
    <section title="Federation Endpoints" anchor="federation_endpoints">
      <t>
        The federation endpoints of an Entity can be found in the
        configuration response as described in
        <xref target="federation_configuration"/>
        or by other means.
      </t>
      <section title="Fetching an Entity Statement" anchor="fetch_endpoint">
        <t>
          Fetching Entity Statements is performed to collect Entity Statements
          one by one to assemble Trust Chains.
          All Entities that publish Subordinate Statements
          MUST expose a fetch endpoint.
	</t>
	<t>
	  The fetch endpoint location is published in the Entity's metadata
	  for the <spanx style="verb">federation_entity</spanx> Entity Type
	  in its <spanx style="verb">federation_fetch_endpoint</spanx> parameter.
        </t>
        <t>
          To fetch an Entity Statement, an Entity needs to know the
          identifier of the Entity to ask (the issuer), the fetch
          endpoint of that Entity, and the identifier of the
          Entity, that is, the subject of the Entity Statement.
        </t>

        <section title="Fetch Entity Statement Request"
                 anchor="fetch_statement">
          <t>
            The request MUST be an HTTP request using the GET method
            to a fetch endpoint with the
            following query string parameters, encoded in
            <spanx style="verb">application/x-www-form-urlencoded</spanx> format.
	    The request is made to the fetch endpoint of the specified issuer.
          </t>
          <t>
            <list style="hanging">
              <t hangText="iss">
                <vspace/>
                REQUIRED. The Entity Identifier of the issuer
                from which the Entity Statement is issued. Because of the
                normalization of the URL, multiple issuers MAY resolve to a
                shared fetch endpoint. This parameter makes it explicit exactly
                which issuer the Entity Statement must come from.
              </t>
              <t hangText="sub">
                <vspace/>
                OPTIONAL. The Entity Identifier of the subject
                for which the Entity Statement is being requested. If this
                parameter is omitted, it is considered to be the same as the
                issuer and indicates a request for a self-signed
                Entity Configuration.
              </t>
            </list>
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of an HTTP GET request for
	      a Subordinate Statement from edugain.org about https://openid.sunet.se:
            </preamble>
            <name>
	      API Request for a Subordinate Statement
            </name>
            <artwork><![CDATA[
GET /federation_fetch_endpoint?
iss=https%3A%2F%2Fedugain%2Eorg&
sub=https%3A%2F%2Fopenid%2Esunet%2Ese HTTP/1.1
Host: edugain.org
]]></artwork>
          </figure>
        </section>

        <section title="Fetch Entity Statement Response">
          <t>
            A successful response MUST use the HTTP status code 200
            with the content type
            <spanx style="verb">application/entity-statement+jwt</spanx>,
            to make it clear that the response contains an Entity Statement.
            If it is a negative response, it will be a JSON object and the
            content type MUST be
            <spanx style="verb">application/json</spanx>.
            See more about error responses in <xref target="error_response"/>.
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of the JWT Claims Set for a fetch response:
            </preamble>
            <name>
	      Fetch Response JWT Claims Set
            </name>
            <artwork><![CDATA[
{
  "iss": "https://edugain.org/federation",
  "sub": "https://openid.sunet.se",
  "exp": 1568397247,
  "iat": 1568310847,
  "source_endpoint": "https://edugain.org/federation/federation_fetch_endpoint",
  "jwks": {
    "keys": [
      {
        "e": "AQAB",
        "kid": "dEEtRjlzY3djcENuT01wOGxrZlkxb3RIQVJlMTY0...",
        "kty": "RSA",
        "n": "x97YKqc9Cs-DNtFrQ7_vhXoH9bwkDWW6En2jJ044yH..."
      }
    ]
  },
  "metadata":{
    "federation_entity": {
        "organization_name":"SUNET"
    }
  }
  "metadata_policy": {
    "openid_provider": {
      "subject_types_supported": {
        "value": [
          "pairwise"
        ]
      },
      "token_endpoint_auth_methods_supported": {
        "default": [
          "private_key_jwt"
        ],
        "subset_of": [
          "private_key_jwt",
          "client_secret_jwt"
        ],
        "superset_of": [
          "private_key_jwt"
        ]
      }
    }
  }
}
]]></artwork>
          </figure>
        </section>
      </section>

      <section title="Resolve Entity Statement" anchor="resolve">
        <t>
          An Entity MAY use a resolve endpoint to fetch
          resolved metadata and Trust Marks for an Entity.
          The resolver fetches the subject's
          Entity Configuration, assembles a Trust Chain that starts
          with the subject's Entity Configuration and ends with the specified
          Trust Anchor's Entity Configuration, verifies the Trust Chain, and then applies all the
          policies present in the Trust Chain to the subject's
          metadata.
	</t>
	<t>
	  The resolver MUST verify that all present
          Trust Marks with identifiers recognized within
          the Federation are active.
          The response set MUST include only verified Trust Marks.
        </t>
	<t>
	  The resolve endpoint location is published in the Entity's metadata
	  for the <spanx style="verb">federation_entity</spanx> Entity Type
	  in its <spanx style="verb">federation_resolve_endpoint</spanx> parameter.
	</t>

        <section title="Resolve Request">
          <t>
            The request MUST be an HTTP request using the GET method
            to a resolve endpoint with the
            following query string parameters, encoded in
            <spanx style="verb">application/x-www-form-urlencoded</spanx> format.
          </t>
          <t>
            <list style="hanging">
              <t hangText="sub">
                <vspace/>
                REQUIRED. The Entity Identifier of the
                Entity whose resolved data is requested.
              </t>
              <t hangText="anchor">
                <vspace/>
                REQUIRED. The Trust Anchor that the resolve endpoint
                MUST use when resolving the metadata.
		The value is an Entity identifier.
              </t>
              <t hangText="type">
                <vspace/>
                OPTIONAL. A specific Entity Type to resolve.
                Its value is an Entity Type Identifier, as specified in
                <xref target="entity_types"/>.
                If this parameter is not present, then all Entity Types are returned.
              </t>
            </list>
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of a resolve request:
            </preamble>
            <name>
              Example Resolve Request
            </name>
            <artwork><![CDATA[
GET /resolve?
sub=https%3A%2F%2Fop.example.it%2Fspid&
type=openid_provider&
anchor=https%3A%2F%2Fswamid.se HTTP/1.1
Host: openid.sunet.se
]]></artwork>
          </figure>
        </section>

        <section title="Resolve Response">
          <t>
            A successful response MUST use the HTTP status code 200
            with the content type
            <spanx style="verb">application/resolve-response+jwt</spanx>,
            containing resolved metadata and
            verified Trust Marks.
          </t>
          <t>
            The response is a signed JWT, explicitly typed by setting the
            <spanx style="verb">typ</spanx> header parameter to
            <spanx style="verb">resolve-response+jwt</spanx>.
            This is done to prevent
            cross-JWT confusion (see <xref target="RFC8725"/>, section 3.11).
          </t>
          <t>
            The resolve response JWT MAY return the Trust Chain
	    from the subject to the Trust Anchor
	    in its <spanx style="verb">trust_chain</spanx> parameter,
            sorted as shown in <xref target="trust_chain"/>.
            The key used by the resolver to sign the response MUST be one of its
            Federation Entity Keys.
	  </t>
          <t>
            The resolve response MAY also return the Trust Chain
	    from its issuer to the Trust Anchor
	    in the <spanx style="verb">trust_chain</spanx> JWS header parameter,
            as specified in <xref target="trust_chain_head_param"/>.
            When this is present, the Trust Anchor in the Trust Chain
            MUST match the Trust Anchor requested in the
            related request in the <spanx style="verb">anchor</spanx> parameter.
	  </t>
	  <t>
            An issuer that provides its Trust Chain within the resolve
            response makes it evident that it is part of the same
            federation as the subject of the response. Thus,
            when the Trust Chains of both the issuer and the subject
            are available and the Federation Historical Keys endpoint is
            provided by the Trust Anchor, the resolve response becomes a long-lived
            attestation; it can be always verified, even
            when the Federation Keys change in the future.
          </t>
	  <t>
            The response SHOULD contain the
            <spanx style="verb">aud</spanx> claim only
            if the requesting client is authenticated.
          </t>

          <t>These are the resolve response Claims:</t>
          <t>
            <list style="hanging">
              <t hangText="iss">
                <vspace/>
                REQUIRED. String.
                Entity Identifier
                of the issuer of the resolve response.
              </t>
              <t hangText="sub">
                <vspace/>
                REQUIRED. String.
                Entity Identifier
                of the subject of the resolve response.
              </t>
              <t hangText="iat">
                <vspace/>
                REQUIRED. Number. Time when this resolution was issued.
                This is expressed as Seconds Since the Epoch, as defined in
                <xref target="RFC7519"/>.
              </t>
              <t hangText="exp">
                <vspace/>
                REQUIRED. Number. Time when this resolution is no longer valid.
                This is expressed as Seconds Since the Epoch, as defined in <xref target="RFC7519"/>.
                It MUST correspond to the <spanx style="verb">exp</spanx> value of
                the Trust Chain from which the resolve response was derived.
              </t>
              <t hangText="metadata">
                <vspace/>
                REQUIRED. JSON object containing the resolved subject metadata,
                according to the requested <spanx style="verb">type</spanx>
                and expressed in the <spanx style="verb">metadata</spanx> format
                defined in <xref target="entity-statement"/>.
              </t>
              <t hangText="trust_marks">
                <vspace/>
                OPTIONAL. Array of objects, each representing a Trust Mark,
                as defined in <xref target="entity-statement"/>.
              </t>
              <t hangText="trust_chain">
                <vspace/>
                OPTIONAL. Array containing the sequence of Entity Statements
                that compose
                the Trust Chain, starting with the subject and
                ending with the selected Trust Anchor,
                sorted as shown in <xref target="trust_chain"/>.
              </t>
            </list>
          </t>

          <t>
            Other claims MAY be used in conjunction with the claims outlined above.
            The claim naming recommendations outlined in Section 5.1.2 of
            <xref target="OpenID.Core">OpenID Connect Core 1.0</xref> apply.
          </t>

          <t>
            If the response is negative, the response
            is as defined in
            <xref target="error_response"/>.
          </t>

          <figure>
            <preamble>
              The following is a non-normative example of the JWT Claims Set for a resolve response:
            </preamble>
            <name>
              Resolve Response JWT Claims Set
            </name>
            <artwork><![CDATA[
{
  "iss": "https://resolver.spid.gov.it/",
  "sub": "https://op.example.it/spid/",
  "iat": 1516239022,
  "exp": 1516298022,
  "metadata": {
    "openid_provider": {
      "contacts": ["legal@example.it", "technical@example.it"],
      "logo_uri":
        "https://op.example.it/static/img/op-logo.svg",
      "op_policy_uri":
        "https://op.example.it/en/about-the-website/legal-information",
      "federation_registration_endpoint":"https://op.example.it/spid/fedreg",
      "authorization_endpoint":
        "https://op.example.it/spid/authorization",
      "token_endpoint": "https://op.example.it/spid/token",
      "response_types_supported": [
        "code",
        "code id_token",
        "token"
      ],
      "grant_types_supported": [
        "authorization_code",
        "urn:ietf:params:oauth:grant-type:jwt-bearer"
      ],
      "subject_types_supported": ["pairwise"],
      "id_token_signing_alg_values_supported": ["RS256"],
      "issuer": "https://op.example.it/spid",
      "jwks": {
        "keys": [
          {
            "kty": "RSA",
            "use": "sig",
            "n": "1Ta-sE ...",
            "e": "AQAB",
            "kid": "FANFS3YnC9tjiCaivhWLVUJ3AxwGGz_98uRFaqMEEs"
          }
        ]
      }
    }
  },
  "trust_marks": [
    {"id": "https://www.spid.gov.it/certification/op/",
     "trust_mark":
       "eyJhbGciOiJSUzI1NiIsImtpZCI6ImRGRTFjMFF4UzBFdFFrWmxNRXR3ZWxOQl"
       "eyJhbGciOiJSUzI1NiIsImtpZCI6Ijh4c3VLV2lWZndTZ0hvZjFUZTRPVWRjeT"
       "RxN2RKcktmRlJsTzV4aEhJYTAifQ.eyJpc3MiOiJodHRwczovL3d3dy5hZ2lkL"
       "mdvdi5pdCIsInN1YiI6Imh0dHBzOi8vb3AuZXhhbXBsZS5pdC9zcGlkLyIsIml"
       "hdCI6MTU3OTYyMTE2MCwiaWQiOiJodHRwczovL3d3dy5zcGlkLmdvdi5pdC9jZ"
       "XJ0aWZpY2F0aW9uL29wLyIsImxvZ29fdXJpIjoiaHR0cHM6Ly93d3cuYWdpZC5"
       "nb3YuaXQvdGhlbWVzL2N1c3RvbS9hZ2lkL2xvZ28uc3ZnIiwicmVmIjoiaHR0c"
       "HM6Ly9kb2NzLml0YWxpYS5pdC9pdGFsaWEvc3BpZC9zcGlkLXJlZ29sZS10ZWN"
       "uaWNoZS1vaWRjL2l0L3N0YWJpbGUvaW5kZXguaHRtbCJ9"
    }
  ],
  "trust_chain" : [
    "eyJhbGciOiJSUzI1NiIsImtpZCI6Ims1NEhRdERpYnlHY3M5WldWTWZ2aUhm ...",
    "eyJhbGciOiJSUzI1NiIsImtpZCI6IkJYdmZybG5oQU11SFIwN2FqVW1BY0JS ...",
    "eyJhbGciOiJSUzI1NiIsImtpZCI6IkJYdmZybG5oQU11SFIwN2FqVW1BY0JS ..."
  ]
}
]]></artwork>
          </figure>
        </section>

        <section title="Trust Considerations">
          <t>
            The basic assumption of this specification is that an Entity
            should have direct trust in noone except the Trust Anchor
            and its own capabilities.
            However, Entities may establish a kind of
            transistive trust in other Entities. For example, the
            Trust Anchor states who its Subordinates are
            and Entities may choose to trust them.
            If a party uses the resolve service of another Entity
            to obtain federation data, it is trusting
            the resolver to perform validation of the cryptographically
            protected metadata correctly and to provide it with authentic results.
          </t>
        </section>
      </section>

      <section title="Subordinate Listings" anchor="entity_listing">
        <t>
	  The listing endpoint is exposed by Federation Entities
	  acting as a Trust Anchor, Intermediate, or Trust Mark issuer.
	  The endpoint lists the Subordinates about which
          the Trust Anchor or Intermediate issues Entity Statements.
        </t>
        <t>
	  As a Trust Mark issuer,
          the endpoint MAY list the Subordinates for which Trust Marks
          have been issued and are still valid, if the issuer
          exposing this endpoint supports Trust Mark filtering, as
          defined below.
        </t>
        <t>
          In both cases, the list contained in the result
          MAY be a very large list.
        </t>
	<t>
	  The list endpoint location is published in the Entity's metadata
	  for the <spanx style="verb">federation_entity</spanx> Entity Type
	  in its <spanx style="verb">federation_list_endpoint</spanx> parameter.
	</t>

        <t>
	  <figure>
	    <preamble>
	      The following example shows a tree of Entities belonging to the
          same federation including the Trust Anchor, Intermediate Entities,
          and Leaf Entities, discovered and collected through the Subordinate
          listing endpoints:
	    </preamble>
            <name>
	      Tree of Entities in a Federation Collected through
          Subordinate Listing Endpoints
            </name>
            <artwork><![CDATA[
                       +----------------------+
                       |    Trust Anchor      |
                       +----------------------+
       +---------------+ Subordinate  listing +--------------+
       |               +----------+-----------+              |
       |                          |                          |
       |                          |                          |
       |                          |                          |
       |                          |                          |
       |                          |                          |
+------v-------+       +----------v-----------+       +------v-------+
|     Leaf     |       |     Intermediate     |       |     Leaf     |
+--------------+       +----------------------+       +--------------+
                  +----+ Subordinate  listing |
                  |    +------------+---------+
                  |                 |
                  |                 |
                  |                 |
       +----------v-----------+     |
       |     Intermediate     |     |
       +----------------------+     |
       | Subordinate  listing |     |
       +-+---------+----------+     |
         |         |                |
         |         |                |
 +-------v--+     +v--------+    +--v------+
 |  Leaf    |     |  Leaf   |    |  Leaf   |
 +----------+     +---------+    +---------+
]]></artwork>
          </figure>

        </t>

        <section title="Subordinate Listing Request">
          <t>
            The request MUST be an HTTP request using the GET method
            to a list endpoint with the
            following query parameters, encoded in
            <spanx style="verb">application/x-www-form-urlencoded</spanx> format.
          </t>
          <t>
            <list style="hanging">
              <t hangText="entity_type">
                <vspace/>
                OPTIONAL. If the responder knows the
                Entity Type of all its Subordinates,
                the result MUST be filtered accordingly.
                If the responder does not support this feature it MUST
                use the HTTP status code 400 and the content type
                <spanx style="verb">application/json</spanx>, with
                the error code
                <spanx style="verb">unsupported_parameter</spanx>.
              </t>
              <t hangText="trust_marked">
				<vspace/>
                OPTIONAL. Boolean.

                If the parameter
                <spanx style="verb">trust_marked</spanx> is present and
                set to <spanx style="verb">true</spanx>,
                the result contains only the Subordinates for which
                at least one Trust Mark have been issued and is still valid.

                If the responder does not support this feature it MUST
                use the HTTP status code 400 and set the content type to
                <spanx style="verb">application/json</spanx>, with
                the error code
                <spanx style="verb">unsupported_parameter</spanx>.
			  </t>
              <t hangText="trust_mark_id">
                <vspace/>
                OPTIONAL. If the responder has issued Trust Marks with the
                specified Trust Mark identifier,
                the list in the response MUST be filtered to only
                the Subordinates for which that Trust Mark identifier has been
                issued and is still valid.
                If the responder does not support this feature it MUST
                use the HTTP status code 400 and set the content type to
                <spanx style="verb">application/json</spanx>, with
                the error code
                <spanx style="verb">unsupported_parameter</spanx>.
              </t>
              <t hangText="intermediate">
                <vspace/>
                OPTIONAL. Boolean. If the parameter
                <spanx style="verb">intermediate</spanx> is present and set to
                <spanx style="verb">true</spanx>, then if the responder knows
                whether its Subordinates are Intermediates or not,
                the result MUST be filtered accordingly.
                If the responder does not support this feature it MUST
                use the HTTP status code 400 and the content type
                <spanx style="verb">application/json</spanx>, with
                the error code
                <spanx style="verb">unsupported_parameter</spanx>.
              </t>
            </list>
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of an HTTP GET
              request for a list of Subordinates:
            </preamble>
            <name>
              Subordinate Listing Request
            </name>
            <artwork><![CDATA[
GET /list HTTP/1.1
Host: openid.sunet.se
]]></artwork>
          </figure>
        </section>

        <section title="Subordinate Listing Response">
          <t>
            A successful response MUST use the HTTP status code 200
            with the content type <spanx style="verb">application/json</spanx>,
            containing a JSON array with the known Entity Identifiers.
          </t>

          <t>
            If the response is negative, the response
            is as defined in
            <xref target="error_response"/>.
          </t>

          <figure>
            <preamble>
              The following is a non-normative example of a response containing
              the Subordinate Entities:
            </preamble>
            <name>
              Subordinate Listing Response
            </name>
            <artwork><![CDATA[
200 OK
Content-Type: application/json

[
  "https://ntnu.andreas.labs.uninett.no/",
  "https://blackboard.ntnu.no/openid/callback",
  "https://serviceprovider.andreas.labs.uninett.no/application17"
]
]]></artwork>
          </figure>
        </section>
      </section>

      <section title="Trust Mark Status" anchor="status_endpoint">
        <t>
          This enables an Entity to check whether a Trust Mark is still
          active or not. The query MUST be sent to the Trust Mark issuer.
        </t>
	<t>
	  The Trust Mark status endpoint location is published in the Entity's metadata
	  for the <spanx style="verb">federation_entity</spanx> Entity Type
	  in its <spanx style="verb">federation_trust_mark_status_endpoint</spanx> parameter.
	</t>

        <section title="Trust Mark Status Request">
          <t>
            The request MUST be an HTTP request using the POST method and
            the <spanx style="verb">https</spanx> scheme to a Trust Mark status endpoint with the
            following parameters, encoded in
            <spanx style="verb">application/x-www-form-urlencoded</spanx> format.
          </t>
          <t>
            <list style="hanging">
              <t hangText="sub">
                <vspace/>
                OPTIONAL. The Entity Identifier of the Entity to which the Trust Mark
                was issued.
              </t>
              <t hangText="trust_mark_id">
                <vspace/>
                OPTIONAL. Identifier of the Trust Mark.
              </t>
              <t hangText="iat">
                <vspace/>
                OPTIONAL. Number. Time when the Trust Mark was issued. If
                <spanx style="verb">iat</spanx> is not specified and the
                Trust Mark issuer has issued several Trust Marks with the
                identifier specified in the request to the
                Entity identified by <spanx style="verb">sub</spanx>, the
                most recent one is assumed.
              </t>
              <t hangText="trust_mark">
                <vspace/>
                OPTIONAL. The whole Trust Mark.
              </t>
            </list>
          </t>
          <t>
            If <spanx style="verb">trust_mark</spanx> is used, then
            <spanx style="verb">sub</spanx> and <spanx style="verb">trust_mark_id</spanx>
            are not needed. If <spanx style="verb">trust_mark</spanx> is not used,
            then <spanx style="verb">sub</spanx> and <spanx style="verb">trust_mark_id</spanx>
            are REQUIRED.
          </t>
          <t>
            <figure>
              <preamble>
                The following is a non-normative example of a Trust Mark status request using
                <spanx style="verb">sub</spanx> and <spanx style="verb">trust_mark_id</spanx>:
              </preamble>
	      <name>
		Trust Mark Status Request
	      </name>
              <artwork><![CDATA[
POST /federation_trust_mark_status_endpoint HTTP/1.1
Host: op.example.org
Content-Type: application/x-www-form-urlencoded

sub=https%3A%2F%2Fopenid.sunet.se%2FRP
&trust_mark_id=https%3A%2F%2Frefeds.org%2Fsirtfi
]]></artwork>
            </figure>

          </t>
        </section>
        <section title="Trust Mark Status Response">
          <t>
            A successful response MUST use the HTTP status code 200
            with the content type
            <spanx style="verb">application/json</spanx>,
            to make it clear that the response contains a JSON
            object containing the data below:
          </t>

          <t>
            <list style="hanging">
              <t hangText="active">
                <vspace/>
                REQUIRED. Boolean. Whether the Trust Mark is active or not.
              </t>
            </list>
          </t>

          <t>
            If the response is negative, the response
            is as defined in
            <xref target="error_response"/>.
          </t>

          <t>
            <figure>
              <preamble>
                The following is a non-normative example of a Trust Mark status response:
              </preamble>
	      <name>
		Trust Mark Status Response
	      </name>
              <artwork><![CDATA[
200 OK
Content-Type: application/json

{
  "active": true
}
]]></artwork>
            </figure>
          </t>
        </section>
      </section>

     <section title="Trust Marked Entities Listing" anchor="tm_listing">
        <t>
		  The Trust Marked Entities listing endpoint is exposed by
          Trust Mark issuers
          and lists all the Entities for which Trust Marks
          have been issued and are still valid.
        </t>
	<t>
	  The Trust Marked Entities listing endpoint location is published in the Entity's metadata
	  for the <spanx style="verb">federation_entity</spanx> Entity Type
	  in its <spanx style="verb">federation_trust_mark_list_endpoint</spanx> parameter.
	</t>

        <section title="Trust Marked Entities Listing Request">
          <t>
            The request MUST be an HTTP request using the GET method
            to a list endpoint with the
            following query parameters, encoded in
            <spanx style="verb">application/x-www-form-urlencoded</spanx> format.
          </t>
          <t>
            <list style="hanging">
              <t hangText="trust_mark_id">
                <vspace/>
                REQUIRED. If the responder has issued Trust Marks with the
                specified Trust Mark identifier,
                the list obtained in the response MUST be filtered to only
                the Entities for which that Trust Mark identifier has been
                issued and is still valid.
              </t>
              <t hangText="sub">
                <vspace/>
                OPTIONAL. The Entity Identifier of the Entity to which the Trust Mark
                was issued. The list obtained in the response MUST be filtered to only
                the Entity matching this value.
              </t>              
            </list>
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of an HTTP GET
              request for a list of Trust Marked Entities:
            </preamble>
            <name>
              Trust Marked Entities Listing Request
            </name>
            <artwork><![CDATA[
GET /trust_marked_list?trust_mark_id=https%3A%2F%2Ffederation.example.org%2Fopenid_relying_party%2Fprivate%2Funder-age HTTP/1.1
Host: trust-mark-issuer.example.org
]]></artwork>
          </figure>
        </section>

        <section title="Trust Marked Entities Listing Response">
          <t>
            A successful response MUST use the HTTP status code 200
            with the content type <spanx style="verb">application/json</spanx>,
            containing a JSON array with Entity Identifiers.
          </t>

          <t>
            If the response is negative, the response
            is as defined in
            <xref target="error_response"/>.
          </t>

          <figure>
            <preamble>
              The following is a non-normative example of a response, containing
              the Trust Marked Entities:
            </preamble>
            <name>
              Trust Marked Entities Listing Response
            </name>
            <artwork><![CDATA[
200 OK
Content-Type: application/json

[
  "https://blackboard.ntnu.no/openid/rp",
  "https://that-rp.example.org"
]
]]></artwork>
          </figure>
        </section>
      </section>

     <section title="Trust Mark Endpoint" anchor="tm_endpoint">
        <t>
		  The Trust Mark endpoint is protected endpoint 
          exposed by
          Trust Mark issuers
          to provide the Trust Marks to their owners.
        </t>
	<t>
	  The Trust Mark endpoint is published in the 
      <spanx style="verb">federation_entity</spanx> metadata
	  using the 
	  <spanx style="verb">federation_trust_mark_endpoint</spanx> claim.
	</t>

        <section title="Trust Mark Request">
          <t>
            The HTTP request MUST use the POST method with the
            following query parameters, encoded in
            <spanx style="verb">application/x-www-form-urlencoded</spanx> 
            format.
          </t>
          <t>
            <list style="hanging">
              <t hangText="trust_mark_id">
                <vspace/>
                REQUIRED. Trust Mark identifier.
              </t>
              <t hangText="client_assertion">
                <vspace/>
                REQUIRED. Signed JWT using the private key of the 
                subject's Federation Entity Key. 
                The payload of the signed JWT MUST contain the 
                following parameters:
                <list>
                    <t hangText="iss">
                        <vspace/>
                        REQUIRED. The Entity Identifier of the subject.
                    </t>
                    <t hangText="sub">
                        <vspace/>
                        REQUIRED. This MUST the same as iss.
                    </t>
                    <t hangText="aud">
                        <vspace/>
                        REQUIRED. URL of the federation Trust Mark endpoint.
                    </t>
                    <t hangText="iat">
                        <vspace/>
                        REQUIRED. The time the statement was issued.
              Its value is a JSON number representing the number of seconds from
              1970-01-01T0:0:0Z as measured in UTC until the date/time.
              See <xref target="RFC3339"/> for
              details regarding date/times in general and UTC in particular.
                    </t>
                    <t hangText="exp">
                        <vspace/>
                        Expiration time on or after which the JWT MUST NOT be
              accepted for processing. Its value is a JSON number representing
              the number of seconds from 1970-01-01T0:0:0Z as measured in UTC
              until the date/time.
                    </t>
                </list>
              </t>
              <t hangText="client_assertion_type">
                <vspace/>
                REQUIRED. It MUST be set to 
                <spanx style="verb">urn:ietf:params:oauth:client-assertion-type:jwt-bearer</spanx>.
              </t>
            </list>
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of an HTTP
              request for a specific Trust Mark ID and a specific Entity:
            </preamble>
            <name>
              Trust Mark Request
            </name>
            <artwork><![CDATA[
POST /trust_mark HTTP/1.1
Host: tuber.cert.example.org
Content-Type: application/x-www-form-urlencoded

trust_mark_id=https%3A%2F%2Ftuber.cert.example.org%2Fnero%2Fpregiato%2Fnorcia&
client_assertion=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiw
ibmFtZSI6IlNQSUQiLCJhZG1pbiI6dHJ1ZX0.LVyRDPVJm0S9q7oiXcYVIIqGWY0wWQlqxvFGYswL…&
client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwtbearer

]]></artwork>
          </figure>
        </section>

        <section title="Trust Mark Response">
          <t>
            A successful response MUST use the HTTP status code 200
            with the content type 
            <spanx style="verb">application/trust-mark+jwt</spanx>,
            containing the Trust Mark.
          </t>

          <t>
            If the specified Entity doesn't have 
            the specified Trust Mark, the
            response is negative and
            MUST use the HTTP status code 404.
          </t>

          <figure>
            <preamble>
              The following is a non-normative example of a response, containing
              the Trust Mark for the specified Entity
	      (with line wraps within values for display purposes only):
            </preamble>
            <name>
              Trust Mark Response
            </name>
            <artwork><![CDATA[
200 OK

eyJhbGciOiJSUzI1NiIsImtpZCI6Im1VRXR0aW5SNTNpLW9Bc1JoN2l6blY1R1hlaFh3QzZ1
aTRScG1QeUt5ZDgifQ.eyJpc3MiOiJodHRwczovL3R1YmVyLmNlcnQuZXhhbXBsZS5vcmciL
CJzdWIiOiJodHRwczovL3RhcnR1Zm8uZXhhbXBsZS5pdCIsImlhdCI6MTU3OTYyMTE2MCwiZ
XhwIjoxNTc5NzIxMTYwLCJpZCI6Imh0dHBzOi8vdHViZXIuY2VydC5leGFtcGxlLm9yZy9uZ
XJvL3ByZWdpYXRvL25vcmNpYSJ9.HwzNAJVPDYC9AM-ILWfgmT5YDz-pjtklQhtEQbqhC7P0
nv88W8Wx74oE5IR5WgJP9Q3xPD-UO7o6O_Z0PMR186TzcBnaXtogn6-QxHRomCPwytviVGyk
XE1MkOnf9wTYWb5q13A53w8y0vUTlwZhBHt9qYNp3t4XwjR8eEZTptHeI_NHkaOsknT3cI16
FbxqXVdTudQCfPJEYKGGL1QDg2EdVGFgjq4V-2UTKlBQvnorNUmfNOxgRT0DR37ZezluvGJ5
NjK15h2rrJRN4e_8favIJNTNO8fhK7bjyUFJlVGYmLUpfCuJmxBv-EMhiAkeoDtk71Tc6ou6
2rxqFCU3LQ
]]></artwork>
          </figure>
        </section>
      </section>

      <section anchor="historical_keys" title="Federation Historical Keys Endpoint">
        <t>
          Each Federation Entity MAY publish its previously used
	  Federation Entity Keys at the historical keys endpoint
	  defined in <xref target="federation_entity"/>.
          The purpose of this endpoint is to provide
          the list of keys previously used by the Federation Entity
          to provide non-repudiation of statements signed by
          it after key rotation. This endpoint also discloses the
          reason for the retraction of the keys and whether they were
          expired or revoked, including the reason for the revocation.
        </t>
        <t>
          Note that an expired key can be later additionally marked as
          revoked, to indicate a key compromise event discovered
          after the expiration of the key.
        </t>
        <t>
          The publishing of the historical keys guarantees that Trust Chains
          will remain verifiable and usable as inputs to trust decisions
          after the key expiration, unless the key becomes revoked
          for a security reason.
        </t>

        <section title="Federation Historical Keys Request">
          <t>
            The request MUST be an HTTP request using the GET method to
	    the federation historical keys endpoint.
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of a
              historical keys request:
            </preamble>
            <name>
              Federation Historical Keys Request
            </name>
            <artwork><![CDATA[
GET /federation_historical_keys HTTP/1.1
Host: trust-anchor.example.com
]]></artwork>
          </figure>
        </section>

        <section anchor="HistKeysResp" title="Federation Historical Keys Response">
          <t>
            A successful response MUST use the HTTP status code 200
            with the content type
            <spanx style="verb">application/jwk-set+jwt</spanx>.
            The response is a signed JWT with the <xref target="RFC7517">JWK Set</xref>
            as its payload. The JWT is explicitly typed by setting the
            <spanx style="verb">typ</spanx> header parameter to
            <spanx style="verb">jwk-set+jwt</spanx>. This is done to prevent
            cross-JWT confusion (see <xref target="RFC8725"/>, section 3.11).
            The response JWT contains the following claims:
          </t>

          <t>
            <list style="hanging">
              <t hangText="iss">
                <vspace/>
                REQUIRED. String.
                The Entity's Entity Identifier.
              </t>
              <t hangText="iat">
                <vspace/>
                REQUIRED. Number. Time when the signed JWT was issued,
                using the time format defined for the
                <spanx style="verb">iat</spanx> claim in
                <xref target="RFC7519"/>.
              </t>
              <t hangText="keys">
                <vspace/>
                REQUIRED. Array of JSON objects
                containing the signing keys for the Entity in JWK format.

                <t>
                  Every JWK in the <spanx style="verb">keys</spanx>
                  claim includes the following claims:
                </t>

                <t>
                  <list style="hanging">
                    <t hangText="kid">
                      <vspace/>
                      REQUIRED. Parameter used to match a specific key.
                      It is RECOMMENDED that the Key ID be the
                      JWK Thumbprint <xref target="RFC7638"/> of the key
		      using the SHA-256 hash function.
                    </t>
                    <t hangText="iat">
                      <vspace/>
                      OPTIONAL. Time when the key was issued,
                      using the time format defined for the
                      <spanx style="verb">iat</spanx> claim in
                      <xref target="RFC7519"/>.
                    </t>
                    <t hangText="exp">
                      <vspace/>
                      REQUIRED. Expiration time,
                      using the time format defined for the
                      <spanx style="verb">exp</spanx> claim in
                      <xref target="RFC7519"/>,
                      after which the key MUST NOT be considered to be valid.
                    </t>
                    <t hangText="revoked">
                      <vspace/>
                      OPTIONAL. JSON object that contains the
                      properties of the revocation, as defined below:
                      <t>
                      <list style="hanging">
                        <t hangText="revoked_at">
                          <vspace/>
                          REQUIRED. Time when the key was revoked
                          or must be considered revoked,
                          using the time format defined for the
                          <spanx style="verb">iat</spanx> claim in
                      <xref target="RFC7519"/>.
                        </t>

                        <t hangText="reason">
                          <vspace/>
                          REQUIRED. Human-readable value
                          that identifies the reason
                          for the key revocation, as defined in
                          Section 5.3.1 of <xref target="RFC5280"/>.
                        </t>

                        <t hangText="reason_code">
                          <vspace/>
                          REQUIRED. Integer that identifies the reason
                          for the key revocation, as defined in
                          Section 5.3.1 of <xref target="RFC5280"/>.
                        </t>

                      </list>
		      Other members of the <spanx style="verb">revoked</spanx>
		      object MAY be defined and used.
                      </t>

                    </t>
                  </list>
                </t>

              </t>
            </list>
          </t>

          <figure>
            <preamble>
              The following is a non-normative example of the JWT Claims Set for a historical keys response:
            </preamble>
	    <name>
              Federation Historical Keys Response JWT Claims Set
            </name>
            <artwork><![CDATA[
{
    "iss": "https://trust-anchor.federation.example.com",
    "iat": 123972394272,
    "keys":
        [
            {
                "kty":"RSA",
                "n":"5s4qi …",
                "e":"AQAB",
                "kid":"2HnoFS3YnC9tjiCaivhWLVUJ3AxwGGz_98uRFaqMEEs",
                "iat": 123972394872,
                "exp": 123974395972
            },
            {
                "kty":"RSA",
                "n":"ng5jr …",
                "e":"AQAB",
                "kid":"8KnoFS3YnC9tjiCaivhWLVUJ3AxwGGz_98uRFaqMJJr",
                "iat": 123972394872,
                "exp": 123974394972
                "revoked": {
                  "revoked_at": 123972495172,
                  "reason": "keyCompromise",
                  "reason_code": 1
                }
            }
        ]
}
]]></artwork>
          </figure>

        </section>

        <section  title="Rationale for the Federation Historical Keys Endpoint">
          <!--
            introduce the problem
          -->
          <t>
            The Federation Historical Keys endpoint
            solves the problem of verifying historical
            Trust Chains when the Federation Entity Keys
            have changed, either due to expiration or revocation.
          </t>

          <!--
            describe the concept
          -->
          <t>
            The Federation Historical Keys endpoint
            publishes the list of public keys used in the past by the Entity.
            These keys are needed
            to verify Trust Chains created in the past with
            Entity keys no longer published in the Entity's
            Entity Configuration.
          </t>

          <!--
            give the technical details.
          -->
          <t>
            The Federation Historical Keys endpoint response contains a signed JWT
            that attests to all the expired and revoked Entity keys.
          </t>

          <!--
            more technical details.
          -->
          <t>
            On the basis of the attributes contained in the Entity Statements
            that form a Trust Chain, it MAY be also possible to verify
            the non-federation public keys used in the past by Leaf Entities for
            signature operations for OpenID Connect
            requests and responses.
            For example, an Entity Statement issued for a Leaf
            MAY also include the
            <spanx style="verb">jwks</spanx> claim for the Leaf's Entity Types,
	    in its
            <spanx style="verb">metadata</spanx> or
            <spanx style="verb">metadata_policy</spanx> claims.
	  </t>
            <t>
              A simple example: In the following Trust Chain, the
              Federation Intermediate attests to the Leaf's OpenID Connect RP
	      <spanx style="verb">jwks</spanx>
              in the Subordinate Statement issued about the Leaf. The result is
              a Trust Chain that contains the Leaf's OpenID Connect RP JWK Set,
              needed to verify historical signature on
              Request Objects and any other signed JWT issued by the Leaf as an RP.
	      This example Trust Chain contains:
              <list style="numbers">
                <t>
                  an Entity Configuration about the RP published by the RP,
                </t>
                <t>
                  a Subordinate Statement about the RP published by Organization A,
                  with the claim <spanx style="verb">jwks</spanx> contained in
                  <spanx style="verb">metadata</spanx> or
                  <spanx style="verb">metadata_policy</spanx> attesting the
                  Leaf's OpenID Connect RP <spanx style="verb">jwks</spanx>, and
                </t>
                <t>
                  a Subordinate Statement about Organization A published by Federation F.
                </t>
              </list>
            </t>
        </section>

      </section>

      <section title="Generic Error Response" anchor="error_response">
        <t>
          If the request was malformed or an error occurred during
          the processing of the request,
          the response body SHOULD be a JSON object with the content type
          <spanx style="verb">application/json</spanx>.
        </t>

        <t>
          In compliance with
          <xref target="RFC6749"/>, the following
          standardized error format SHOULD be used:
        </t>

        <t>
          <list style="hanging">
            <t hangText="error">
              <vspace/>
              REQUIRED. One of the following error codes SHOULD be used.

              <list style="hanging">
                <t hangText="invalid_request">
                  <vspace/>
                  The request is incomplete or does
                  not comply with current specifications.
                  The HTTP response status code SHOULD be 400 (Bad Request).
                </t>
                <t hangText="invalid_client">
                  <vspace/>
                  The Client can not be authorized or is not
                  a valid participant of the federation.
                  The HTTP response status code SHOULD be 401 (Unauthorized).
                </t>
                <t hangText="not_found">
                  <vspace/>
                  The requested Entity Identifier is "not found".
                  The HTTP response status code SHOULD be 404 (Not Found).
                </t>
                <t hangText="server_error">
                  <vspace/>
                  The server encountered an unexpected
                  condition that prevented it from fulfilling the request.
                  The HTTP response status code SHOULD be one in the 5xx range,
                  like 500 (Internal Server Error).
                </t>
                <t hangText="temporarily_unavailable">
                  <vspace/>
                  The server hosting the federation endpoint
                  is currently unable to handle
                  the request due to a temporary overloading or maintenance.
                  The HTTP response status code SHOULD be 503 (Service Unavailable).
                </t>
                <t hangText="unsupported_parameter">
                  <vspace/>
                  The server does not support the requested parameter.
                </t>
              </list>

	      Other error codes in the IANA "OAuth Extensions Error Registry"
	      <xref target="IANA.OAuth.Parameters"/> MAY also be used.
            </t>

            <t hangText="error_description">
              <vspace/>
              REQUIRED. A human-readable short text describing the error.
            </t>
          </list>
        </t>

        <figure>
          <preamble>
            The following is a non-normative example of an error response:
          </preamble>
          <name>
            Example Error Response
          </name>
          <artwork><![CDATA[
400 Bad request
Content-Type: application/json

{
  "error": "invalid_request",
  "error_description":
    "Required request parameter [sub] was missing."
}
]]></artwork>
        </figure>
      </section>
    </section>

    <section anchor="resolving_trust"
             title="Resolving the Trust Chain and Metadata">
      <t>
        An Entity (Party A) that wants to establish trust with
        another Entity (Party B) MUST have Party B's Entity Identifier and a list of
        Entity Identifiers of Trust Anchors and their public signing keys.
        Party A will first have to fetch
        sufficient Entity Statements to establish at least one chain of trust
        from Party B to one or more of the Trust Anchors.
        After that, Party A MUST validate the Trust Chains independently,
        and if there are multiple valid Trust Chains and if the
        application demands it, choose one to use.
      </t>

      <section anchor="fetching-es"
               title="Fetching Entity Statements to Establish a Trust Chain">
        <t>
          Depending on the circumstances, Party A MAY be
          handed Party B's Entity Configuration, or it may
          have to fetch it by itself. If it needs to fetch it, it will use the
          process described in <xref target="federation_configuration"/>
          based on the Entity Identifier of Party B.
        </t>
        <t>
          The next step is to iterate through the list of
          Intermediates listed in
          <spanx style="verb">authority_hints</spanx>, ignoring the authority
          hints that end in an unknown Trust Anchor,
          requesting an Entity Configuration from each of the Intermediates.
          If the received Entity Configuration contains an authority hint, this
          process is repeated.
        </t>
        <t>
          With the list of all Intermediates and the Trust Anchor, the respective
          fetch endpoints, as defined in <xref target="fetch_endpoint"/>, are used to fetch
          Entity Statements about the Intermediates and Party B.
        </t>
        <t>
          Note: Federation participants SHOULD NOT attempt to fetch
          Entity Statements they already have obtained during this
          process to prevent loops.
        </t>
        <t>
          A successful operation will return one or more lists of
          Entity Statements. Each of the lists terminating in a self-signed
          Entity Statement is issued by a Trust Anchor.
        </t>
        <t>
          If there is no path from Party B to at least one of the
          trusted Trust Anchors, then the list will be empty and there is no
          way of establishing trust in Party B's information.
          How Party A deals with this is out of scope for this specification.
        </t>

      <figure>
        <preamble>
	  The following sequence diagram represents the interactions between the RP,
	  the OP, and the Trust Anchor during a trust evaluation made by the OP
	  about the RP.
	  Relating this to the the preceeding description, in this diagram,
	  Party A is the OP and Party B is the RP.
        </preamble>
	<name>
          Resolving Trust Chain and Metadata from the Perspective of an OP
	</name>
        <artwork><![CDATA[
+-----+                         +-----+                             +--------------+
| RP  |                         | OP  |                             | Trust Anchor |
+-----+                         +-----+                             +--------------+
   |                               |                                        |
   | Entity Configuration Request  |                                        |
   |<------------------------------|                                        |
   |                               |                                        |
   | Entity Configuration Response |                                        |
   |------------------------------>|                                        |
   |                               |                                        |
   |                               | Evaluates authority_hints              |
   |                               |--------------------------              |
   |                               |                         |              |
   |                               |<-------------------------              |
   |                               |                                        |
   |                               | Entity Configuration Request           |
   |                               |--------------------------------------->|
   |                               |                                        |
   |                               |        Entity Configuration Response   |
   |                               |<---------------------------------------|
   |                               |                                        |
   |                               | Obtains Fetch endpoint                 |
   |                               |-----------------------                 |
   |                               |                      |                 |
   |                               |<----------------------                 |
   |                               |                                        |
   |                               | Request Subordinate Statement about RP |
   |                               |--------------------------------------->|
   |                               |                                        |
   |                               |        Subordinate Statement about RP  |
   |                               |<---------------------------------------|
   |                               |                                        |
   |                               | Evaluates the Trust Chain              |
   |                               |--------------------------              |
   |                               |                         |              |
   |                               |<-------------------------              |
   |                               |                                        |
   |                               | Applies Metadata Policies              |
   |                               |--------------------------              |
   |                               |                         |              |
   |                               |<-------------------------              |
   |                               |                                        |
   |                               | Derives the RP's final Metadata        |
   |                               |----------------------------------      |
   |                               |                                 |      |
   |                               |<---------------------------------      |
]]></artwork>
	</figure>
      </section>

      <section title="Validating a Trust Chain" anchor="trust_chain_validation">
        <t>
          As described in <xref target="trust_chain"/>,
          a Trust Chain consists of an ordered list of Entity Statements.
          So whichever way Party A has acquired the set of
          Entity Statements, it MUST now verify that it is a proper Trust Chain
          using the rules laid out in that section.
        </t>
        <t>
	  Let us refer to the Entity Statements in the Trust Chain as
	  ES[j], where j = 0,...,i,
	  with 0 being the index of the first Entity Statement
	  and i being the zero-based index of the last.
	  To validate the Trust Chain, the following MUST be done:
        </t>
        <t>
          <list style="symbols">
            <t>
              For each Entity Statement ES[j], where j = 0,..,i:
              <list style="symbols">
                <t>
                  Verify that the statement contains all the required claims.
                </t>
                <t>
                  Verify that <spanx style="verb">iat</spanx> has a value in the
                  past.
                </t>
                <t>
                  Verify that <spanx style="verb">exp</spanx> has a value that
                  is in the future.
                </t>
              </list>
            </t>
            <t>
              For ES[0] (the Leaf's Entity Configuration), verify that
	      <spanx style="verb">iss</spanx> == <spanx style="verb">sub</spanx>.
            </t>
            <t>
              For ES[0], verify that its signature validates with a public key
	      in ES[0]["jwks"].
            </t>
            <t>
              For each j = 0,...,i-1, verify that ES[j]["iss"] == ES[j+1]["sub"].
            </t>
            <t>
              For each j = 0,...,i-1, verify the signature of ES[j] with a public
              key in ES[j+1]["jwks"].
            </t>
            <t>
              For ES[i] (the Trust Anchor's Entity Configuration), verify that
	      the issuer matches the Entity Identifier of the Trust Anchor.
	    </t>
	    <t>
	      For ES[i], verify that
	      its signature validates with a public key of the Trust Anchor.
            </t>
          </list>
        </t>
        <t>
          Verifying the signature is a much more expensive
          operation than verifying the correctness of the statement and the
          timestamps. An implementer MAY therefore choose not to verify the
          signatures until all the other checks have been done.
        </t>
        <t>
	  Federation participants MAY cache Entity Statements and signature verification
          results until they expire, per
          <xref target="trust_lifetime"/>.
        </t>
      </section>

      <section title="Choosing One of the Valid Trust Chains">
        <t>
          If multiple valid Trust Chains are found, Party A will
          need to decide on which one to use.
	  One simple rule would be to prefer a shorter chain over a longer one.
	  Federation participants MAY follow other rules according to local policy.
	</t>
      </section>

      <section anchor="trust_lifetime"
               title="Calculating the Expiration Time of a Trust Chain">
        <t>
          Each Entity Statement in a Trust Chain is signed and MUST have an
          expiration time (<spanx style="verb">exp</spanx>).
          The expiration time of the whole Trust Chain is the minimum
          (<spanx style="verb">exp</spanx>) value within the Trust Chain.
        </t>
      </section>

      <section title="Transient Trust Chain Validation Errors"
               anchor="transient_trust_chain_validation_errors">
        <t>
          If the federation topology is being updated, for example when a set
          of Leaf Entities is moved to a new Intermediate Entity, the Trust Chain
          validation may fail in a transient manner. Retrying after a period of
          time may resolve the situation.
        </t>
      </section>
    </section>

    <section title="Updating Metadata, Key Rollover, and Revocation">
      <t>
        This specification facilitates smoothly updating metadata
        and public keys.
      </t>
      <t>
        As described in <xref target="trust_lifetime"/>,
        each Trust Chain has an expiration time.
        Federation participants MUST support
        refreshing a Trust Chain when it expires.
        How often a participant reevaluates the Trust Chain depends on
        how quickly it wants to find out that something has changed.
      </t>

      <section title="Protocol Key Rollover">
        <t>
          If a Leaf Entity publishes its public keys in its metadata
          using <spanx style="verb">jwks</spanx>, the expiration time of
          its Entity Configuration
	  can be used to control how often the receiving Entity
          needs to fetch an updated set of public keys.
        </t>
      </section>

      <section title="Key Rollover for a Trust Anchor"
               anchor="key_rollover_anchor">
        <t>
          A Trust Anchor MUST publish an Entity Configuration about
          itself. The Trust Anchor SHOULD set an expiration
          time on its Entity Configuration,
	  such that federation participants will re-fetch it at reasonable intervals.
	  When a Trust Anchor rolls over its signing keys, it needs to:
        </t>
        <t>
          <list style="numbers">
            <t>
              Add the new keys to the <spanx style="verb">jwks</spanx> representing
              the Trust Anchor's signing keys in its Entity Configuration.
            </t>
            <t>
              Keep signing the Entity Configuration and the Entity Statements using
              the old keys for a long enough time period to allow all
              Subordinates to have obtained the new keys.
            </t>
            <t>
              Switch to signing with the new keys.
            </t>
            <t>
              After a reasonable time period, remove the old keys. What is
              regarded as a reasonable time is dependent on the security profile
              and risk assessment of the Trust Anchor.
            </t>
          </list>
        </t>
      </section>

      <section title="Redundant Retrieval of Trust Anchor Keys" anchor="TrustAnchorKeys">
        <t>
          It is RECOMMENDED that Federation Operators provide a means of retrieving the public keys
          for the Trust Anchors it administers that is independent of those Trust Anchors' Entity Configurations.
          This is intended to provide redundancy in the eventuality of the compromise of
          the Web PKI infrastructure underlying retrieval of public keys from Entity Configurations.
        </t>
        <t>
          The keys retrieved via the independent mechanism specified by the Federation Operator
          SHOULD be compared to those retrieved via the Trust Anchor's Entity Configuration.
          If they do not match, both SHOULD be retrieved again.
          If they still do not match, it is indicative of a security or configuration problem.
          The appropriate remediation steps in that eventuality SHOULD be specified by the Federation Operator.
        </t>
      </section>

      <section title="Revocation">
        <t>
          Since the participants in federations are expected to check the Trust Chain on a regular
          frequent basis, this specification does not define a
          revocation process. Specific federations MAY make a
          different choice and will then have to define their own revocation process.
        </t>
      </section>
    </section>

    <section title="OpenID Connect Client Registration" anchor="client_registration">
      <t>
        This section describes how the mechanisms defined in this specification
        are used to establish trust between an RP and an OP
        that have no explicit configuration or registration between them in advance.
      </t>
      <t>
        There are two alternative approaches to establish trust between an
        RP and an OP, which we call Automatic and Explicit Registration.
        Members of a federation or a community
        SHOULD agree upon which one to use. While implementations should
        support both methods, deployments MAY choose to use one or the other of them.
      </t>
      <t>
        Independent of whether the RP uses Automatic or Explicit Registration,
        the way that the RP learns about the OP is the same:
        It uses the procedure
        described in <xref target="resolving_trust"/>.
      </t>

      <section title="Automatic Registration" anchor="automatic">
        <t>
          Automatic Registration enables an RP to make Authentication Requests
          without a prior registration step with the OP.
          The OP resolves the RP's Entity Configuration from the Client ID in the Authentication Request,
          following the process defined in <xref target="resolving_trust"/>.
        </t>
        <t>
          Automatic Registration has the following characteristics:
          <list style="symbols">
            <t>
              In all interactions with the OP, the RP employs its Entity Identifier as the Client ID.
              The OP retrieves the RP's Entity Configuration
              from the URL derived from the Entity Identifier, as
              described in <xref target="federation_configuration"/>.
            </t>
            <t>
              Since there is no registration step prior to the Authentication Request,
              the RP MUST NOT be supplied with a Client Secret.
              Instead, the Automatic Registration model requires the RP to use
              asymmetric cryptography to authenticate its requests.
            </t>
            <t>
              The OP MUST publish that it supports one or more request authentication
              methods using the <spanx style="verb">openid_provider</spanx> metadata parameter
              <spanx style="verb">request_authentication_methods_supported</spanx>.
            </t>
          </list>
        </t>
        <t>
          An OP that supports Automatic Registration MUST include the
          <spanx style="verb">automatic</spanx> keyword in its
          <spanx style="verb">client_registration_types_supported</spanx>
          metadata parameter.
	</t>

        <section title="Authentication Request">
          <t>
            The Authentication Request is performed by passing a
            Request Object by value as described in Section 6.1 of
            <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>
            or using a pushed authorization request, as described in
            <xref target="RFC9126">Pushed Authorization Requests</xref>.
          </t>

          <section title="Using a Request Object" anchor="UsingAuthzRequestObject">

            <t>
              When a Request Object is used, the value of the
              <spanx style="verb">request</spanx>
              parameter is a JWT whose Claims are the request parameters
              specified in Section 3.1.2 in
              <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>.
              The JWT MUST be signed and MAY be encrypted.
              The following parameters are used in the Request Object:

              <list style="hanging">
                <t hangText="aud">
                  <vspace/>
                  REQUIRED. The Audience (aud) value MUST be or include
                  the OP's Issuer Identifier URL.
                </t>
                <t hangText="iss">
                  <vspace/>
                  REQUIRED. The <spanx style="verb">iss</spanx>
                  value MUST be the Client Identifier.
                </t>
                <t hangText="sub">
                  <vspace/>
                  MUST NOT be present. This, together with the value of
                  <spanx style="verb">aud</spanx>,
                  prevent reuse of the statement for
                  <spanx style="verb">private_key_jwt</spanx>
                  client authentication.
                </t>
                <t hangText="jti">
                  <vspace/>
                  REQUIRED. JWT ID. A unique identifier for the JWT, which can
                  be used to prevent reuse of the Request Object.
		  A Request Object MUST only
                  be used once, unless conditions for reuse were negotiated
                  between the parties; any such negotiation is beyond the scope
                  of this specification.
                </t>
                <t hangText="exp">
                  <vspace/>
                  REQUIRED. Number. Expiration time after which the JWT MUST
                  NOT be accepted for processing.
                </t>
                <t hangText="iat">
                  <vspace/>
                  OPTIONAL. Number. Time when the JWT was issued.
                </t>
                <t hangText="trust_chain" anchor="trust_chain_param">
                  <vspace/>
                  OPTIONAL. Array containing the sequence of Entity Statements
                  that comprise the Trust Chain between the RP making
                  the request and the selected Trust Anchor,
                  sorted as in <xref target="trust_chain"/>.
                  When the RP and the OP are part of the same federation,
                  the RP MUST select a Trust Anchor that it has in common
                  with the OP; otherwise, the RP is free to select the
                  Trust Anchor to use.
                </t>
              </list>
            </t>

            <section title="Authorization Request with a Trust Chain" anchor="trust_chain_authz">

              <t>
              When the
              <spanx style="verb">trust_chain</spanx>
              JWS header parameter is
              used in conjunction with the <spanx style="verb">trust_chain</spanx>
              request parameter,
              both contents MUST be identical. Otherwise the request MUST be rejected.
              </t>

              <t>
              When the <spanx style="verb">trust_chain</spanx>
              JWS header parameter or the
              <spanx style="verb">trust_chain</spanx>
              request parameter
              are used in the Authorization Request Object, the Relying Party
              informs the OP of the sequence of Entity Statements
              that proves the trust relationship between it
              and the selected Trust Anchor.
              </t>

              <t>
              Due to the large size of a Trust Chain, it may be necessary
              to use the HTTP POST method,
              <spanx style="verb">request_uri</spanx>,
              or
              a <xref target="RFC9126">Pushed Authorization Request</xref>
              for the request.
              </t>

            <figure>
              <preamble>
                The following is a non-normative example of the JWT Claims Set in a
                Request Object:
              </preamble>
	      <name>
		Request Object JWT Claims Set
	      </name>
              <artwork><![CDATA[
{
  "alg": "RS256",
  "kid": "that-kid-which-points-to-a-jwk-contained-in-the-trust-chain",
  "trust_chain" : [
    "eyJhbGciOiJSUzI1NiIsImtpZCI6Ims1NEhRdERpYnlHY3M5WldWTWZ2aUhm ...",
    "eyJhbGciOiJSUzI1NiIsImtpZCI6IkJYdmZybG5oQU11SFIwN2FqVW1BY0JS ...",
    "eyJhbGciOiJSUzI1NiIsImtpZCI6IkJYdmZybG5oQU11SFIwN2FqVW1BY0JS ..."
  ]
}
.
{
  "aud": "https://op.example.org/authorization-endpoint",
  "client_id": "https://rp.example.com",
  "exp": 1589699162,
  "iat": 1589699102,
  "iss": "https://rp.example.com",
  "jti": "4d3ec0f81f134ee9a97e0449be6d32be",
  "nonce": "4LX0mFMxdBjkGmtx7a8WIOnB",
  "redirect_uri": "https://rp.example.com/authz_cb",
  "response_type": "code",
  "scope": "openid profile email address phone",
  "state": "YmX8PM9I7WbNoMnnieKKBiptVW0sP2OZ"
}
]]></artwork>
            </figure>
            <figure>
              <preamble>
                The following is a non-normative example of an Authentication
                Request using the <spanx style="verb">request</spanx> parameter
		(with line wraps within values for display purposes only):
              </preamble>
	      <name>
		Authentication Request Using Request Object
	      </name>
              <artwork><![CDATA[
Host: server.example.com
GET /authorize?
    redirect_uri=https%3A%2F%2Frp.example.com%2Fauthz_cb
    &scope=openid+profile+email+address+phone
    &response_type=code
    &client_id=https%3A%2F%2Frp.example.com
    &request=eyJ0cnVzdF9jaGFpbiI6WyJleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2SW1z
      MU5FaFJkRVJwWW5sSFkzTTVXbGRXVFdaMmFVaG0gLi4uIiwiZXlKaGJHY2lPaUpT
      VXpJMU5pSXNJbXRwWkNJNklrSllkbVp5Ykc1b1FVMTFTRkl3TjJGcVZXMUJZMEpT
      IC4uLiIsImV5SmhiR2NpT2lKU1V6STFOaUlzSW10cFpDSTZJa0pZZG1aeWJHNW9R
      VTExU0ZJd04yRnFWVzFCWTBKUyAuLi4iXSwiYWxnIjoiUlMyNTYiLCJraWQiOiI2
      X2VGcGNoNXpTYm1QT3hMdGRGLXlrM1dqVFJvUGpBMll6UTd5YnJmV2dvIn0.eyJh
      dWQiOiJodHRwczovL29wLmV4YW1wbGUub3JnIiwiY2xpZW50X2lkIjoiaHR0cHM6
      Ly9ycC5leGFtcGxlLmNvbSIsImV4cCI6MTU4OTY5OTE2MiwiaWF0IjoxNTg5Njk5
      MTAyLCJpc3MiOiJodHRwczovL3JwLmV4YW1wbGUuY29tIiwianRpIjoiNGQzZWMw
      ZjgxZjEzNGVlOWE5N2UwNDQ5YmU2ZDMyYmUiLCJub25jZSI6IjRMWDBtRk14ZEJq
      a0dtdHg3YThXSU9uQiIsInJlZGlyZWN0X3VyaSI6Imh0dHBzOi8vcnAuZXhhbXBs
      ZS5jb20vYXV0aHpfY2IiLCJyZXNwb25zZV90eXBlIjoiY29kZSIsInNjb3BlIjoi
      b3BlbmlkIHByb2ZpbGUgZW1haWwgYWRkcmVzcyBwaG9uZSIsInN0YXRlIjoiWW1Y
      OFBNOUk3V2JOb01ubmllS0tCaXB0Vlcwc1AyT1oiLCJzdWIiOiJodHRwczovL3Jw
      LmV4YW1wbGUuY29tIn0.Gjo1NSYAx5PIllnUJhRCzZT-ezqyofU95pnGsgzclTfj
      cYCwSef_g2cniIWX4-35cAYR-NcAGEzaDIvQgzQ90O_24HlCtZ6yvUlb65uhZGGt
      O1TvsI7bl-92yrYCKD8fmaWH73R7qXZ8uLNspRy0L4emGXdUrFJ8RozE5asEdY_L
      _1orhot6uwWWrYE5cSyxJqCk_G1ackqKRmOlHB3EX3pNmVZodz6DQyONLeBqiMId
      xpvVALEkmpAQavEwrfpA-s4K3QIJrKAbEVQ1AfyQR0cGDd7fF4bju-wigYhBura0
      Pv4PrEFSNYG22b5ZPoubTPoFe-7W5Ypec_Io1aXNDA HTTP/1.1

]]></artwork>
            </figure>
            </section>

            <section title="Processing the Authentication Request" anchor="AuthzRequestProcessing">
              <t>
                When the OP receives an incoming Authentication Request,
                the OP supports OpenID Federation, the incoming
                Client ID
                is a valid URL, and the OP does not have the Client ID
                registered as a known
                client, then the OP SHOULD resolve the Trust Chains
                related to the requestor.
              </t>
              <t>
                An RP MAY present a Trust Chain related to itself to the OP in the Request Object using the
                <spanx style="verb">trust_chain</spanx> request parameter
		defined in <xref target="trust_chain_param"/> or the
                <spanx style="verb">trust_chain</spanx> JWS header parameter
		defined in <xref target="trust_chain_head_param"/>.
                If the OP does not have a valid registration for the RP or
                its registration has expired, the OP MAY use the received
                Trust Chain as a hint for which path to take from the
                Leaf Entity to the Trust Anchor.
                The OP MAY evaluate the statements in the
                <spanx style="verb">trust_chain</spanx>
                to make its Federation Entity Discovery procedure more efficient,
                especially if the RP contains multiple authority hints in
                its Entity Configuration.
	      </t>
	      <t>
                If the OP already has a valid registration for the RP, it MAY
                use the received Trust Chain to update the RP's registration.
                Whenever the OP uses a Trust Chain submitted by an RP, the
                OP MUST fully verify it, including every Entity Statement contained in it.
                A Trust Chain may be relied upon by the OP because it has validated
                all of its statements. This is true whether these statements
                are retrieved from their URLs or whether they
                are provided via the <spanx style="verb">trust_chain</spanx>
                request parameter or the
                JWS header parameter
                in the Request Object.
              </t>
              <t>
                If the RP does not include the
                <spanx style="verb">trust_chain</spanx>
                request parameter or the
                JWS header parameter
                in the Request Object,
                or the OP does not support this feature, it then MUST
                validate the possible Trust Chains, starting with the RP's Entity Configuration,
                as described in <xref target="fetching-es"/>,
                and resolve the RP metadata with Entity Type
                <spanx style="verb">openid_relying_party</spanx>.
              </t>
              <t>
                The OP SHOULD furthermore verify that the resolved metadata of the RP
                complies with the client metadata specification
                <xref target="OpenID.Registration">OpenID Connect Dynamic Client Registration 1.0</xref>.
              </t>
              <t>
                Once the OP has the RP's metadata, it can verify that the client
                was actually the one sending the Authentication Request by
                verifying the signature of the Request Object using the key
                material the client published in its metadata for the
                <spanx style="verb">openid_relying_party</spanx> Entity Type.
              </t>
            </section>
          </section>
          <section title="Using Pushed Authorization">
            <t>
              <xref target="RFC9126">Pushed Authorization Requests</xref>
              provide an
              interoperable way to push a Request Object
              directly to the AS in exchange for a
              <spanx style="verb">request_uri</spanx>.
            </t>
            <t>
              There are four applicable authentication methods:
              <list style="symbols">
                <t>
		  JWT Client authentication, as described
                  for <spanx style="verb">private_key_jwt</spanx> in Section 9
                  of
                  <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>.
                </t>
                <t>
                  mTLS using self-signed certificates,
		  as described in Section 2.2 of <xref target="RFC8705"/>.
                  In this case, the self-signed certificate MUST be present as
                  the value of an <spanx style="verb">x5c</spanx>
                  claim for one key in the JWK Set describing
                  the RP's keys.
                </t>
                <t>
                  mTLS using public key infrastructure (PKI),
		  as described in Section 2.1 of <xref target="RFC8705"/>.
                </t>
                <t>
                  A Request Object, as described in
                  <xref target="UsingAuthzRequestObject"/>
                  and <xref target="trust_chain_authz"/>.
                </t>
              </list>
              Note that if mTLS is used, TLS client authentication MUST be
              configured and, in the case of self-signed certificates, the server must
              omit the certificate chain validation.
            </t>
            <figure>
            <preamble>
	      Using the example above, a Pushed Authorization Request could look like this:
	    </preamble>
	    <name>
	      Pushed Authorization Request
	    </name>
              <artwork><![CDATA[
POST /par HTTP/1.1
Host: op.example.org
Content-Type: application/x-www-form-urlencoded

redirect_uri=https%3A%2F%2Frp.example.com%2Fauthz_cb
&scope=openid+profile+email+address+phone
&response_type=code
&nonce=4LX0mFMxdBjkGmtx7a8WIOnB
&state=YmX8PM9I7WbNoMnnieKKBiptVW0sP2OZ
&client_id=https%3A%2F%2Frp.example.com
&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3A
  client-assertion-type%3Ajwt-bearer
&client_assertion=eyJhbGciOiJSUzI1NiIsImtpZCI6ImRVTjJ
  hMDF3Umtoa1NXcGxRVGh2Y1ZCSU5VSXdUVWRPVUZVMlRtVnJTbW
  hFUVhnelpYbHBUemRRTkEifQ.eyJzdWIiOiAiaHR0cHM6Ly9ycC
  5leGFtcGxlLmNvbSIsICJpc3MiOiAiaHR0cHM6Ly9ycC5leGFtc
  GxlLmNvbSIsICJpYXQiOiAxNTg5NzA0NzAxLCAiZXhwIjogMTU4
  OTcwNDc2MSwgImF1ZCI6ICJodHRwczovL29wLmV4YW1wbGUub3J
  nL2F1dGhvcml6YXRpb24iLCAianRpIjogIjM5ZDVhZTU1MmQ5Yz
  Q4ZjBiOTEyZGM1NTY4ZWQ1MGQ2In0.oUt9Knx_lxb4V2S0tyNFH
  CNZeP7sImBy5XDsFxv1cUpGkAojNXSy2dnU5HEzscMgNW4wguz6
  KDkC01aq5OfN04SuVItS66bsx0h4Gs7grKAp_51bClzreBVzU4g
  _-dFTgF15T9VLIgM_juFNPA_g4Lx7Eb5r37rWTUrzXdmfxeou0X
  FC2p9BIqItU3m9gmH0ojdBCUX5Up0iDsys6_npYomqitAcvaBRD
  PiuUBa5Iar9HVR-H7FMAr7aq7s-dH5gx2CHIfM3-qlc2-_Apsy0
  BrQl6VePR6j-3q6JCWvNw7l4_F2UpHeanHb31fLKQbK-1yoXDNz
  DwA7B0ZqmuSmMFQ
]]></artwork>
            </figure>
            <section title="Processing the Authentication Request">
              <t>
                The requirements specified in
                <xref target="AuthzRequestProcessing"/>
                also apply to <xref target="RFC9126">Pushed Authorization Requests</xref>.
              </t>
              <t>
                Once the OP has the RP's metadata, it can verify the client
		using the keys published for the
		<spanx style="verb">openid_relying_party</spanx>
		Entity Type Identifier.
                This is where it diverges, depending on which client
                authentication method was used.
                <list style="hanging">
                  <t hangText="private_key_jwt">
                    <vspace/>
                    If this method is used, then the OP verifies the
                    signature of the signed JWT using the key material published
                    by the RP in its metadata. If the authentication is
                    successful, then the registration is valid.
                  </t>
                  <t hangText="tls_client_auth">
                    <vspace/>
                    If mTLS is used and the certificate used was not
                    self-signed, then the Subject Alternative Name of the
                    certificate
                    MUST match the Entity Identifier of the RP.
                  </t>
                  <t hangText="self_signed_tls_client_auth">
                    <vspace/>
                    If mTLS is used with a self-signed
                    certificate, then the certificate MUST be present as the
                    value
                    of an <spanx style="verb">x5c</spanx>
                    claim for a key in the JWK Set containing the RP's
                    keys.
                  </t>
                </list>
              </t>
            </section>
          </section>
        </section>
        <section title="Authentication Error Response" anchor="AuthenticationError">
          <t>
            If the OP fails to establish trust with the RP, it SHOULD use an
            appropriate error code and an
            <spanx style="verb">error_description</spanx>
            that aids the RP in understanding what is wrong.
          </t>
          <t>
            In addition to the error codes contained in the
	    IANA "OAuth Extensions Error Registry" registry <xref target="IANA.OAuth.Parameters"/>,
	    this specification also defines the following error
            codes:
          </t>
          <t>
            <list style="hanging">
              <t hangText="missing_trust_anchor">
                <vspace/>
                No trusted Trust Anchor could be found.
              </t>
              <t hangText="validation_failed">
                <vspace/>
                Trust chain validation failed.
              </t>
            </list>
          </t>
          <figure>
            <preamble>
              The following is a non-normative example authentication error response:
            </preamble>
          <name>
            Authentication Error Response
          </name>
            <artwork><![CDATA[
HTTP/1.1 302 Found
  Location: https://client.example.org/cb?
    error=missing_trust_anchor
    &error_description=
      Could%20not%20find%20a%20trusted%20anchor
    &state=af0ifjsldkj
]]></artwork>
          </figure>
        </section>
        <section title="Possible Other Uses of Automatic Registration" anchor="AutomaticRegistrationOtherUses">
          <t>
            Automatic Registration is designed to be able to be
            employed for use cases beyond OpenID Federation.
            For instance, ecosystems using <xref target="OpenID.Core">OpenID Connect</xref>,
            <xref target="RFC6749">OAuth 2.0</xref>, and
            <xref target="FAPI">FAPI</xref> can utilize Automatic Registration.
          </t>
        </section>

      </section>

      <section title="Explicit Registration" anchor="explicit">
        <t>
          Using this method, the RP establishes its client registration with the
          OP by means of a dedicated registration request, similar to
          <xref target="OpenID.Registration"/>, but instead of its metadata, the
          RP submits its Entity Configuration or an entire Trust Chain. When
          the Explicit Registration is completed, the RP can proceed to
          make regular OpenID authentication requests to the OP.
        </t>

        <t>
          An OP that supports Explicit Registration MUST include the
          <spanx style="verb">explicit</spanx> keyword in its
          <spanx style="verb">client_registration_types_supported</spanx>
          metadata parameter and set the
          <spanx style="verb">federation_registration_endpoint</spanx> metadata
          parameter to the URL at which it receives Explicit Registration requests.
        </t>

        <t>
          Explicit Registration is suitable for implementation on top of the
          <xref target="OpenID.Registration">OpenID Connect Dynamic Client
          Registration 1.0</xref> endpoint of an OP deployment. In contrast to
          Automatic Registration, it enables an OP to provision a Client ID, a
          client secret and metadata parameters.
        </t>

        <t>An example of an Explicit Registration is provided in
          <xref target="ExplicitRegExample"/>.
        </t>

        <section anchor="Clireg" title="Explicit Client Registration">
          <section anchor="Cliregreq" title="Explicit Client Registration Request">
            <t>
              The RP performs Explicit Client Registration as follows:
            </t>
            <t>
              <list style="numbers">

                <t>
                  Once the RP has determined a set of Trust Anchors it has in common with the OP,
                  it chooses the subset it wants to proceed with. This
                  may be a single Trust Anchor, or it can also be more than one.
                  The RP MUST perform a Trust Chain and metadata resolution for
                  the OP, as specified in <xref target="resolving_trust"/>. If
                  the resolution is not successful the RP MUST abort the
                  request.
                </t>
                <t>
                  Using this subset of Trust Anchors, the RP chooses a set of
                  <spanx style="verb">authority_hints</spanx>
                  from the hints that are available to it. Each hint MUST,
                  when used as a starting point for Trust Chain collection,
                  lead to at least one of the Trust Anchors in the subset.
                  If the RP has more than one Trust Anchor in common with the
                  OP it MUST select a subset of Trust Anchors to proceed with.
                  The subset may be as small as a single Trust Anchor, or
                  include multiple ones.
                </t>
                <t>
                  The RP will then construct its Entity Configuration,
                  where the metadata statement chosen is influenced by the OP's
                  metadata and where the
                  <spanx style="verb">authority_hints</spanx>
                  included are picked by the process described above.
                  From its immediate Superior authorities, the RP MUST select
                  one or more <spanx style="verb">authority_hints</spanx> so
                  that every hint, when used as the starting point for a Trust Chain
                  collection, leads to at least one of the Trust Anchors
                  in the subset selected above.
                </t>
                <t>
                  The RP MAY include its Entity Configuration
                  in a Trust Chain regarding itself.
                  In that case, the Registration Request will contain an
                  array with the sequence of
                  Entity Statements that compose the Trust Chain
                  between the RP that is making the request and the
                  selected Trust Anchor.
                  The RP MUST include its
                  metadata in its Entity Configuration and use the
                  <spanx style="verb">authority_hints</spanx> selected above.
                  <vspace blankLine="1"/>

                  The RP SHOULD select its metadata parameters to comply with
                  the resolved OP metadata and thus ensure a successful
                  registration with the OP. Note that if the submitted RP
                  metadata is not compliant with the metadata of the OP, the
                  OP may choose to modify it in order to make it compliant
                  rather than reject the request with an error response.
                </t>

                <t>
                  The Entity Configuration, or the entire Trust Chain,
                  is sent, using HTTP POST, to the
                  <spanx style="verb">federation_registration_endpoint</spanx>.
                  The Entity Configuration or Trust Chain is the entire POST body.
                  The RP MUST sign its Entity Configuration with a current
                  Federation Entity Key in its possession.
                </t>
                <t>
                  The content type of the Registration Request MUST be
                  <spanx style="verb">application/entity-statement+jwt</spanx>
                  when it contains only the Entity Configuration of the
                  requestor. Otherwise, when it contains the Trust Chain, the
                  content type of the Registration Request MUST be
                  <spanx style="verb">application/trust-chain+json</spanx>.
                  The RP MAY include its Entity Configuration in a Trust Chain
                  that leads to the RP. In this case, the registration request
                  will contain an array consisting of the sequence of
                  statements that make up the Trust Chain between the RP and
                  the Trust Anchor the RP selected.
                </t>
              </list>
            </t>
            <t>
              The following Entity Configuration claims are specified for use
              in Explicit Registration requests. Their full descriptions are in
              <xref target="entity-statement"/>.
            </t>
            <t>
              <list style="hanging">
                <t hangText="iss">
                  <vspace/>
                  REQUIRED.
                  Its value MUST be the Entity Identifier of the RP.
                </t>
                <t hangText="sub">
                  <vspace/>
                  REQUIRED.
                  Its value MUST be the Entity Identifier of the RP.
                </t>
                <t hangText="iat">
                  <vspace/>
                  REQUIRED.
                </t>
                <t hangText="exp">
                  <vspace/>
                  REQUIRED.
                </t>
                <t hangText="jwks">
                  <vspace/>
                  REQUIRED.
                </t>
                <t hangText="aud">
                  <vspace/>
                  REQUIRED.
                  Its value MUST be the Entity Identifier of the OP.
                </t>
                <t hangText="authority_hints">
                  <vspace/>
                  REQUIRED.
                </t>
                <t hangText="metadata">
                  <vspace/>
                  REQUIRED.
                  It MUST contain the RP metadata under the
		  <spanx style="verb">openid_relying_party</spanx>
		  Entity Type Identifier.
                </t>
                <t hangText="crit">
                  <vspace/>
                  OPTIONAL.
                </t>
                <t hangText="trust_marks">
                  <vspace/>
                  OPTIONAL.
                </t>
              </list>
            </t>
            <t>
              The request MUST be an HTTP request to the
              <spanx style="verb">federation_registration_endpoint</spanx> of
              the OP, using the POST method.
            </t>
            <t>
              When the RP submits an Entity Configuration the content type of
              the request MUST be
              <spanx style="verb">application/entity-statement+jwt</spanx>.
              When the RP submits a Trust Chain the content type MUST be
              <spanx style="verb">application/trust-chain+json</spanx>.
            </t>
          </section>

          <section anchor="cliregresp" title="Explicit Client Registration Response">
            <section title="Processing of the Request by the OP">
              <t>
                The OP processes the request as follows:
              </t>
              <t>
                <list style="numbers">
                  <t>
                    Upon receiving a registration request, the OP MUST inspect
                    the content type to determine whether it contains an Entity Configuration
                    or an entire Trust Chain.
                  </t>
                  <t>
                    If the request contains an Entity Configuration the OP
                    MUST use it to complete the Federation Entity Discovery by
                    collecting and evaluating the Trust Chains that start with
                    the <spanx style="verb">authority_hints</spanx> in the
                    Entity Configuration of the RP. After validating at least
                    one Trust Chain, the OP MUST verify the signature of the
                    received Entity Configuration. If the OP finds more than
                    one acceptable Trust Chain, it MUST choose one Trust Anchor
                    from those chains as the one to proceed with.
                  </t>
                  <t>
                    If the request contains a Trust Chain, the OP MAY evaluate
                    the statements in the Trust Chain to save the HTTP calls
                    that are necessary to perform the Federation Entity Discovery,
                    especially if the RP included more than one
                    authority hint in its Entity Configuration. Otherwise the
                    OP MUST extract the RP Entity Configuration from the Trust Chain
                    and proceed according to Step 2,
		    as if only an Entity Configuration was received.
                  </t>
                  <t>
                    At this point, if the OP finds that it already has an
                    existing client registration for the requesting RP, then
                    that registration MUST be invalidated. The precise time of
                    the invalidation is at the OP's discretion, as the OP may
                    want to ensure the completion of concurrent OpenID
                    authentication requests initiated by the RP while the
                    registration request is being processed.
                    <vspace blankLine="1"/>

                    The OP MAY retain client credentials and key material from
                    the invalidated registration in order to verify past RP
                    signatures and perform other cryptographic operations on
                    past RP data.
                  </t>
                  <t>
                    The OP will now use the RP metadata to create a client
                    registration compliant with its own OP metadata and other
                    applicable policies.
                    <vspace blankLine="1"/>

                    The OP MAY provision the RP with a
                    <spanx style="verb">client_id</spanx> other than the RP's
                    Entity Identifier. This enables Explicit Registration to be
                    implemented on top of the
                    <xref target="OpenID.Registration">OpenID Connect Dynamic
                    Client Registration 1.0</xref> endpoint of an OP.
                    <vspace blankLine="1"/>

                    If the RP is provisioned with a
                    <spanx style="verb">client_secret</spanx> it MUST NOT
                    expire before the expiration of the registration Entity Statement
                    that will be returned to the RP.
                    <vspace blankLine="1"/>

                    The OP SHOULD NOT provision the RP with a
                    <spanx style="verb">registration_access_token</spanx> and a
                    <spanx style="verb">registration_client_uri</spanx>
                    because the expected way for the RP to update its
                    registration is to make a new Explicit Registration
                    request. If the RP is provisioned with a
                    <spanx style="verb">registration_access_token</spanx> for
                    some purpose, for example to let it independently check its
                    registered metadata, the token MUST NOT allow modification
                    of the registration.
                    <vspace blankLine="1"/>

                    The OP MAY modify the received RP metadata, for example by
                    substituting an invalid or unsupported parameter, in order
                    to make it compliant with its own OP metadata and other
                    policies. If the OP does not accept the RP metadata or is
                    unwilling to modify it in order to make it compliant, it
                    MUST return a client registration error response, with an
                    appropriate error, such as
                    <spanx style="verb">invalid_client_metadata</spanx> or
                    <spanx style="verb">invalid_redirect_uri</spanx>, as
                    specified in Section 3.3 of
                    <xref target="OpenID.Registration"/>.
                  </t>
                  <t>
                    The OP MUST assign an expiration time to the created
                    registration. This time MUST NOT exceed the expiration time
                    of the Trust Chain that the OP selected to process the request.
                  </t>
                  <t>
                    If the OP created a client registration for the RP, it MUST
                    then construct a success response in the form of an Entity Statement.
                    <vspace blankLine="1"/>

                    The OP MUST set the <spanx style="verb">trust_anchor_id</spanx>
                    claim of the Entity Statement to the Trust Anchor it
                    selected to process the request. The
                    <spanx style="verb">authority_hints</spanx> claim MUST be
                    set to the OP's immediate Superior authority in the
                    selected Trust Chain.
                    <vspace blankLine="1"/>

                    The OP MUST set the <spanx style="verb">exp</spanx> claim
                    to the expiration time of the created registration. The OP
                    MAY choose to invalidate the registration before that, as
                    explained in <xref target="AfterExplicitReg"/>.
                    <vspace blankLine="1"/>

                    The OP MUST express the client registration it created for
                    the RP by means of the <spanx style="verb">metadata</spanx>
                    claim, by placing the metadata parameters under the
		    <spanx style="verb">openid_relying_party</spanx>
		    Entity Type Identifier.
		    The parameters MUST include the
                    <spanx style="verb">client_id</spanx> that was provisioned
                    for the RP. If the RP was provisioned with credentials,
                    for example a <spanx style="verb">client_secret</spanx>,
                    these MUST be included as well.
                    <vspace blankLine="1"/>

                    The OP SHOULD include metadata parameters that have a
                    default value, for example
                    <spanx style="verb">token_endpoint_auth_method</spanx>
                    which has a default value of
                    <spanx style="verb">client_secret_basic</spanx>, in order
                    to simplify the processing of the response by the RP.
                  </t>
                  <t>
                    The OP MUST sign the registration Entity Statement with a
                    current Federation Entity Key in its possession.
                  </t>
                </list>
              </t>
              <t>
                The following Entity Statement claims are specified for use in
                Explicit Registration responses.
              </t>
              <t>
                <list style="hanging">
                  <t hangText="iss">
                    <vspace/>
                    REQUIRED.
                    Its value MUST be the Entity Identifier of the OP. See
                    <xref target="entity-statement"/> for the full
                    specification.
                  </t>
                  <t hangText="sub">
                    <vspace/>
                    REQUIRED.
                    Its value MUST be the Entity Identifier of the RP. See
                    <xref target="entity-statement"/> for the full
                    specification.
                  </t>
                  <t hangText="iat">
                    <vspace/>
                    REQUIRED.
                    See <xref target="entity-statement"/> for the full
                    specification.
                  </t>
                  <t hangText="exp">
                    <vspace/>
                    REQUIRED.
                    See <xref target="entity-statement"/> for the full
                    specification.
                  </t>
                  <t hangText="jwks">
                    <vspace/>
                    REQUIRED.
                    It MUST be a verbatim copy of the <spanx style="verb">jwks</spanx>
                    of the received RP Entity Configuration. This MUST not be confused
                    with the identically named RP metadata parameter. See
                    <xref target="entity-statement"/> for the full
                    specification.
                  </t>
                  <t hangText="aud">
                    <vspace/>
                    REQUIRED.
                    Its value MUST be the Entity Identifier of the RP. See
                    <xref target="RFC7519"/> for the full specification. This
                    claim is specific to Explicit Registration responses and is
                    not a general Entity Statement claim.
                  </t>
                  <t hangText="trust_anchor_id">
                    <vspace/>
                    REQUIRED.
                    Its value MUST be the Entity Identifier of the Trust Anchor
                    that the OP selected to process the Explicit Registration
                    request. This claim is specific to Explicit Registration
                    responses and is not a general Entity Statement claim.
                  </t>
                  <t hangText="authority_hints">
                    <vspace/>
                    REQUIRED.
                    It MUST be a single-element array, whose value references
                    the immediate Superior authority of the OP in the Trust Chain
                    that the OP selected to process the request. See
                    <xref target="entity-statement"/> for the full
                    specification.
                  </t>
                  <t hangText="metadata">
                    <vspace/>
                    REQUIRED.
                    It MUST contain the registered RP metadata under the
                    <spanx style="verb">openid_relying_party</spanx>
		    Entity Type Identifier.
		    See <xref target="entity-statement"/> for the
                    full specification.
                  </t>
                  <t hangText="crit">
                    <vspace/>
                    OPTIONAL.
                    See <xref target="entity-statement"/> for the full
                    specification.
                  </t>
                </list>
              </t>
              <t>
                A successful response MUST have an HTTP status code 200 and
                the content type
                <spanx style="verb">application/entity-statement+jwt</spanx>.
              </t>
              <t>
                For a client registration error, the response is as defined in
                <xref target="error_response"/> and MAY use errors defined in
                Section 3.3 of <xref target="OpenID.Registration"/> and
		Section 3.2.2 of <xref target="RFC7591"/>.
              </t>
            </section>

            <section title="Processing of the Response by the RP">
              <t>
                <list style="numbers">
                  <t>
                    If the response indicates success, the RP MUST verify that
                    its content is a valid Entity Statement and issued by the OP.
                    <vspace blankLine="1"/>

                    The RP MUST ensure the signing Federation Entity Key used
                    by the OP is present in the
                    <spanx style="verb">jwks</spanx> claim of the Subordinate Statement
                    issued by the OP's immediate Superior authority
                    in a Trust Chain that the RP successfully resolved for the
                    OP when it prepared the Explicit Registration request.
                  </t>
                  <t>
                    The RP MUST verify that the
                    <spanx style="verb">trust_anchor_id</spanx> represents one
                    of its own Trust Anchors.
                  </t>
                  <t>
                    The RP MUST verify that at least one of the
                    <spanx style="verb">authority_hints</spanx> it specified in
                    the Explicit Registration request leads to the Trust Anchor
                    that the OP set in the
                    <spanx style="verb">trust_anchor_id</spanx> claim.
                  </t>
                  <t>
                    The RP MUST ensure that the metadata it was registered with
                    at the OP complies with the Trust Chain
                    <spanx style="verb">openid_relying_party</spanx> policies,
                    which Trust Chain is resolved using the
                    <spanx style="verb">trust_anchor_id</spanx> and
                    <spanx style="verb">authority_hints</spanx> claims of the
                    received registration Entity Statement. The RP SHOULD perform this check
                    by applying the resolved policies to the metadata as
                    specified in <xref target="applying_policies"/>, or utilize
                    another equivalent method.
                  </t>
                  <t>
                    If the received registration Entity Statement does not pass the above
                    checks, the RP MUST reject it. The RP MAY choose to retry
                    the Explicit Registration request in order to work around a
                    transient exception, for example due to a recent change of
                    Entity metadata or metadata policy causing temporary
                    misalignment of metadata.
                  </t>
                </list>
              </t>
            </section>
          </section>
        </section>

        <section title="After an Explicit Client Registration" anchor="AfterExplicitReg">
          <t>
            An RP can utilize the <spanx style="verb">exp</spanx> claim of the
            registration Entity Statement to devise a suitable strategy for
            renewing its client registration. RP implementers should note that
            if the OP expiration of the <spanx style="verb">client_id</spanx>
            coincides with an OAuth 2.0 flow that was just initiated by the RP, this
            may cause OpenID Connect authentication requests, token requests, or
            UserInfo requests to suddenly fail. Renewing the RP registration
            prior to its expiration can prevent such errors from
            occurring and ensure the end-user experience is not disrupted.
          </t>
          <t>
            An OP MAY invalidate a client registration before the expiration
            that is indicated in the registration Entity Statement for the RP.
            An example reason could be the OP leaving the federation that was
            used to register the RP.
          </t>
        </section>

      </section>

      <section title="Registration Validity and Trust Reevaluation" anchor="client_reg_trust_re_eval">
        <t>
          The validity of an Automatic or Explicit Registration at an OP MUST
          NOT exceed the lifetime of the Trust Chain the OP used to create the
          registration. An OP MAY choose to expire the registration at some
          earlier time, or choose to perform additional periodic reevaluations
          of the Trust Chain for the registered RP before the Trust Chain
          reaches its expiration time.
        </t>
        <t>
          Similarly, an RP that obtained an Automatic or Explicit Registration
          MUST NOT use it past the expiration of the Trust Chain the RP used to
          establish trust in the OP. For an RP using Automatic Registration, the
          trust in the OP MUST be successfully reevaluated before continuing to
          make requests to the OP. For an RP using Explicit Registration, the RP
          MUST successfully renew its registration. An RP MAY choose to perform
          additional periodic reevaluations of the Trust Chain for the OP
          before the Trust Chain reaches its expiration time.
        </t>
      </section>

      <section title="Differences between Automatic Registration and Explicit Registration" anchor="AutomaticVsExplicit">
        <t>
          The primary differences between Automatic Registration and Explicit Registration are:
          <list style="symbols">
            <t>
              With Automatic Registration, there is no registration step prior to the Authentication Request,
              whereas with Explicit Registration, there is.
              (<xref target="OpenID.Registration">OpenID Connect Dynamic Client Registration 1.0</xref>
              and <xref target="RFC7591">OAuth 2.0 Dynamic Client Registration</xref>
              also employ a prior registration step.)
            </t>
            <t>
              With Automatic Registration, the Client ID value is the RP's Entity Identifier
              and is supplied to the OP by the RP,
              whereas with Explicit Registration, a Client ID is assigned by the OP and supplied to the RP.
            </t>
            <t>
              Instead of using a Client Secret to authenticate the client, with Automatic Registration,
              the client is authenticated by means of the RP proving that it controls a private key
              corresponding to one of its Entity Configuration's public keys.
            </t>
          </list>
        </t>
      </section>

      <section title="Rationale for the Trust Chain in the Request" anchor="TrustChainParamRationale">
        <t>
          Both Automatic and Explicit Client Registration support
          the submission of the Trust Chain embedded in the Request,
          calculated by the requestor and related to itself.

          This enables the following benefits in
          a federation:
          <list style="symbols">

          <t>
            It solves the problem of OPs using RP metadata that has become stale.
            This stale data may occur when the OP uses cached RP metadata from a Trust Chain
            that has not reached its expiration time yet.
            The RP MAY notify the OP that a change has taken place by including
            the <spanx style="verb">trust_chain</spanx> header parameter
            or the <spanx style="verb">trust_chain</spanx> request parameter
	    in the request,
            thus letting the OP update its Client Registration
	    and preventing potential temporary faults due to stale metadata.
          </t>

          <t>
            It enables the RP to pass a verifiable hint for which trust path to
            take to build the Trust Chain. This can reduce the costs
            of RP Federation Entity Discovery for OPs in complex federations where the
            RP has multiple Trust Anchors or the Trust Chain resolution may
            result in dead-ends.
          </t>

          <t>
            It enables direct passing of the Entity Configuration, including
            any present Trust Marks, thus saving the OP from having to make
            an HTTP request to the RP
            <spanx style="verb">/.well-known/openid-federation</spanx>
            endpoint.
          </t>

	  </list>
        </t>
      </section>

    </section>

    <section anchor="ClaimsLanguagesAndScripts" title="Claims Languages and Scripts">
      <t>
        Human-readable claim values and claim values that reference human-readable values
        MAY be represented in multiple languages and scripts.
        This specification enables such representations in the same manner as defined in
        Section 5.2 of <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>.
      </t>
      <t>
        As described in OpenID Connect Core,
	to specify the languages and scripts, <xref
              target="RFC5646">BCP47</xref> language tags are added to member names,
        delimited by a <spanx style="verb">#</spanx> character.  For example,
        <spanx style="verb">family_name#ja-Kana-JP</spanx> expresses the
        Family Name in Katakana in Japanese, which is commonly used to index
        and represent the phonetics of the Kanji representation of the same name
        represented as <spanx style="verb">family_name#ja-Hani-JP</spanx>.
      </t>
      <t>
	Language tags can be used in any data structures
	containing or referencing human-readable values,
	including metadata parameters and Trust Mark parameters.
	For instance, both <spanx style="verb">organization_name</spanx> and
	<spanx style="verb">organization_name#de</spanx> might occur together in metadata.
      </t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <section title="Denial-of-Service Attack Prevention" anchor="DoS">
        <t>
          Some of the interfaces defined in this specification could be used for
          Denial-of-Service attacks (DoS), most notably, the resolve endpoint
          (<xref target="entity_listing"/>), Explicit Client Registration
          (<xref target="explicit"/>), and
          Automatic Client Registration (<xref target="automatic"/>) can
          be exploited as vectors of HTTP propagation attacks.

          If these endpoints are provided, some adequate defense methods are required,
          such as those described below and in
          <xref target="RFC4732"/>.
        </t>
        <t>
          A Trust Mark can be statically validated using the public key of its issuer.
          The static validation of the Trust Marks represents a
          filter against propagation attacks. An attacker
          could exploit the Federation Entity Discovery mechanism and use an OpenID Federation
          to propagate many HTTP requests. For each authorization request crafted
          by an anonymous client, the OP would produce approximately three HTTP requests to third parties
          in the absence of Intermediates, and at least five HTTP requests with at
          least one Intermediate. If an OP does not find at least one
          valid Trust Mark in an Entity Configuration, it should reject the request and
          temporary ban the requestor.
        </t>
        <t>
          If client authentication is not demanded at the resolve endpoint
          then incoming requests should not result in the immediate
          collection (Federation Entity Discovery process) and evaluation of Trust Chains by default.
        </t>
      </section>
      <section title="Unsigned Error Messages" anchor="UnsignedError">
        <t>
          One of the fundamental design goals of this protocol is to
          protect messages end-to-end. This can not be accomplished by demanding
          TLS since TLS, in lots of cases, is not end-to-end but ends in a HTTPS
          to HTTP Reverse Proxy.
          Allowing unsigned error messages therefore opens up an attack
          vector for someone who wants to run a Denial of Service attack.
          This is not specific to OpenID Federation but equally valid for
          other protocols when HTTPS to HTTP reverse proxies are used.
        </t>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">

      <section anchor="MetadataRegistry" title="OAuth Authorization Server Metadata Registration">
        <t>
          This specification registers the following metadata entries in the
          IANA "OAuth Authorization Server Metadata" registry <xref target="IANA.OAuth.Parameters"/>
          established by <xref target="RFC8414"/>.
        </t>

        <section anchor='MetadataContents' title='Registry Contents'>
          <t>
            <?rfc subcompact="yes"?>
            <list style='symbols'>
              <t>
                Metadata Name:
                <spanx style="verb">client_registration_types_supported</spanx>
              </t>
              <t>
                Metadata Description: Client Registration Types Supported
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="OP_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">federation_registration_endpoint</spanx>
              </t>
              <t>
                Metadata Description:
                Federation Registration Endpoint
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="OP_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">request_authentication_methods_supported</spanx>
              </t>
              <t>
                Metadata Description:
                Authentication request authentication methods supported
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="OP_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">request_authentication_signing_alg_values_supported</spanx>
              </t>
              <t>
                Metadata Description:
                JSON array containing the JWS signing algorithms
                supported for the signature on
                the JWT used to authenticate the request
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="OP_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">signed_jwks_uri</spanx>
              </t>
              <t>
                Metadata Description:
                URL referencing a signed JWT having this authorization server's JWK Set document as its payload
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="jwks_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">jwks</spanx>
              </t>
              <t>
                Metadata Description:
                JSON Web Key Set document, passed by value
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="jwks_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">organization_name</spanx>
              </t>
              <t>
                Metadata Description:
                Human-readable name representing the organization owning this authorization server
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="informational_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">contacts</spanx>
              </t>
              <t>
                Metadata Description:
                Array of strings representing ways to contact people responsible for this authorization server, typically email addresses
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="informational_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">logo_uri</spanx>
              </t>
              <t>
                Metadata Description:
		URL that references a logo for the organization owning this authorization server
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="informational_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">homepage_uri</spanx>
              </t>
              <t>
                Metadata Description:
		URL of a Web page for the organization owning this authorization server
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="informational_metadata"/> of this specification
              </t>
            </list>
          </t>
        </section>
        <?rfc subcompact="no"?>

      </section>

      <section anchor="DynRegRegistrations" title="OAuth Dynamic Client Registration Metadata Registration">
        <t>
          This specification registers the following client metadata entries
          in the IANA "OAuth Dynamic Client Registration Metadata" registry
          <xref target="IANA.OAuth.Parameters"/>
          established by <xref target="RFC7591"/>.
        </t>
        <section anchor="DynRegContents" title="Registry Contents">
          <t>
            <?rfc subcompact="yes"?>
            <list style="symbols">
              <t>
                Client Metadata Name: <spanx style="verb">client_registration_types</spanx>
              </t>
              <t>
                Client Metadata Description:
                An array of strings specifying the client registration types the RP wants to use
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="RP_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style="symbols">
              <t>
                Client Metadata Name: <spanx style="verb">signed_jwks_uri</spanx>
              </t>
              <t>
                Client Metadata Description:
                URL referencing a signed JWT having the client's JWK Set document as its payload
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="jwks_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style="symbols">
              <t>
                Client Metadata Name: <spanx style="verb">organization_name</spanx>
              </t>
              <t>
                Client Metadata Description:
                Human-readable name representing the organization owning this client
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="informational_metadata"/> of this specification
              </t>
            </list>
          </t>
          <t>
            <list style='symbols'>
              <t>
                Metadata Name: <spanx style="verb">homepage_uri</spanx>
              </t>
              <t>
                Metadata Description:
		URL of a Web page for the organization owning this client
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="informational_metadata"/> of this specification
              </t>
            </list>
          </t>
        </section>
        <?rfc subcompact="no"?>
      </section>

      <section anchor="ErrorReg" title="OAuth Extensions Error Registration">

        <t>
          This section registers the following values in the
          IANA "OAuth Extensions Error Registry" registry
          <xref target="IANA.OAuth.Parameters"/>
          established by <xref target="RFC6749"/>.
        </t>

        <section title="Registry Contents" anchor="ErrorContents">
          <t>
            <?rfc subcompact="yes"?>
            <list style="symbols">
              <t>Name: missing_trust_anchor</t>
              <t>Usage Location: Authorization Request</t>
              <t>Protocol Extension: OpenID Federation</t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>Reference: <xref target="AuthenticationError"/> of this specification</t>
            </list>
          </t>
          <t>
            <list style="symbols">
              <t>Name: validation_failed</t>
              <t>Usage Location: Authorization Request</t>
              <t>Protocol Extension: OpenID Federation</t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>Reference: <xref target="AuthenticationError"/> of this specification</t>
            </list>
          </t>
        </section>
        <?rfc subcompact="no"?>
      </section>

      <section title="Media Type Registration" anchor="MediaReg">
        <t>
          This section registers the following media types <xref target="RFC2046"/>
          in the "Media Types" registry <xref target="IANA.MediaTypes"/>
          in the manner described in <xref target="RFC6838"/>.
        </t>

        <section title="Registry Contents" anchor="MediaContents">
          <t>
            <?rfc subcompact="yes"?>
            <list style="symbols">
              <t>
                Type name: application
              </t>
              <t>
                Subtype name: entity-statement+jwt
              </t>
              <t>
                Required parameters: n/a
              </t>
              <t>
                Optional parameters: n/a
              </t>
              <t>
                Encoding considerations: binary;
                An Entity Statement is a JWT;
                JWT values are encoded as a
                series of base64url-encoded values (some of which may be the
                empty string) separated by period ('.') characters.
              </t>
              <t>
                Security considerations: See <xref target="Security"/> of this specification
              </t>
              <t>
                Interoperability considerations: n/a
              </t>
              <t>
                Published specification: this specification
              </t>
              <t>
                Applications that use this media type:
                Applications that use this specification
              </t>
              <t>
                Fragment identifier considerations: n/a
              </t>
              <t>
                Additional information:<list style="empty">
                <t>Magic number(s): n/a</t>
                <t>File extension(s): n/a</t>
                <t>Macintosh file type code(s): n/a </t></list>
                <vspace/>
              </t>
              <t>
                Person &amp; email address to contact for further information:
                <vspace/>
                Michael B. Jones, michael_b_jones@hotmail.com
              </t>
              <t>
                Intended usage: COMMON
              </t>
              <t>
                Restrictions on usage: none
              </t>
              <t>
                Author: Michael B. Jones, michael_b_jones@hotmail.com
              </t>
              <t>
                Change controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Provisional registration? No
              </t>
            </list>
            <?rfc subcompact="no"?>
          </t>

          <t>
            <?rfc subcompact="yes"?>
            <list style="symbols">
              <t>
                Type name: application
              </t>
              <t>
                Subtype name: trust-mark+jwt
              </t>
              <t>
                Required parameters: n/a
              </t>
              <t>
                Optional parameters: n/a
              </t>
              <t>
                Encoding considerations: binary;
                A Trust Mark is a JWT;
                JWT values are encoded as a
                series of base64url-encoded values (some of which may be the
                empty string) separated by period ('.') characters.
              </t>
              <t>
                Security considerations: See <xref target="Security"/> of this specification
              </t>
              <t>
                Interoperability considerations: n/a
              </t>
              <t>
                Published specification: this specification
              </t>
              <t>
                Applications that use this media type:
                Applications that use this specification
              </t>
              <t>
                Fragment identifier considerations: n/a
              </t>
              <t>
                Additional information:<list style="empty">
                <t>Magic number(s): n/a</t>
                <t>File extension(s): n/a</t>
                <t>Macintosh file type code(s): n/a </t></list>
                <vspace/>
              </t>
              <t>
                Person &amp; email address to contact for further information:
                <vspace/>
                Michael B. Jones, michael_b_jones@hotmail.com
              </t>
              <t>
                Intended usage: COMMON
              </t>
              <t>
                Restrictions on usage: none
              </t>
              <t>
                Author: Michael B. Jones, michael_b_jones@hotmail.com
              </t>
              <t>
                Change controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Provisional registration? No
              </t>
            </list>
            <?rfc subcompact="no"?>
          </t>

          <t>
            <?rfc subcompact="yes"?>
            <list style="symbols">
              <t>
                Type name: application
              </t>
              <t>
                Subtype name: resolve-response+jwt
              </t>
              <t>
                Required parameters: n/a
              </t>
              <t>
                Optional parameters: n/a
              </t>
              <t>
                Encoding considerations: binary;
                An Entity Resolve Response is a signed JWT;
                JWT values are encoded as a
                series of base64url-encoded values (some of which may be the
                empty string) separated by period ('.') characters.
              </t>
              <t>
                Security considerations: See <xref target="Security"/> of this specification
              </t>
              <t>
                Interoperability considerations: n/a
              </t>
              <t>
                Published specification: this specification
              </t>
              <t>
                Applications that use this media type:
                Applications that use this specification
              </t>
              <t>
                Fragment identifier considerations: n/a
              </t>
              <t>
                Additional information:<list style="empty">
                <t>Magic number(s): n/a</t>
                <t>File extension(s): n/a</t>
                <t>Macintosh file type code(s): n/a </t></list>
                <vspace/>
              </t>
              <t>
                Person &amp; email address to contact for further information:
                <vspace/>
                Michael B. Jones, michael_b_jones@hotmail.com
              </t>
              <t>
                Intended usage: COMMON
              </t>
              <t>
                Restrictions on usage: none
              </t>
              <t>
                Author: Michael B. Jones, michael_b_jones@hotmail.com
              </t>
              <t>
                Change controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Provisional registration? No
              </t>
            </list>
            <?rfc subcompact="no"?>
          </t>


          <t>
            <?rfc subcompact="yes"?>
            <list style="symbols">
              <t>
                Type name: application
              </t>
              <t>
                Subtype name: trust-chain+json
              </t>
              <t>
                Required parameters: n/a
              </t>
              <t>
                Optional parameters: n/a
              </t>
              <t>
                Encoding considerations: binary;
                A Trust Chain is a JSON array of JWTs;
                JWT values are encoded as a
                series of base64url-encoded values (some of which may be the
                empty string) separated by period ('.') characters.
              </t>
              <t>
                Security considerations: See <xref target="Security"/> of this specification
              </t>
              <t>
                Interoperability considerations: n/a
              </t>
              <t>
                Published specification: this specification
              </t>
              <t>
                Applications that use this media type:
                Applications that use this specification
              </t>
              <t>
                Fragment identifier considerations: n/a
              </t>
              <t>
                Additional information:<list style="empty">
                <t>Magic number(s): n/a</t>
                <t>File extension(s): n/a</t>
                <t>Macintosh file type code(s): n/a </t></list>
                <vspace/>
              </t>
              <t>
                Person &amp; email address to contact for further information:
                <vspace/>
                Michael B. Jones, michael_b_jones@hotmail.com
              </t>
              <t>
                Intended usage: COMMON
              </t>
              <t>
                Restrictions on usage: none
              </t>
              <t>
                Author: Michael B. Jones, michael_b_jones@hotmail.com
              </t>
              <t>
                Change controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Provisional registration? No
              </t>
            </list>
            <?rfc subcompact="no"?>
          </t>

                    <t>
            <?rfc subcompact="yes"?>
            <list style="symbols">
              <t>
                Type name: application
              </t>
              <t>
                Subtype name: trust-mark-delegation+jwt
              </t>
              <t>
                Required parameters: n/a
              </t>
              <t>
                Optional parameters: n/a
              </t>
              <t>
                Encoding considerations: binary;
                A Trust Mark delegation is a signed JWT;
                JWT values are encoded as a
                series of base64url-encoded values (some of which may be the
                empty string) separated by period ('.') characters.
              </t>
              <t>
                Security considerations: See <xref target="Security"/> of this specification
              </t>
              <t>
                Interoperability considerations: n/a
              </t>
              <t>
                Published specification: this specification
              </t>
              <t>
                Applications that use this media type:
                Applications that use this specification
              </t>
              <t>
                Fragment identifier considerations: n/a
              </t>
              <t>
                Additional information:<list style="empty">
                <t>Magic number(s): n/a</t>
                <t>File extension(s): n/a</t>
                <t>Macintosh file type code(s): n/a </t></list>
                <vspace/>
              </t>
              <t>
                Person &amp; email address to contact for further information:
                <vspace/>
                Roland Hedberg, roland@catalogix.se
              </t>
              <t>
                Intended usage: COMMON
              </t>
              <t>
                Restrictions on usage: none
              </t>
              <t>
                Author: Roland Hedberg, roland@catalogix.se
              </t>
              <t>
                Change controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Provisional registration? No
              </t>
            </list>
            <?rfc subcompact="no"?>
          </t>

        </section>
      </section>

      <section anchor="ParameterRegistry" title="OAuth Parameters Registration">
        <t>
          This specification registers the following parameter name in the IANA "OAuth
          Parameters" registry <xref target="IANA.OAuth.Parameters"/> established
          by <xref target="RFC6749"/>.
        </t>

        <section anchor="ParameterContents" title="Registry Contents">
          <t>
            <?rfc subcompact="yes"?>
            <list style='symbols'>
              <t>
                Parameter Name:
                <spanx style="verb">trust_chain</spanx>
              </t>
              <t>
                Parameter Usage Location: authorization request
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="AuthzRequestProcessing"/> of this specification
              </t>
            </list>
          </t>
        </section>

      </section>

      <section anchor="JwsHeaderRegistry" title="JSON Web Signature and Encryption Header Parameters Registration">
        <t>
	  This specification registers the following JWS header parameter in
	  the IANA "JSON Web Signature and Encryption Header Parameters" registry <xref target="IANA.JOSE"/>
	  established by <xref target="RFC7515"/>.
        </t>

        <section anchor="HeaderContents" title="Registry Contents">
          <t>
            <?rfc subcompact="yes"?>
            <list style='symbols'>
              <t>
                Header Parameter Name:
                <spanx style="verb">trust_chain</spanx>
              </t>
              <t>
                Header Parameter Description: OpenID Federation Trust Chain
              </t>
              <t>
                Header Parameter Usage Location: JWS
              </t>
              <t>
                Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
              </t>
              <t>
                Specification Document(s): <xref target="trust_chain"/> of this specification
              </t>
            </list>
          </t>
        </section>

      </section>

      <section anchor="ClaimsRegistry" title="JSON Web Token Claims Registration">
	<t>
	  This specification registers the following claim in
	  the IANA "JSON Web Token Claims" registry <xref target="IANA.JWT.Claims"/>
	  established by <xref target="RFC7519"/>.
	</t>

	<section anchor="ClaimsContents" title="Registry Contents">
	  <t>
	    <?rfc subcompact="yes"?>
	    <list style="symbols">
	      <t>
		Claim Name: <spanx style="verb">keys</spanx>
	      </t>
	      <t>
		Claim Description: Array of JWK values, as defined in RFC 7517
	      </t>
	      <t>
		Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
	      </t>
	      <t>
		Specification Document(s): Section <xref target="common_metadata"/> of this specification
	      </t>
	    </list>
	  </t>
	  <t>
	    <list style="symbols">
	      <t>
		Claim Name: <spanx style="verb">id</spanx>
	      </t>
	      <t>
		Claim Description: Identifier
	      </t>
	      <t>
		Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
	      </t>
	      <t>
		Specification Document(s): Section <xref target="trust_mark_claims"/> of this specification
	      </t>
	    </list>
	  </t>
	  <t>
	    <list style="symbols">
	      <t>
		Claim Name: <spanx style="verb">ref</spanx>
	      </t>
	      <t>
		Claim Description: Reference
	      </t>
	      <t>
		Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
	      </t>
	      <t>
		Specification Document(s): Section <xref target="trust_mark_claims"/> of this specification
	      </t>
	    </list>
	  </t>
	  <t>
	    <list style="symbols">
	      <t>
		Claim Name: <spanx style="verb">delegation</spanx>
	      </t>
	      <t>
		Claim Description: Delegation
	      </t>
	      <t>
		Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
	      </t>
	      <t>
		Specification Document(s): Section <xref target="trust_mark_claims"/> of this specification
	      </t>
	    </list>
	  </t>
	</section>
	<?rfc subcompact="no"?>
      </section>

      <section title="JSON Web Key Parameters Registration" anchor="JWKParamReg">
	<t>
	  This specification registers the following parameters in
	  the IANA "JSON Web Key Parameters" registry <xref target="IANA.JOSE"/>
	  established by <xref target="RFC7517"/>.
	</t>

	<section title="Registry Contents" anchor="JWKContents">
	  <t> <?rfc subcompact="yes"?>
	  <list style='symbols'>
	    <t>
	      Parameter Name: <spanx style="verb">iat</spanx>
	    </t>
	    <t>
	      Parameter Description: Issued At, as defined in RFC 7519
	    </t>
	    <t>
	      Used with "kty" Value(s): *
	    </t>
	    <t>
	      Parameter Information Class: Public
	    </t>
	    <t>
	      Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
	    </t>
	    <t>
	      Specification Document(s): <xref target="HistKeysResp" /> of this specification
	    </t>
	  </list>
	  </t>
	  <t>
	    <list style='symbols'>
	      <t>
		Parameter Name: <spanx style="verb">exp</spanx>
	      </t>
	      <t>
		Parameter Description: Expiration Time, as defined in RFC 7519
	      </t>
	      <t>
		Used with "kty" Value(s): *
	      </t>
	      <t>
		Parameter Information Class: Public
	      </t>
	      <t>
		Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
	      </t>
	      <t>
		Specification Document(s): <xref target="HistKeysResp" /> of this specification
	      </t>
	    </list>
	  </t>
	  <t>
	    <list style='symbols'>
	      <t>
		Parameter Name: <spanx style="verb">revoked</spanx>
	      </t>
	      <t>
		Parameter Description: Revoked Key Properties
	      </t>
	      <t>
		Used with "kty" Value(s): *
	      </t>
	      <t>
		Parameter Information Class: Public
	      </t>
	      <t>
		Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
	      </t>
	      <t>
		Specification Document(s): <xref target="HistKeysResp" /> of this specification
	      </t>
	    </list>
	  </t>
	</section>
	<?rfc subcompact="no"?>
      </section>

      <section anchor="WellKnownRegistry" title="Well-Known URI Registry">
	<t>
	  This specification registers the following well-known URI in the IANA
	  "Well-Known URIs" registry <xref target="IANA.well-known"/>
	  established by <xref target="RFC5785"/>.
	</t>

	<section anchor='WellKnownContents' title='Registry Contents'>
	  <t> <?rfc subcompact="yes"?>
	  <list style='symbols'>
	    <t>
	      URI suffix: <spanx style="verb">openid-federation</spanx>
	    </t>
	    <t>
	      Change controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
	    </t>
	    <t>
	      Specification document: <xref target="federation_configuration"/> 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.3339.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4732.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5646.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7515.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7517.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7519.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.7638.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.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.8705.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9126.xml"/>

      <reference anchor="OpenID.Core"
                 target="https://openid.net/specs/openid-connect-core-1_0.html">
        <front>
          <title>OpenID Connect Core 1.0</title>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nomura Research Institute,
              Ltd.
            </organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Ping Identity">Ping Identity</organization>
          </author>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft</organization>
          </author>

          <author fullname="Breno de Medeiros" initials="B."
                  surname="de Medeiros">
            <organization abbrev="Google">Google</organization>
          </author>

          <author fullname="Chuck Mortimore" initials="C." surname="Mortimore">
            <organization abbrev="Salesforce">Salesforce</organization>
          </author>

          <date day="8" month="November" year="2014"/>
        </front>
      </reference>

      <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="NRI">Nomura Research Institute,
              Ltd.
            </organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Ping Identity">Ping Identity</organization>
          </author>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft</organization>
          </author>

          <author fullname="Edmund Jay" initials="E." surname="Jay">
            <organization abbrev="Illumila">Illumila</organization>
          </author>

          <date day="8" month="November" year="2014"/>
        </front>
      </reference>

      <reference anchor="OpenID.Registration"
                 target="https://openid.net/specs/openid-connect-registration-1_0.html">
        <front>
          <title>OpenID Connect Dynamic Client Registration 1.0</title>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nomura Research Institute,
              Ltd.
            </organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Ping Identity">Ping Identity</organization>
          </author>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft</organization>
          </author>

          <date day="8" month="November" year="2014"/>
        </front>
      </reference>

      <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-oauth-resource-metadata-01.xml" />

    </references>

    <references title="Informative References">
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2046.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5785.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.6838.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8725.xml"/>

      <reference anchor="FAPI"
                 target="https://openid.net/specs/openid-financial-api-part-2-1_0.html">
        <front>
          <title>Financial-grade API Security Profile 1.0 - Part 2: Advanced</title>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nat Consulting</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Yubico">Yubico</organization>
          </author>

          <author fullname="Edmund Jay" initials="E." surname="Jay">
            <organization abbrev="Illumila">Illumila</organization>
          </author>

          <date day="12" month="March" year="2021"/>
        </front>
      </reference>

      <reference anchor="IANA.OAuth.Parameters" target="https://www.iana.org/assignments/oauth-parameters">
        <front>
          <title>OAuth Parameters</title>
          <author>
            <organization>IANA</organization>
          </author>
          <date/>
        </front>
      </reference>

      <reference anchor="IANA.MediaTypes" target="https://www.iana.org/assignments/media-types">
        <front>
          <title>Media Types</title>
          <author>
            <organization>IANA</organization>
          </author>
          <date/>
        </front>
      </reference>

      <reference anchor="IANA.JOSE" target="https://www.iana.org/assignments/jose/">
        <front>
          <title>JSON Object Signing and Encryption (JOSE)</title>
          <author>
            <organization>IANA</organization>
          </author>
          <date/>
        </front>
      </reference>

      <reference anchor="IANA.JWT.Claims" target="https://www.iana.org/assignments/jwt">
        <front>
          <title>JSON Web Token Claims</title>
          <author>
            <organization>IANA</organization>
          </author>
	  <date/>
        </front>
      </reference>

      <reference anchor="IANA.well-known" target="https://www.iana.org/assignments/well-known-uris">
        <front>
          <title>Well-Known URIs</title>
          <author>
            <organization>IANA</organization>
          </author>
	  <date/>
        </front>
      </reference>

    </references>

    <section anchor="ChainBuildingExample" title="Example OpenID Provider Information Discovery and Client Registration">
      <t>
        Let us assume the following: The project LIGO would like to offer access
        to its wiki to all OPs in eduGAIN. LIGO is registered with the InCommon
        federation.
      </t>

      <figure>
        <preamble>
	  The following depicts a federation under the eduGAIN Trust Anchor:
        </preamble>
	<name>
          Participants Within the eduGAIN Federation
	</name>
        <artwork><![CDATA[
                       eduGAIN
                          |
       +------------------+------------------+
       |                                     |
    SWAMID                               InCommon
       |                                     |
     umu.se                                  |
       |                                     |
   op.umu.se                           wiki.ligo.org
]]></artwork>
      </figure>
      <t>
        Both SWAMID and InCommon are identity federations in their own right.
        They also have in common that they are both members of
        the eduGAIN federation.
      </t>
      <t>
        SWAMID and InCommon are different in how they register Entities.
        SWAMID registers organizations and lets the organizations register
        Entities that belong to the organization, while InCommon registers all
        Entities directly and not beneath any organization Entity.
        Hence the differences in depth in the federations.
      </t>
      <t>
        Let us assume a researcher from Umeå University would like to
        login to
        the LIGO Wiki. At the Wiki, the researcher will use some kind of
        discovery service to find the home identity provider (op.umu.se).
      </t>
      <t>
        Once the RP part of the Wiki knows which OP it SHOULD talk to, it has
        to find out a couple of things about the OP. All of those things
        can be found in the metadata. But finding the metadata is not enough;
        the RP also has to trust the metadata.
      </t>
      <t>
        Let us make a detour and start with what it takes to build a federation.
      </t>

      <section title="Setting Up a Federation" anchor="federation_intro">
        <t>
          These are the steps to set up a federation infrastructure:
          <list style="symbols">
            <t>
              Generation of Trust Anchor signing keys. These MUST be public/private key pairs.
            </t>
            <t>
              Set up a signing service that can sign JWTs/Entity Statements
              using the Federation Entity Keys.
            </t>
            <t>
              Set up web services that can publish signed Entity Statements,
              one for the URL corresponding to the federation's Entity Identifier returning
              an Entity Configuration and the other one providing the fetch endpoint,
	      as described in <xref target="fetch_statement"/>.
            </t>
          </list>
        </t>
        <t>
          Once these requirements have been satisfied, a Federation Operator
          can add Entities to the federation.
          Adding an Entity comes down to:
          <list style="symbols">
            <t>
              Providing the Entity with the
              federation's Entity Identifier and the public part of the key pairs used
              by the federation operator for signing Entity Statements.
            </t>
            <t>
              Getting the Entity's Entity Identifier and the JWK Set that the Entity
              plans to publish in its Entity Configuration.
            </t>
          </list>
        </t>
        <t>
          Before the federation operator starts adding Entities, there must
          be policies on who can be part of the federation and the
          layout of the federation. Is it supposed to be a one-layer federation
          like InCommon, a two-layer one like the SWAMID federation,
          or a multi-layer federation?
          The federation may also want to consider implementing other
          policies using the federation policy framework,
          as described in <xref target="federation_policy"/>.
        </t>
        <t>
          With the federation in place, things can start happening.
        </t>
      </section>

      <section title="The LIGO Wiki Discovers the OP's Metadata"
               anchor="op_discovery">
        <t>
          Federation Entity Discovery is a sequence of steps that starts with the RP
          fetching the Entity Configuration of the OP Leaf Entity (in this case,
          https://op.umu.se) using the process defined in
          <xref target="federation_configuration"/>.
          What follows after that is this sequence of steps:
          <list style="numbers">
            <t>Pick out the immediate Superior Entities using the authority
              hints.
            </t>
            <t>
              Fetch the Entity Configuration for each such Entity. This uses the
              process defined in
              <xref target="federation_configuration"/>.
            </t>
            <t>
              Use the fetch endpoint of each Superior to
              obtain Subordinate Statements about the Subordinate Entity,
              per <xref target="fetch_statement"/>.
            </t>
          </list>
        </t>
        <t>
          How many times this has to be repeated depends on the depth of the
          federation. What follows below is the result of each step the RP
          has to take to find the OP's metadata using the federation setup
          described above.
        </t>
        <t>
          When building the Trust Chain, the Subordinate Statements issued
          by a Superior about its Subordinate are used together with the
          Entity Configuration issued by the Leaf.
        </t>
        <t>
          The Entity Configurations of Intermediates are not
          part of the Trust Chain.
        </t>

        <section title="Entity Configuration for https://op.umu.se">
          <t>The LIGO WIKI RP fetches the Entity Configuration from the
            OP (op.umu.se)
            using the process defined in <xref
                    target="federation_configuration"/>.
          </t>
          <figure>
            <preamble>The result is this Entity Configuration:</preamble>
          <name>
             Entity Configuration Issued by https://op.umu.se
          </name>
            <artwork><![CDATA[
{
  "authority_hints": [
    "https://umu.se"
  ],
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://op.umu.se",
  "sub": "https://op.umu.se",
  "jwks": {
    "keys": [
      {
        "e": "AQAB",
        "kid": "dEEtRjlzY3djcENuT01wOGxrZlkxb3RIQVJlMTY0...",
        "kty": "RSA",
        "n": "x97YKqc9Cs-DNtFrQ7_vhXoH9bwkDWW6En2jJ044yH..."
      }
    ]
  },
  "metadata": {
    "openid_provider": {
      "issuer": "https://op.umu.se/openid",
      "signed_jwks_uri": "https://op.umu.se/openid/jwks.jose",
      "authorization_endpoint":
        "https://op.umu.se/openid/authorization",
      "client_registration_types_supported": [
        "automatic",
        "explicit"
      ],
      "request_parameter_supported": true,
      "grant_types_supported": [
        "authorization_code",
        "implicit",
        "urn:ietf:params:oauth:grant-type:jwt-bearer"
      ],
      "id_token_signing_alg_values_supported": [
        "ES256", "RS256"
      ],
      "logo_uri":
        "https://www.umu.se/img/umu-logo-left-neg-SE.svg",
      "op_policy_uri":
        "https://www.umu.se/en/website/legal-information/",
      "response_types_supported": [
        "code",
        "code id_token",
        "token"
      ],
      "subject_types_supported": [
        "pairwise",
        "public"
      ],
      "token_endpoint": "https://op.umu.se/openid/token",
      "federation_registration_endpoint":
        "https://op.umu.se/openid/fedreg",
      "token_endpoint_auth_methods_supported": [
        "client_secret_post",
        "client_secret_basic",
        "client_secret_jwt",
        "private_key_jwt"
      ]
    }
  }
}
]]></artwork>
          </figure>
          <t>
            The <spanx style="verb">authority_hints</spanx> points to the
            Intermediate Entity <spanx style="verb">https://umu.se</spanx>.
            So that is the next step.
          </t>
          <t>
            This Entity Configuration is the first link in the Trust Chain.
          </t>
        </section>

        <section title="Entity Configuration for https://umu.se">
          <t>The LIGO RP fetches the Entity Configuration from
            https://umu.se using the process defined in
            <xref target="federation_configuration"/>.
          </t>
          <figure>
	    <preamble>
	      The request will look like this:
	    </preamble>
	    <name>
	      Entity Configuration Issued by https://umu.se
	    </name>
            <artwork><![CDATA[
GET /.well-known/openid-federation HTTP/1.1
Host: umu.se
]]></artwork>
          </figure>
          <figure>
	    <preamble>
	      And the GET will return:
	    </preamble>
	    <name>
	      Entity Configuration JWT Claims Set
	    </name>
            <artwork><![CDATA[
{
  "authority_hints": [
    "https://swamid.se"
  ],
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://umu.se",
  "sub": "https://umu.se",
  "jwks": {
    "keys": [
      {
        "e": "AQAB",
        "kid": "endwNUZrNTJsX2NyQlp4bjhVcTFTTVltR2gxV2RV...",
        "kty": "RSA",
        "n": "vXdXzZwQo0hxRSmZEcDIsnpg-CMEkor50SOG-1XUlM..."
      }
    ]
  },
  "metadata": {
    "federation_entity": {
      "contacts": "ops@umu.se",
      "federation_fetch_endpoint": "https://umu.se/oidc/fedapi",
      "homepage_uri": "https://www.umu.se",
      "organization_name": "UmU"
    }
  }
}
]]></artwork>
          </figure>
          <t>
            The only piece of information that is used from this Entity Configuration
            in this process is
            the <spanx style="verb">federation_fetch_endpoint</spanx>,
            which is used in the next step.
          </t>
        </section>

        <section
                title="Subordinate Statement Published by https://umu.se about https://op.umu.se">
          <t>
            The RP uses the fetch endpoint provided by https://umu.se,
            as defined in <xref target="fetch_statement"/>,
            to fetch information about
            https://op.umu.se.
          </t>
          <figure>
	    <preamble>
	      The request will look like this:
	    </preamble>
	    <name>
	      Request Subordinate Statement from https://umu.se about https://op.umu.se
	    </name>
            <artwork><![CDATA[
GET /oidc/fedapi?sub=https%3A%2F%2Fop.umu.se&
iss=https%3A%2F%2Fumu.se HTTP/1.1
Host: umu.se
]]></artwork>
          </figure>
          <figure>
	    <preamble>
	      And the result is this:
	    </preamble>
	    <name>
	      Subordinate Statement Issued by https://umu.se about https://op.umu.se
	    </name>
            <artwork><![CDATA[
{
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://umu.se",
  "sub": "https://op.umu.se",
  "source_endpoint": "https://umu.se/oidc/fedapi",
  "jwks": {
    "keys": [
      {
        "e": "AQAB",
        "kid": "dEEtRjlzY3djcENuT01wOGxrZlkxb3RIQVJlMTY0...",
        "kty": "RSA",
        "n": "x97YKqc9Cs-DNtFrQ7_vhXoH9bwkDWW6En2jJ044yH..."
      }
    ]
  },
  "metadata_policy": {
    "openid_provider": {
      "contacts": {
        "add": [
          "ops@swamid.se"
        ]
      },
      "organization_name": {
        "value": "University of Umeå"
      },
      "subject_types_supported": {
        "value": [
          "pairwise"
        ]
      },
      "token_endpoint_auth_methods_supported": {
        "default": [
          "private_key_jwt"
        ],
        "subset_of": [
          "private_key_jwt",
          "client_secret_jwt"
        ],
        "superset_of": [
          "private_key_jwt"
        ]
      }
    }
  }
}
]]></artwork>
          </figure>
          <t>
            This Subordinate Statement is the second link in the Trust Chain.
          </t>
        </section>

        <section title="Entity Configuration for https://swamid.se">
          <t>The LIGO Wiki RP fetches the Entity Configuration from
            https://swamid.se using the process defined in
            <xref target="federation_configuration"/>.
          </t>
          <figure>
	    <preamble>
	      The request will look like this:
	    </preamble>
	    <name>
	      Request Entity Configuration from https://swamid.se
	    </name>
            <artwork><![CDATA[
GET /.well-known/openid-federation HTTP/1.1
Host: swamid.se
]]></artwork>
          </figure>
          <figure>
	    <preamble>
	      And the GET will return:
	    </preamble>
	    <name>
	      Entity Configuration Issued by https://swamid.se
	    </name>
            <artwork><![CDATA[
{
  "authority_hints": [
    "https://edugain.geant.org"
  ],
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://swamid.se",
  "sub": "https://swamid.se",
  "jwks": {
    "keys": [
      {
        "e": "AQAB",
        "kid": "N1pQTzFxUXZ1RXVsUkVuMG5uMnVDSURGRVdhUzdO...",
        "kty": "RSA",
        "n": "3EQc6cR_GSBq9km9-WCHY_lWJZWkcn0M05TGtH6D9S..."
      }
    ]
  },
  "metadata": {
    "federation_entity": {
      "contacts": "ops@swamid.se",
      "federation_fetch_endpoint":
        "https://swamid.se/fedapi",
      "homepage_uri": "https://www.sunet.se/swamid/",
      "organization_name": "SWAMID"
    }
  }
}
]]></artwork>
          </figure>
          <t>
            The only piece of information that is used from this Entity Configuration
            in this process is
            the <spanx style="verb">federation_fetch_endpoint</spanx>,
            which is used in the next step.
          </t>
        </section>

        <section
                title="Subordinate Statement Published by https://swamid.se about https://umu.se">
          <t>
            The LIGO Wiki RP uses the fetch endpoint provided by
            https://swamid.se as defined in
            <xref target="fetch_statement"/>
            to fetch information about
            https://umu.se.
          </t>
          <figure>
	    <preamble>
	      The request will look like this:
	    </preamble>
	    <name>
	      Request to https://swamid.se for Subordinate Statement about https://umu.se
	    </name>
            <artwork><![CDATA[
GET /fedapi?sub=https%3A%2F%2Fumu.se&
iss=https%3A%2F%2Fswamid.se HTTP/1.1
Host: swamid.se
]]></artwork>
          </figure>

          <figure>
	    <preamble>
	      And the result is this:
	    </preamble>
	    <name>
	      Subordinate Statement Issued by https://swamid.se about https://umu.se
	    </name>
            <artwork><![CDATA[
{
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://swamid.se",
  "sub": "https://umu.se",
  "source_endpoint": "https://swamid.se/fedapi",
  "jwks": {
    "keys": [
      {
        "e": "AQAB",
        "kid": "endwNUZrNTJsX2NyQlp4bjhVcTFTTVltR2gxV2RV...",
        "kty": "RSA",
        "n": "vXdXzZwQo0hxRSmZEcDIsnpg-CMEkor50SOG-1XUlM..."
      }
    ]
  },
  "metadata_policy": {
    "openid_provider": {
      "id_token_signing_alg_values_supported": {
        "subset_of": [
          "RS256",
          "ES256",
          "ES384",
          "ES512"
        ]
      },
      "token_endpoint_auth_methods_supported": {
        "subset_of": [
          "client_secret_jwt",
          "private_key_jwt"
        ]
      },
      "userinfo_signing_alg_values_supported": {
        "subset_of": [
          "ES256",
          "ES384",
          "ES512"
        ]
      }
    }
  }
}
]]></artwork>
          </figure>
          <t>
            This Subordinate Statement is the third link in the Trust Chain.
          </t>
          <t>
            If we assume that the issuer of this Subordinate Statement is not in the
            list of Trust Anchors the LIGO Wiki RP has access to, we have to go
            one step further.
          </t>
        </section>

        <section title="Entity Configuration for https://edugain.geant.org">
          <t>The RP fetches the Entity Configuration from
            https://edugain.geant.org using the process defined in
            <xref target="federation_configuration"/>.
          </t>
          <figure>
	    <preamble>
	      The request will look like this:
	    </preamble>
	    <name>
	      Entity Configuration Requested from https://edugain.geant.org
	    </name>
            <artwork><![CDATA[
GET /.well-known/openid-federation HTTP/1.1
Host: edugain.geant.org
]]></artwork>
          </figure>
          <figure>
	    <preamble>
	      And the GET will return:
	    </preamble>
	    <name>
	      Entity Configuration issued by https://edugain.geant.org
	    </name>
            <artwork><![CDATA[
{
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://edugain.geant.org",
  "sub": "https://edugain.geant.org",
  "jwks": {
    "keys": [
      {
        "e": "AQAB",
        "kid": "Sl9DcjFxR3hrRGdabUNIR21KT3dvdWMyc2VUM2Fr...",
        "kty": "RSA",
        "n": "xKlwocDXUw-mrvDSO4oRrTRrVuTwotoBFpozvlq-1q..."
      }
    ]
  },
  "metadata": {
    "federation_entity": {
      "federation_fetch_endpoint": "https://geant.org/edugain/api"
    }
  }
}
]]></artwork>
          </figure>
          <t>
            Within the Trust Anchor Entity Configuration, the Relying Party
            looks for the <spanx style="verb">federation_fetch_endpoint</spanx>
            and gets the updated Federation Entity Keys of the Trust Anchor.
            Each Entity within a
            Federation may change their Federation Entity Keys,
            or any other attributes, at any time. See
            <xref target="key_rollover_anchor"/> for further details.
          </t>
        </section>

        <section title="Subordinate Statement Published by https://edugain.geant.org about https://swamid.se">
          <t>
            The LIGO Wiki RP uses the fetch endpoint of
            https://edugain.geant.org as
            defined in <xref target="fetch_statement"/>
            to fetch information about
            "https://swamid.se".
          </t>
          <figure>
          <preamble>
	    The request will look like this:
	  </preamble>
          <name>
             Request to https://edugain.geant.org for Subordinate Statement about https://swamid.se
          </name>
            <artwork><![CDATA[
GET /edugain/api?sub=https%3A%2F%2Fswamid.se&
iss=https%3A%2F%2Fedugain.geant.org HTTP/1.1
Host: geant.org
]]></artwork>
          </figure>
          <figure>
	    <preamble>
	      And the result is this:
	    </preamble>
	    <name>
	      Subordinate Statement issued by https://edugain.geant.org about https://swamid.se
	    </name>
            <artwork><![CDATA[
{
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://edugain.geant.org",
  "sub": "https://swamid.se",
  "source_endpoint": "https://edugain.geant.org/edugain/api",
  "jwks": {
    "keys": [
      {
        "e": "AQAB",
        "kid": "N1pQTzFxUXZ1RXVsUkVuMG5uMnVDSURGRVdhUzdO...",
        "kty": "RSA",
        "n": "3EQc6cR_GSBq9km9-WCHY_lWJZWkcn0M05TGtH6D9S..."
      }
    ]
  },
  "metadata_policy": {
    "openid_provider": {
      "contacts": {
        "add": "ops@edugain.geant.org"
      }
    },
    "openid_relying_party": {
      "contacts": {
        "add": "ops@edugain.geant.org"
      }
    }
  }
}
]]></artwork>
          </figure>
          <t>
            If we assume that the issuer of this statement appears in the list
            of Trust Anchors the LIGO Wiki RP has access to,
	    this Subordinate Statement would be the fourth link in the Trust Chain.
	    The Trust Anchor's Entity Configuration MAY also be included in
	    the Trust Chain; in this case, it would the fifth and final link.
          </t>
          <t>
	    We now have retrieved all the members of the Trust Chain.
	    Recapping, these Entity Statements were obtained:
            <list style="symbols">
              <t>
		Entity Configuration for the Leaf Entity https://op.umu.se
		- the first link in the Trust Chain
	      </t>
              <t>
		Entity Configuration for https://umu.se
		- not included in the Trust Chain
	      </t>
              <t>
		Subordinate Statement issued by https://umu.se about https://op.umu.se
		- the second link in the Trust Chain
	      </t>
              <t>
		Entity Configuration for https://swamid.se
		- not included in the Trust Chain
	      </t>
              <t>
		Subordinate Statement issued by https://swamid.se about https://umu.se
		- the third link in the Trust Chain
	      </t>
              <t>
		Entity Configuration for https://edugain.geant.org
		- optionally, the fifth and last link in the Trust Chain
	      </t>
              <t>
		Subordinate Statement issued by https://edugain.geant.org about https://swamid.se
		- the fourth link in the Trust Chain
	      </t>
            </list>
          </t>
          <t>
            Using the public keys of the Trust Anchor that the LIGO Wiki RP has
            been
            provided within some secure out-of-band way, it can now verify the
            Trust Chain as described in
            <xref target="trust_chain_validation"/>.
          </t>
        </section>

        <section title="Verified Metadata for https://op.umu.se">
          <t>Having verified the chain, the LIGO Wiki RP can proceed with the
            next step.
          </t>
          <figure>
	    <preamble>
	      Combining the metadata policies from the three Subordinate Statements we
	      have by
	      a Superior about its Subordinate and applying the combined policy
	      to the
	      metadata statement that the Leaf Entity presented, we get:
	    </preamble>
	    <name>
	      Final Metadata Derived from Trust Chain by Applying Metadata Policies
	    </name>
            <artwork><![CDATA[
{
  "authorization_endpoint":
    "https://op.umu.se/openid/authorization",
  "claims_parameter_supported": false,
  "contacts": [
    "ops@swamid.se"
  ],
  "federation_registration_endpoint":
    "https://op.umu.se/openid/fedreg",
  "client_registration_types_supported": [
    "automatic",
    "explicit"
  ],
  "grant_types_supported": [
    "authorization_code",
    "implicit",
    "urn:ietf:params:oauth:grant-type:jwt-bearer"
  ],
  "id_token_signing_alg_values_supported": [
    "RS256",
    "ES256"
  ],
  "issuer": "https://op.umu.se/openid",
  "signed_jwks_uri": "https://op.umu.se/openid/jwks.jose",
  "logo_uri":
    "https://www.umu.se/img/umu-logo-left-neg-SE.svg",
  "organization_name": "University of Umeå",
  "op_policy_uri":
    "https://www.umu.se/en/website/legal-information/",
  "request_parameter_supported": true,
  "request_uri_parameter_supported": true,
  "require_request_uri_registration": true,
  "response_types_supported": [
    "code",
    "code id_token",
    "token"
  ],
  "subject_types_supported": [
    "pairwise"
  ],
  "token_endpoint": "https://op.umu.se/openid/token",
  "token_endpoint_auth_methods_supported": [
    "private_key_jwt",
    "client_secret_jwt"
  ]
}

]]></artwork>
          </figure>
          <t>
            We have now reached the end of the Provider Discovery process.
          </t>
        </section>
      </section>
    </section>

      <section anchor="ClientRegExample" title="The Two Ways of Doing Client Registration">
        <t>
          As described in
          <xref target="client_registration"/>,
          there are two
          ways that can be used to do client registration:
          <list style="hanging">
            <t hangText="Automatic">
              <vspace/>
              No negotiation between the RP and the OP is made regarding
              what features the client SHOULD use in future communication are
              done. The RP's published metadata filtered by the chosen Trust Chain's
              metadata policies defines the metadata that is to be used.
            </t>
            <t hangText="Explicit">
              <vspace/>
              The RP will access the
              <spanx style="verb">federation_registration_endpoint</spanx>,
              which provides the RP's metadata. The OP MAY return a
              metadata policy that adds restrictions over and above what the
              Trust Chain already has defined.
            </t>
          </list>
        </t>

        <section title="RP Sends Authentication Request (Automatic Client Registration)" anchor="AutomaticRegExample">
          <t>
            The LIGO Wiki RP does not do any registration but goes directly to
            sending an Authentication Request.
          </t>
          <figure>
	    <preamble>
	      Here is an example of such an Authentication Request:
	    </preamble>
	    <name>
	      Authentication Request Using Automatic Client Registration
	    </name>
            <artwork><![CDATA[
GET /openid/authorization?
  request=eyJhbGciOiJSUzI1NiIsImtpZCI6ImRVTjJhMDF3Umtoa1NXc
    GxRVGh2Y1ZCSU5VSXdUVWRPVUZVMlRtVnJTbWhFUVhnelpYbHBUemRR
    TkEifQ.eyJyZXNwb25zZV90eXBlIjogImNvZGUiLCAic2NvcGUiOiAi
    b3BlbmlkIHByb2ZpbGUgZW1haWwiLCAiY2xpZW50X2lkIjogImh0dHB
    zOi8vd2lraS5saWdvLm9yZyIsICJzdGF0ZSI6ICIyZmY3ZTU4OS0zOD
    Q4LTQ2ZGEtYTNkMi05NDllMTIzNWU2NzEiLCAibm9uY2UiOiAiZjU4M
    WExODYtYWNhNC00NmIzLTk0ZmMtODA0ODQwODNlYjJjIiwgInJlZGly
    ZWN0X3VyaSI6ICJodHRwczovL3dpa2kubGlnby5vcmcvb3BlbmlkL2N
    hbGxiYWNrIiwgImlzcyI6ICIiLCAiaWF0IjogMTU5MzU4ODA4NSwgIm
    F1ZCI6ICJodHRwczovL29wLnVtdS5zZSJ9.cRwSFNcDx6VsacAQDcIx
    5OAt_Pj30I_uUKRh04N4QJd6MZ0f50sETRv8uspSt9fMa-5yV3uzthX
    _v8OtQrV33gW1vzgOSRCdHgeCN40StbzjFk102seDwtU_Uzrcsy7KrX
    YSBp8U0dBDjuxC6h18L8ExjeR-NFjcrhy0wwua7Tnb4QqtN0QCia6DD
    8QBNVTL1Ga0YPmMdT25wS26wug23IgpbZB20VUosmMGgGtS5yCI5AwK
    Bhozv-oBH5KxxHzH1Oss-RkIGiQnjRnaWwEOTITmfZWra1eHP254wFF
    2se-EnWtz1q2XwsD9NSsOEJwWJPirPPJaKso8ng6qrrOSgw
  &response_type=code
  &client_id=https%3A%2F%2Fwiki.ligo.org
  &redirect_uri=https%3A%2F%2Fwiki.ligo.org/openid/callback
  &scope=openid+profile+email
  HTTP/1.1
Host: op.umu.se
]]></artwork>
          </figure>
          <t>
            The OP receiving this Authentication Request will, unless the
            RP is already registered, start to dynamically fetch
            and
            establish trust with the RP.
          </t>

          <section title="OP Fetches Entity Statements">
            <t>
              The OP needs to establish a Trust Chain for the RP
              (wiki.ligo.org).
              The OP in this example is configured with public keys of two
              federations:
              <list style="symbols">
                <t>https://edugain.geant.org</t>
                <t>https://swamid.se</t>
              </list>
            </t>
            <t>
              The OP starts to resolve metadata for the Client Identifier
              https://wiki.ligo.org by fetching the Entity Configuration
              using
              the process described in <xref target="federation_configuration"/>.
            </t>
            <t>
              The process is the same as described in
              <xref target="op_discovery"/>
              and will result in a Trust Chain with the following Entity Statements:
              <list style="numbers">
                <t>Entity Configuration for the Leaf Entity
                  https://wiki.ligo.org
                </t>
                <t>Subordinate Statement issued by https://incommon.org about
                  https://wiki.ligo.org
                </t>
                <t>Subordinate Statement issued by https://edugain.geant.org about
                  https://incommon.org
                </t>
              </list>
            </t>
          </section>

          <section title="OP Evaluates the RP Metadata"
                   anchor="rp_metadata_eval">
            <t>
              Using the public keys of the Trust Anchor that the LIGO Wiki RP
              has
              been
              provided within some secure out-of-band way, it can now verify
              the
              Trust Chain as described in
              <xref target="trust_chain_validation"/>.
            </t>
            <t>
              We will not list the complete Entity Statements but only the
              <spanx style="verb">metadata</spanx>
              and <spanx style="verb">metadata_policy</spanx> parts.
              There are two metadata policies:
              <list style="hanging">
                <t hangText="edugain.geant.org:">
                  <figure>
		    <name>
		      Metadata Policies Related to Multiple Metadata Types
		    </name>
                    <artwork><![CDATA[
"metadata_policy": {
  "openid_provider": {
    "contacts": {
      "add": "ops@edugain.geant.org"
    }
  },
  "openid_relying_party": {
    "contacts": {
      "add": "ops@edugain.geant.org"
    }
  }
}
]]></artwork>
                  </figure>
                </t>
              </list>
            </t>
            <t>
              <list style="hanging">
                <t hangText="incommon.org:">
                  <figure>
		    <name>
		      Metadata Policy Related to the RP
		    </name>
                    <artwork><![CDATA[
"metadata_policy": {
  "openid_relying_party": {
    "application_type": {
      "one_of": [
        "web",
        "native"
      ]
    },
    "contacts": {
      "add": "ops@incommon.org"
    },
    "grant_types": {
      "subset_of": [
        "authorization_code",
        "refresh_token"
      ]
    }
  }
}
]]></artwork>
                  </figure>
                </t>
              </list>
            </t>
            <figure>
	      <preamble>
		Next, combine these and apply them to the metadata for wiki.ligo.org:
	      </preamble>
	      <name>
		Combined Metadata with Metadata Policy yet to be applied
	      </name>
              <artwork><![CDATA[
"metadata": {
  "openid_relying_party": {
    "application_type": "web",
    "client_name": "LIGO Wiki",
    "contacts": [
      "ops@ligo.org"
    ],
    "grant_types": [
      "authorization_code",
      "refresh_token"
    ],
    "id_token_signed_response_alg": "RS256",
    "signed_jwks_uri": "https://wiki.ligo.org/jwks.jose",
    "redirect_uris": [
      "https://wiki.ligo.org/openid/callback"
    ],
    "response_types": [
      "code"
    ],
    "subject_type": "public"
  }
}
]]></artwork>
            </figure>
            <figure>
	      <preamble>
		The final result is:
	      </preamble>
	      <name>
		Final Metadata After Metadata Policy has been Applied
	      </name>
              <artwork><![CDATA[
"metadata": {
  "openid_relying_party": {
    "application_type": "web",
    "client_name": "LIGO Wiki",
    "contacts": [
      "ops@ligo.org",
      "ops@edugain.geant.org",
      "ops@incommon.org"
    ],
    "grant_types": [
      "refresh_token",
      "authorization_code"
    ],
    "id_token_signed_response_alg": "RS256",
    "signed_jwks_uri": "https://wiki.ligo.org/jwks.jose",
    "redirect_uris": [
      "https://wiki.ligo.org/openid/callback"
    ],
    "response_types": [
      "code"
    ],
    "subject_type": "public"
  }
}
]]></artwork>
            </figure>
            <t>
              Once the Trust Chain and the final Relying Party metadata
              have been obtained, the OpenID Provider has
              everything needed to validate the signature of the
              Request Object in the Authentication Request, using the
              public keys made available at the
              <spanx style="verb">signed_jwks_uri</spanx> endpoint.
            </t>
          </section>
        </section>

        <section title="RP Starts with Client Registration (Explicit Client Registration)" anchor="ExplicitRegExample">
          <t>
            Here the LIGO Wiki RP sends an Explicit Registration request to the
            <spanx style="verb">federation_registration_endpoint</spanx>
            of the OP (op.umu.se). The request contains the RP's Entity Configuration.
          </t>
	  <figure>
	    <preamble>
	      An example JWT Claims Set for the RP's Entity Configuration is:
	    </preamble>
	    <name>
	      RP's Entity Configuration JWT Claims Set
	    </name>
	    <artwork><![CDATA[
{
  "iss": "https://wiki.ligo.org",
  "sub": "https://wiki.ligo.org",
  "iat": 1676045527,
  "exp": 1676063610,
  "aud": "https://op.umu.se",
  "metadata": {
    "openid_relying_party": {
      "application_type": "web",
      "client_name": "LIGO Wiki",
      "contacts": ["ops@ligo.org"],
      "grant_types": ["authorization_code"],
      "id_token_signed_response_alg": "RS256",
      "signed_jwks_uri": "https://wiki.ligo.org/jwks.jose",
      "redirect_uris": [
        "https://wiki.ligo.org/openid/callback"
      ],
      "response_types": ["code"],
      "subject_type": "public"
    }
  },
  "jwks": {
    "keys": [
      {
        "kty": "RSA",
        "use": "sig",
        "kid":
          "U2JTWHY0VFg0a2FEVVdTaHptVDJsNDNiSDk5MXRBVEtNSFVkeXZwb",
        "e": "AQAB",
        "n":
          "4AZjgqFwMhTVSLrpzzNcwaCyVD88C_Hb3Bmor97vH-2AzldhuVb8K..."
      }
    ]
  },
  "authority_hints": ["https://incommon.org"]
}
]]></artwork>
	  </figure>
          <t>
            The OP receives the RP's Entity Configuration and proceeds with the
            sequence of steps laid out in <xref target="op_discovery"/>.
          </t>
          <t>
            The OP successfully resolves the same RP metadata described in
            <xref target="rp_metadata_eval"/>. It then registers the RP in
            compliance with its own OP metadata and returns the result in a
            registration Entity Statement.
          </t>
          <t>
            Assuming the OP does not support refresh tokens it will register
            the RP for the <spanx style="verb">authorization_code</spanx> grant
            type only. This is reflected in the metadata returned to the RP.
          </t>
          <t>The returned metadata also includes the
            <spanx style="verb">client_id</spanx>, the
            <spanx style="verb">client_secret</spanx> and other parameters that
            the OP provisioned for the RP.
          </t>
          <figure>
	    <preamble>
	      Here is an example JWT Claims Set of the registration Entity Statement returned
	      by the OP to the RP after successful explicit client registration:
	    </preamble>
	    <name>
	      JWT Claims Set of Registration Entity Statement Returned by OP to RP after Explicit Client Registration
	    </name>
            <artwork><![CDATA[
{
  "iss": "https://op.umu.se",
  "sub": "https://wiki.ligo.org",
  "aud": "https://wiki.ligo.org",
  "iat": 1601457619,
  "exp": 1601544019,
  "trust_anchor_id": "https://edugain.geant.org",
  "metadata": {
    "openid_relying_party": {
      "client_id": "m3GyHw",
      "client_secret_expires_at": 1604049619,
      "client_secret":
        "cb44eed577f3b5edf3e08362d47a0dc44630b3dc6ea99f7a79205",
      "client_id_issued_at": 1601457619,
      "application_type": "web",
      "client_name": "LIGO Wiki",
      "contacts": [
        "ops@edugain.geant.org",
        "ops@incommon.org",
        "ops@ligo.org"
      ],
      "grant_types": [
        "authorization_code"
      ],
      "id_token_signed_response_alg": "RS256",
      "signed_jwks_uri": "https://wiki.ligo.org/jwks.jose",
      "redirect_uris": [
        "https://wiki.ligo.org/openid/callback"
      ],
      "response_types": [
        "code"
      ],
      "subject_type": "public"
    }
  },
  "authority_hints": [
    "https://incommon.org"
  ],
  "jwks": {
    "keys": [
      {
        "kty": "RSA",
        "use": "sig",
        "kid":
          "U2JTWHY0VFg0a2FEVVdTaHptVDJsNDNiSDk5MXRBVEtNSFVkeXZwb",
        "e": "AQAB",
        "n":
          "4AZjgqFwMhTVSLrpzzNcwaCyVD88C_Hb3Bmor97vH-2AzldhuVb8K..."
      },
      {
        "kty": "EC",
        "use": "sig",
        "kid": "LWtFcklLOGdrW",
        "crv": "P-256",
        "x": "X2S1dFE7zokQDST0bfHdlOWxOc8FC1l4_sG1Kwa4l4s",
        "y": "812nU6OCKxgc2ZgSPt_dkXbYldG_smHJi4wXByDHc6g"
      }
    ]
  }
}
]]></artwork>
          </figure>
        </section>
      </section>

    <section anchor="Notices" title="Notices">
      <t>
        Copyright (c) 2023 The OpenID Foundation.
      </t>
      <t>
        The OpenID Foundation (OIDF) grants to any Contributor, developer,
        implementer, or other interested party a non-exclusive, royalty free,
        worldwide copyright license to reproduce, prepare derivative works from,
        distribute, perform and display, this Implementers Draft or Final
        Specification solely for the purposes of (i) developing specifications,
        and (ii) implementing Implementers Drafts and Final Specifications based
        on such documents, provided that attribution be made to the OIDF as the
        source of the material, but that such attribution does not indicate an
        endorsement by the OIDF.
      </t>
      <t>
        The technology described in this specification was made available
        from contributions from various sources, including members of the OpenID
        Foundation and others. Although the OpenID Foundation has taken steps to
        help ensure that the technology is available for distribution, it takes
        no position regarding the validity or scope of any intellectual property
        or other rights that might be claimed to pertain to the implementation
        or use of the technology described in this specification or the extent
        to which any license under such rights might or might not be available;
        neither does it represent that it has made any independent effort to
        identify any such rights. The OpenID Foundation and the contributors to
        this specification make no (and hereby expressly disclaim any)
        warranties (express, implied, or otherwise), including implied
        warranties of merchantability, non-infringement, fitness for a
        particular purpose, or title, related to this specification, and the
        entire risk as to implementing this specification is assumed by the
        implementer. The OpenID Intellectual Property Rights policy requires
        contributors to offer a patent promise not to assert certain patent
        claims against other contributors and against implementers. The OpenID
        Foundation invites any interested party to bring to its attention any
        copyrights, patents, patent applications, or other proprietary rights
        that MAY cover technology that MAY be required to practice this
        specification.
      </t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>
        The authors wish to acknowledge the contributions of the following
        individuals and organizations to this specification:
        Pasquale Barbaro,
        Michele D'Amico,
        Andrii Deinega,
        Erick Domingues,
        Heather Flanagan,
        Joseph Heenan,
        Samuel Gulliksson,
        Takahiko Kawasaki,
        Torsten Lodderstedt,
        Francesco Marino,
        Roberto Polli,
        Jouke Roorda,
	Nat Sakimura,
        Mischa Sallé,
        Stefan Santesson,
        Marcos Sanz,
        Peter Brand,
        Michael Schwartz,
        Giada Sciarretta,
        Amir Sharif,
        Kristina Yasuda,
        and
        the JRA3T3 task force of GEANT4-2.
      </t>
    </section>

    <section anchor="History" title="Document History">
      <t>[[ To be removed from the final specification ]]</t>

      <t>
        -32
        <list style="symbols">
          <t>
	    Tightened OpenID Connect Client Registration section.
	  </t>
	  <t>
	    Tightened appendix examples.
	  </t>
          <t>
            Fixed #2075: Trust Mark endpoint for the provisioning of the Trust Marks.
          </t>
	  <t>
            Fixed #2085: Trust Marked Entities Listing,
	    added <spanx style="verb">sub</spanx> urlquery parameter.
          </t>
	  <t>
	    Made fetch issuer unambiguous by making
	    the <spanx style="verb">iss</spanx> parameter REQUIRED.
	  </t>
	  <t>
	    Introduced the term "Subordinate Statement"
	    and applied it throughout the specification.
	    Also consistently use the term "registration Entity Statement" for
	    Explicit Client Registration results.
	  </t>
	  <t>
	    Clarified where Entity Statement claims can and cannot occur.
	  </t>
	  <t>
	    Renamed <spanx style="verb">policy_language_crit</spanx>
	    to <spanx style="verb">metadata_policy_crit</spanx>.
	  </t>
	  <t>
	    Fixed #2093: Numbered the list defining the order policy operators are applied in.
	  </t>
	</list>
      </t>

      <t>
        -31
        <list style="symbols">
          <t>
            Fixed #2068: Clarifications that authority_hints must only appear in Leaf and Intermediate Entity Configurations.
          </t>
	  <t>
	    Fixed #2062: Verified that metadata examples are consistent with the specification.
	  </t>
	  <t>
	    Fixed #1724: Numbered figures by adding captions to them.
	  </t>
	  <t>
	    Fixed #2033: Described the advantage of having the Trust Anchor host the resolve endpoint.
	  </t>
	  <t>
	    Fixed #1659: Described use of the <spanx style="verb">trust_chain</spanx> header parameter in resolve responses.
	  </t>
          <t>
            Addressed #2060: A concrete order must be specified for the application of all metadata policy operators.
          </t>
          <t>
            Addressed #2069: Metadata parameters with null value must be treated as error when applying metadata policies.
          </t>
        <t>
            Fixed #2034: Other use cases of Federation Automatic Registration, FAPI included.
          </t>
	  <t>
	    Moved the definitions of <spanx style="verb">organization_name</spanx>, <spanx style="verb">contacts</spanx>, <spanx style="verb">logo_uri</spanx>, <spanx style="verb">policy_uri</spanx>, and <spanx style="verb">homepage_uri</spanx> from the <spanx style="verb">federation_entity</spanx> Entity Type definition to the set of metadata parameters applicable to all Entity Types.
	  </t>
	  <t>
	    Clarified the role of the Trust Anchor's Entity Configuration in Trust Chains.
	  </t>
	  <t>
	    Fixed #1751: Provided guidance to prevent stuck clients.
	  </t>
	  <t>
	    Fixed #2071: Removed most of the Claims Languages and Scripts text duplicating that in OpenID Connect Core.
	  </t>
	  <t>
	    Tightened descriptions of constraints and Trust Marks.
	  </t>
	  <t>
	    Tightened descriptions of Federation Endpoints.
	  </t>
	  <t>
	    Fixed #2080: Defined <spanx style="verb">federation_historical_keys_endpoint</spanx> metadata parameter.
	  </t>
	  <t>
	    Fixed #2081: Renamed
	    <spanx style="verb">trust_marks_owners</spanx> to
	    <spanx style="verb">trust_mark_owners</spanx> and renamed
	    <spanx style="verb">trust_marks_issuers</spanx> to
	    <spanx style="verb">trust_mark_issuers</spanx>.
	  </t>
	  <t>
	    Fixed #2079: Renamed the <spanx style="verb">id</spanx> Trust Mark status
	    request parameter to <spanx style="verb">trust_mark_id</spanx> to match
	    the parameter names used in Subordinate listing requests and
	    Trust Marked entities listing requests.
	  </t>
        </list>
      </t>

      <t>
	-30
	<list style="symbols">
      <t>
        Clarifies that when the metadata policy combination process encounters an
        error, such as being unable to merge two operators, the policy combination
        MUST be considered invalid.
      </t>
      <t>
        Applications and protocols using Entity Statements MAY specify
        additional claims.
      </t>
      <t>
        Addressed #1655: The definitions of <spanx style="verb">aud</spanx> and
        <spanx style="verb">trust_anchor_id</spanx> are moved to the Explicit
        Client Registration section.
      </t>
      <t>
        Fixed #1957: Explicit Registration: Clarifies OP processing of Explicit
        Registration requests with a trust chain.
      </t>
      <t>
        Addressed #1655: Explicit Registration: Simplifies the expression of
        the registered RP metadata - the metadata policy mechanism is no longer
        used.
      </t>
      <t>
        Addressed #1655: Explicit Registration: An RP MUST always verify the
        metadata it was registered with. The standard Trust Chain resolution
        and application of <spanx style="verb">metadata_policy</spanx> is the
        SHOULD method, but RPs are free to utilize other methods yielding the
        same result, e.g. by calling a helper web endpoint provided by the
        Trust Anchor.
      </t>
      <t>
        Addressed #1655: Explicit Registration: Exact specification of the EC
        claims used in requests and the ES claims used in responses; normative
        language where necessary to remove ambiguities and guarantee interop.
      </t>
      <t>
        Explicit Registration: The <spanx style="verb">exp</spanx> (expiration)
        of the response ES must be the time when the OP is going to
        expire the client registration. Intended to inform the RP when its
        registration is going to expire so that it can re-register in advance
        and prevent stuck end-users if the registration expires in the middle
        of an OAuth flow.
      </t>
      <t>
        Explicit Registration: Replaces the hard requirement that OPs must
        periodically ensure that a valid Trust Chain for the RP can be
        established with non-normative text common to both Automatic and
        Explicit Registration. The Trust Chain expiration MUST be the primary
        method for OPs to control the validity of registrations.
      </t>
      <t>
        Resolving Trust Chain and Metadata: Adds a subsection describing the
        possibility of transient Trust Chain validation errors when the
        topology of a federation is updated and suggests a retry strategy.
      </t>
	  <t>
	    Updated contributor affiliations.
	  </t>
          <t>
            Fixed #1947: Added <spanx style="verb">source_endpoint</spanx> as OPTIONAL in Entity Statement JWS.
          </t>
          <t>
            Historical keys response: <spanx style="verb">iat</spanx> is OPTIONAL.
          </t>
          <t>
	    Added text on Trust Mark delegation.
	  </t>
         <t>
            Fixed #2041: Added normative language mandating the https scheme and any optional port and path, for all the Entity Identifiers and the federation endpoints.
        </t>
	  <t>
	    Cite draft-ietf-oauth-resource-metadata.
	  </t>
         <t>
            Fixed #2002: Added sequence diagrams and representations of the general architecture and the Trust Chain.
        </t>
	  <t>
	    Fixed #2061: Clarified that the <spanx style="verb">constraints</spanx> claim may only appear in statements issued by authorities.
	  </t>
	  <t>
	    Fixed #2062: Require metadata statements for all Entity Type Identifiers that apply to an Entity.
	  </t>
	  <t>
	    Replaced duplicative term "metadata type" with "Entity Type" and
	    defined the term "Entity Type Identifier".
	  </t>
	  <t>
	    Added section headings to the Metadata section to more cleanly separate
	    Entity Type Identifiers from Metadata Extensions.
	  </t>
	  <t>
	    Fixed #2064: Prohibited the use of <spanx style="verb">null</spanx> as a metadata value.
	  </t>
	  <t>
	    Rewrote <spanx style="verb">request_authentication_methods_supported</spanx> description.
	  </t>
	  <t>
	    Registered <spanx style="verb">keys</spanx> JWT claim and
	    <spanx style="verb">iat</spanx>, <spanx style="verb">exp</spanx>, and
	    <spanx style="verb">revoked</spanx> JWK parameters.
	  </t>
	  <t>
            Fixed #1727: Changed specification name from "OpenID Connect Federation" to "OpenID Federation".
	  </t>
        </list>
      </t>

      <t>
        -29
        <list style="symbols">
          <t>
            Fixed #1921: brand new JWS Header parameter, <spanx style="verb">trust_chain</spanx>.
          </t>
          <t>
            Fixed #1879, #1881, #1883, #1885: introductionary text, metadata section, editorials.
          </t>
        </list>
      </t>

      <t>
        -28
        <list style="symbols">
          <t>
            Fixed #1823: Metadata policy clarification text on essential term and sub_set, one_of, superset_of.
          </t>
          <t>
            Listing endpoint - added the parameters <spanx style="verb">trust_marked</spanx> and <spanx style="verb">trust_mark_id</spanx>.
          </t>
          <t>
            Historical keys endpoint, references to rfc7517 and use of claim keys, correction in the normative text.
          </t>
          <t>
            Added the endpoint <spanx style="verb">federation_trust_mark_list_endpoint</spanx> for Trust Mark issuers.
          </t>
        </list>
      </t>

      <t>
        -27
        <list style="symbols">
          <t>
            Fixed #1756: Clarified that the authority_hints in the Entity Statement
            of an explicit registration response is single-valued.
          </t>
          <t>
            Added text about the usage of metadata besides metadata_policy.
          </t>
          <t>
            Fixed #1745 #1746: Non-normative example of Trust Mark status endpoint.
          </t>
          <t>
            Fixed #1747: Client Registration Response content-type set to application/entity-statement+jwt.
          </t>
          <t>
            Fixed #1740: Metadata policy example for OpenID Connect, removed scopes.
          </t>
          <t>
            Fixed #1755: clarification on the key to be used for Federation operations.
          </t>
          <t>
              The "essential" policy operator can be used in conjunction with
              one_of, subset_of, superset_of to make their presence optional.
          </t>
          <t>
            Fixed #1779: Entity Type as defined term.
          </t>
          <t>
            Added Sequence Diagram representing a Federation Entity Discovery and metadata evaluation.
          </t>
          <t>
            Fixed #1757: Federation Historical Keys endpoint support for revocation status. Endpoint enabled for all the Federation Entities.
          </t>
          <t>
            Fixed #1803: Subordinate is a defined term and other small editorial changes after Heather's revision.
          </t>
	  <t>
	    Added Cryptographic Trust Mechanism description.
	  </t>
	  <t>
	    Fixed #1660: Clarified that Explicit Registration uses no parameters and added Explicit Registration example.
	  </t>
	  <t>
	    Fixed #1782: Reference protected resource metadata draft.
	  </t>
	  <t>
	    Fixed #1809: Replaced use of "trust issuers" terminology.
	  </t>
	  <t>
	    Fixed #1661: Tightened descriptions of metadata standards used.
	  </t>
	  <t>
	    Fixed #1801: Better described function of "essential" metadata operator.
	  </t>
        </list>
      </t>

      <t>
        -26
        <list style="symbols">
          <t>
            Applied editorial improvements by Heather Flanagan.
          </t>
        </list>
      </t>

      <t>
        -25
        <list style="symbols">
          <t>
            Fixed #1684: disambiguation on the role federation_entity.
          </t>
          <t>
            Fixed #1703: Unsigned error response.
          </t>
          <t>
            Fixed #1693: Trust mark status endpoint HTTP method changed to POST.
          </t>
          <t>
            Fixed #1681: RS256 is not mandatory anymore for federation operations signatures.
          </t>
          <t>
            Fixed #1701: trust_chain parameter with PAR and redirect_uri.
          </t>
          <t>
            Fixed #1695: entity_type url paramenter for Listing endpoint.
          </t>
          <t>
            Fixed #1712: federation_entity claims: organization_name is recommended, logo_uri is added.
          </t>
          <t>
            Fixed #1702: removal of metadata type trust_mark_issuer, federation_status_endpoint moved in the federation_entity metadata and renamed to federation_trust_mark_status_endpoint.
          </t>
          <t>
            Fixed #1716: Clarified how to retrieve the RP's Entity Configuration when using Automatic Registration.
          </t>
          <t>
            Fixed #1656: Introductionary text review.
          </t>
        </list>
      </t>

      <t>
        -24
        <list style="symbols">
          <t>
            Fixed #1654: Text cleanup on how and who publishes the Entity Configuration.
          </t>
          <t>
            Relaxed JWK Set representations: jwks, signed_jwks_uri and jwks_uri can coexist in the same Metadata for interoperability purposes across different Federations.
          </t>
          <t>
            Fixed #1641: Federation Historical Keys endpoint.
          </t>
          <t>
            Fixed #1673: added resolve endpoint JWT claims.
          </t>
          <t>
            Fixed #1663: clarifications on the http status codes returning from /.well-known/openid-federation.
          </t>
          <t>
            Fixed #1667: serialization format for federation endpoint made explicit.
          </t>
          <t>
            Fixed #1662: ID Token section removed.
          </t>
          <t>
            Fixed #1680: removal of the claim operation in Generic Errors.
          </t>
          <t>
            Fixed #1669: error types in the section Generic Error Response.
          </t>
          <t>
            Added Vladimir Dzhuvinov as an editor.
          </t>
        </list>
      </t>

      <t>
        -23
        <list style="symbols">
          <t>
            Text on max_path_length
          </t>
          <t>
            Fixed #1634: Trust Chain explanatory text.
          </t>
          <t>
            Federation Entity Discovery as defined term.
          </t>
          <t>
            Fixed #1645: Federation Entity Keys as defined term.
          </t>
          <t>
            Fixed #1633: Explaination text about who signs the Trust Mark and how.
          </t>
          <t>
            Fixed #1650: typo in signed_jws_uri and jwks metadata claims.
          </t>
        </list>
      </t>

      <t>
        -22
        <list style="symbols">
          <t>
            Rewritten text about metadata processing when doing Explicit Client Registration.
          </t>
          <t>
            Fixed #1581: OP metadata claims enabled for AS.
          </t>
          <t>
            Fixed #1594: self-issued trust_chain in the Authorization Request.
          </t>
          <t>
            Fixed #1583: metadata policy one_of operator, explanatory text for multiple values.
          </t>
          <t>
            Fixed #1584: Stated that domain name constraints are as specified in Section 4.2.1.10 of <xref target="RFC5280"/>.
          </t>
          <t>
            Added more text on considerations when using the resolve endpoint.
          </t>
          <t>
            Removal of aud parameter in the fetch endpoint request.
          </t>
          <t>
            General rewording with the terms Leaf Entity and Entity Configuration.
          </t>
          <t>
            Fixed #1588: Explicitly described the differences between Automatic and Explicit Registration.
          </t>
          <t>
            Fixed #1606: Described situation in which the requirement for signed requests with Automatic Registration could be relaxed.
          </t>
          <t>
            Fixed #1629: authz Request Object, audience explanatory text.
          </t>
          <t>
            Fixed #1630: Resolve endpoint response content type.
          </t>
          <t>
            Fixed #1608: submission of the Trust Chain in the Explicit Client Registration Request.
          </t>
        </list>
      </t>

      <t>
        -21
        <list style="symbols">
          <t>
            Fixed #1547: Metadata section restructured.
          </t>
          <t>
            Fixed #1548: request_authentication_signing_alg_values_supported clarification text about the usage of private_key_jwt and request_object.
          </t>
          <t>
            Added a new constraint, allowed_leaf_entity_types.
          </t>
          <t>
            Resolve endpoint: Removed iss paramenter in the request and specified the usage of the aud claim in the response.
          </t>
          <t>
            Fixed #1513: request_authentication_methods_supported according to IANA OAuth 2.0 AS metadata registered names.
          </t>
          <t>
            Fixed #1527: Defined the Trust Mark term and added non-normative examples.
          </t>
          <t>
            Added Security Considerations regarding the role of the Trust Marks.
          </t>
          <t>
            Editorial review, normative language, and typos.
          </t>
          <t>
            Fixed #1535: Removed the sub claim from the non-normative example of the Authorization Request Object.
          </t>
          <t>
            Fixed #1528: Added Claims Languages and Scripts section.
          </t>
          <t>
            Fixed #1456: Added language about space-delimited string parameters from RFC 6749.
          </t>
        </list>
      </t>

      <t>
        -20
        <list style="symbols">
          <t>
            Updated example for Resolve endpoint.
          </t>
          <t>
            Recommended that Key IDs be the JWK Thumbprint of the key.
          </t>
          <t>
            Fixed #1502 - Corrected usage of <spanx style="verb">id_token_signed_response_alg</spanx>.
          </t>
          <t>
            Fixed #1506 - Referenced RFC 9126 for Pushed Authorization Requests.
          </t>
          <t>
            Added Giuseppe De Marco as an editor and removed Samuel Gulliksson as an editor.
          </t>
          <t>
            Fixed #1508 - Editorial review.
          </t>
          <t>
            Fixed #1505 - Defined that <spanx style="verb">signed_jwks_uri</spanx> is preferred over
            <spanx style="verb">jwks_uri</spanx> and <spanx style="verb">jwks</spanx>.
          </t>
          <t>
            Fixed #1514 - Corrected RP metadata examples to use <spanx style="verb">id_token_signed_response_alg</spanx>.
          </t>
          <t>
            Fixed #1512 - Registered the error codes <spanx style="verb">missing_trust_anchor</spanx>
            and <spanx style="verb">validation_failed</spanx>.
          </t>
          <t>
            Also registered the OP Metadata parameters
            <spanx style="verb">organization_name</spanx>,
            <spanx style="verb">request_authentication_methods_supported</spanx>,
            <spanx style="verb">request_authentication_signing_alg_values_supported</spanx>,
            <spanx style="verb">signed_jwks_uri</spanx>,
            and
            <spanx style="verb">jwks</spanx>
            and the RP Metadata parameters
            <spanx style="verb">client_registration_types</spanx> (which was previously misregistered as <spanx style="verb">client_registration_type</spanx>),
            <spanx style="verb">organization_name</spanx>,
            and
            <spanx style="verb">signed_jwks_uri</spanx>.
          </t>
          <t>
            Defined the term Federation Operator and described redundant retrieval of Trust Anchor keys.
          </t>
          <t>
            Fixed #1519 - Corrected instances of <spanx style="verb">client_registration_type</spanx>
            to <spanx style="verb">client_registration_types_supported</spanx>.
          </t>
          <t>
            Fixed #1520 - Renamed <spanx style="verb">federation_api_endpoint</spanx>
            to <spanx style="verb">federation_fetch_endpoint</spanx>.
          </t>
          <t>
            Fixed #1521 - Changed swamid.sunet.se to swamid.se in examples.
          </t>
          <t>
            Fixed #1523 - Added <spanx style="verb">request_parameter_supported</spanx> to examples.
          </t>
          <t>
            Capitalized defined terms.
          </t>
        </list>
      </t>

      <t>
        -19
        <list style="symbols">
          <t>
            Fixed #1497 - Removed <spanx style="verb">trust_mark</spanx> claim from federation entity metadata.
          </t>
          <t>
            Fixed #1446 - Added <spanx style="verb">trust_chain</spanx> and removed <spanx style="verb">is_leaf</spanx>.
          </t>
          <t>
            Fixed #1479 - Added <spanx style="verb">jwks</spanx> claim in OP metadata.
          </t>
          <t>
            Fixed #1477 - Added <spanx style="verb">request_authentication_methods_supported</spanx>.
          </t>
          <t>
            Fixed #1474 - Added the <spanx style="verb">request_authentication_signing_alg_values_supported</spanx> OP metadata parameter.
          </t>
          <t>
            Rewrote <spanx style="verb">trust_marks</spanx> definition.
          </t>
        </list>
      </t>

      <t>
        -18
        <list style="symbols">
          <t>
            Added the jwks claim name for OP Metadata.
          </t>
          <t>
            Moved from a federation API to separate endpoints per operation.
          </t>
          <t>
            Added descriptions of the list, resolve and status federation endpoints.
          </t>
          <t>
            Registered the <spanx style="verb">client_registration_types_supported</spanx> and
            <spanx style="verb">federation_registration_endpoint</spanx>
            authorization server metadata parameters.
          </t>
          <t>
            Registered the <spanx style="verb">client_registration_type</spanx>
            dynamic client registration parameter.
          </t>
          <t>
            Registered and used the <spanx style="verb">application/entity-statement+jwt</spanx> media type.
          </t>
          <t>
            Registered the <spanx style="verb">application/trust-mark+jwt</spanx> media type.
          </t>
          <t>
            Trust marks: the claim <spanx style="verb">mark</spanx> has been renamed to <spanx style="verb">logo_uri</spanx>.
          </t>
          <t>
            New federation endpoint: Resolve Entity Statement.
          </t>
          <t>
            New federation endpoint: Trust Mark Status.
          </t>
          <t>
            Federation API, Fetch: <spanx style="verb">iss</spanx> parameter is optional.
          </t>
          <t>
            Trust Marks: added non-normative examples.
          </t>
          <t>
            Expanded Section 8.1: Included Entity configurations.
          </t>
          <t>
            Fixed #1373 - More clearly defined the term Entity Statement,
            both in the Terminology section and in the Entity Statement section.
          </t>
        </list>
      </t>
      <t>
        -17
        <list style="symbols">
          <t>
            Addressed many working group review comments.
            Changes included adding the Overall Architecture section,
            the <spanx style="verb">trust_marks_issuers</spanx> claim,
            and the Setting Up a Federation section.
          </t>
        </list>
      </t>
      <t>
        -16
        <list style="symbols">
          <t>
            Added Security Considerations section on Denial-of-Service attacks.
          </t>
        </list>
      </t>
      <t>
        -15
        <list style="symbols">
          <t>
            Added <spanx style="verb">signed_jwks_uri</spanx>,
            which had been lost somewhere along the road.
          </t>
        </list>
      </t>
      <t>
        -14
        <list style="symbols">
          <t>
            Rewrote the federation policy section.
          </t>
          <t>
            What previously was referred to as
            <spanx style="verb">client authentication</spanx> in connection
            with automatic client registration is now changed to be
            <spanx style="verb">request authentication</spanx>.
          </t>
          <t>
            Made a distinction between parameters and claims.
          </t>
          <t>
            Corrected the description of the intended behavior when
            <spanx style="verb">essential</spanx> is absent.
          </t>
        </list>
      </t>
      <t>
        -13
        <list style="symbols">
          <t>
            Added 'trust_marks' as a parameter in the Entity Statement.
          </t>
          <t>
            An RP's self-signed Entity Statement MUST have the OP's issuer
            identifier
            as the value of 'aud'.
          </t>
          <t>
            Added RS256 as default signing algorithm for Entity Statements.
          </t>
          <t>
            Specified that the value of 'aud' in the Entity Statement use in
            automatic client registration MUST have the ASs authorization
            endpoint
            URL as value. Also, the 'sub' claim MUST NOT be present.
          </t>
          <t>
            Separating the usage of merge and combine as proposed by Vladimir
            Dzhuvinov in Bitbucket issue #1157.
          </t>
          <t>
            An RP doing only explicit client registration are not required to
            publish and support a
            <spanx style="verb">/.well-known/openid-federation</spanx>.
          </t>
          <t>
            Every key in a JWK Set in an Entity Statement MUST have a kid.
          </t>
        </list>
        -12
        <list style="symbols">
          <t>
            Made JWK Set OPTIONAL in an Entity Statement returned by OP as response
            of an explicit client registration
          </t>
          <t>
            Renamed Entity type to client registration type.
          </t>
          <t>
            Added more text describing
            client_registration_auth_methods_supported.
          </t>
          <t>
            Made "Processing the Authentication Request" into two separate
            sections:
            one for Authentication Request and one for Pushed Authorization
            Request.
          </t>
          <t>
            Added example of URLs to some examples in the appendix.
          </t>
          <t>
            Changed the automatic client registration example in the appendix to
            use
            Request Object instead of a client_assertion.
          </t>
        </list>
      </t>
      <t>
        -11
        <list style="symbols">
          <t>
            Added section on Trust Marks.
          </t>
          <t>
            Clarified private_key_jwt usage in the authentication request.
          </t>
          <t>
            Fixed Bitbucket issues #1150 and #1155 by Vladimir Dzhuvinov.
          </t>
          <t>
            Fixed some examples to make them syntactically correct.
          </t>
        </list>
      </t>
      <t>
        -10
        <list style="symbols">
          <t>
            Incorporated additional review feedback from Marcos Sanz.
            The primary change was moving constraints to their own section of
            the
            Entity Statement.
          </t>
        </list>
      </t>
      <t>
        -09
        <list style="symbols">
          <t>
            Incorporated review feedback from Marcos Sanz.
            Major changes were as follows.
          </t>
          <t>
            Separated Entity configuration discovery from operations provided
            by the federation API.
          </t>
          <t>
            Defined new authentication error codes.
          </t>
          <t>
            Also incorporated review feedback from Michael B. Jones.
          </t>
        </list>
      </t>
      <t>
        -08
        <list style="symbols">
          <t>
            Incorporated review feedback from Michael B. Jones.
            Major changes were as follows.
          </t>
          <t>
            Deleted <spanx style="verb">sub_is_leaf</spanx> Entity Statement
            since it was redundant.
          </t>
          <t>
            Added <spanx style="verb">client_registration_type</spanx> RP registration
            metadata value
            and <spanx style="verb">client_registration_types_supported</spanx> OP
            metadata value.
          </t>
          <t>
            Deleted <spanx style="verb">openid_discovery</spanx> metadata type
            identifier
            since its purpose is already served by
            <spanx style="verb">openid_provider</spanx>.
          </t>
          <t>
            Entity identifier paths are now included when using the Federation API,
            enabling use in multi-tenant deployments sharing a common domain name.
          </t>
          <t>
            Renamed <spanx style="verb">sub_is_leaf</spanx> to
            <spanx style="verb">is_leaf</spanx>
            in the Entity Listings Request operation parameters.
          </t>
          <t>
            Added <spanx style="verb">crit</spanx> and
            <spanx style="verb">policy_language_crit</spanx>,
            enabling control over which Entity Statement and policy language
            extensions
            MUST be understood and processed.
          </t>
          <t>
            Renamed <spanx style="verb">openid_client</spanx> to
            <spanx style="verb">openid_relying_party</spanx>.
          </t>
          <t>
            Renamed <spanx style="verb">oauth_service</spanx> to
            <spanx style="verb">oauth_authorization_server</spanx>.
          </t>
          <t>
            Renamed <spanx style="verb">implicit</spanx> registration to
            <spanx style="verb">automatic</spanx>
            registration
            to avoid naming confusion with the implicit grant type.
          </t>
          <t>
            Renamed <spanx style="verb">op</spanx> to
            <spanx style="verb">operation</spanx>
            to avoid naming confusion with the use of "OP" as an acronym for
            "OpenID Provider".
          </t>
          <t>
            Renamed <spanx style="verb">url</spanx> to
            <spanx style="verb">uri</spanx>
            in several identifiers.
          </t>
          <t>
            Restored Open Issues appendix.
          </t>
          <t>
            Corrected document formatting issues.
          </t>
        </list>
      </t>
      <t>
        -07
        <list style="symbols">
          <t>
            Split metadata into metadata and metadata_policy
          </t>
          <t>
            Updated example
          </t>
        </list>
      </t>
      <t>
        -06
        <list style="symbols">
          <t>
            Some rewrites
          </t>
          <t>
            Added example of explicit client registration
          </t>
        </list>
      </t>
      <t>
        -05
        <list style="symbols">
          <t>
            A major rewrite.
          </t>
        </list>
      </t>
      <t>
        -04
        <list style="symbols">
          <t>
            Changed client metadata names
            <spanx style="verb">scopes</spanx>
            to <spanx style="verb">rp_scopes</spanx> and
            <spanx style="verb">claims</spanx>
            to <spanx style="verb">rp_claims</spanx>.
          </t>
          <t>
            Added Open Issues appendix.
          </t>
          <t>
            Added additional references.
          </t>
          <t>
            Editorial improvements.
          </t>
          <t>
            Added standard Notices section, which is present in all OpenID
            specifications.
          </t>
        </list>
      </t>
    </section>
  </back>
</rfc>
