<?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-connect-federation-1_0" ipr="none">

  <?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 Connect Federation">OpenID Connect Federation 1.0 -
      draft 25
    </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="Microsoft">Microsoft</organization>

      <address>
        <email>mbj@microsoft.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="2" month="December" year="2022"/>

    <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 is interacting 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 describes the basic components to build
        a multilateral federation and it provides a guide on how to apply them when
        the underlying protocol used is OpenID Connect.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>
        This specification describes how two entities that would like to
        interact can dynamically fetch and resolve trust and metadata for a
        given protocol through the use of third-party Trust Anchor. A trust
        anchor is an Entity whose main purpose is to issue statements
        about entities, such as OpenID Connect Relying Parties, OpenID
        Providers, and participating organizations.
        An identity federation can be realized using this specification using
        one or more levels of trust issuers. This specification does not mandate
        a specific way or restrict how a federation may be built. Instead, the
        specification provides the basic technical trust infrastructure building
        blocks needed to build 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.
        Furthermore, note that a company, as with any real-world organization,
        MAY be represented by more than one Entity in a federation.
        It is also true that an Entity can be part of more than one federation.
      </t>
      <t>
        OpenID Connect Federation Trust Chains rely on
        cryptographically signed
        <xref target="RFC7519">JSON Web Token (JWT)</xref>
        documents, and the Trust Chain does not at
        all rely on TLS
        <xref target="RFC8446"/>
        to establish trust.
      </t>

      <section title="Requirements Language">
        <t>
          The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
          "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
          document are to be interpreted as described in
          <xref target="RFC2119"/>.
        </t>
      </section>
      <section title="Terminology">
        <t>
          This specification uses the terms
          "Claim Name", "Claim Value", "JSON Web Token (JWT)",
          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. All entities in an OpenID Connect
              federation MUST have a globally unique identifier.
            </t>
            <t hangText="Entity Identifier">
              <vspace/>
              A URI that is globally unique and that is bound to one Entity.
            </t>
            <t hangText="Entity Statement">
              <vspace/>
          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 entities' signing keys and further data used to control the
              Trust Chain resolution process, such as authority hints.
            </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 that appears somewhere in between those
              issued by the Trust Anchor and the Leaf Entity in a Trust Chain.
            </t>
            <t hangText="Leaf Entity">
              <vspace/>
              An Entity defined by a certain protocol,
              e.g., OpenID Connect Relying Party or Provider.
            </t>
            <t hangText="Trust Anchor">
              <vspace/>
              An Entity that represents a trusted third party.
            </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 end 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">
              A trust mark represents a 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 that an Entity uses to sign its Entity Configuration.
              These keys are also used by an entity to sign Entity Statements.
            </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 
        <xref target="authority_hints">authority_hints</xref> parameter. 
        These references can be used to download the Entity Configuration of each superior.
        One or more Entity Configurations can occur, during the Federation Entity Discovery,
        until the Trust Anchor is reached. 
      </t>
      <t>
        The Trust Anchor and its intermediaries issue Entity Statements
        about their descendants. The sequence of Entity Configurations 
        and Entity Statements that validate the relationship between 
        a superior and a descendant, along a path towards the Trust Anchor,
        forms the proof that a Leaf Entity is part of
        the Federation configured by the Trust Anchor.
      </t>
      <t>
        The chain that links the statements to one another is verifiable 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 then 
        derived.
        How this is done is described in <xref target="federation_policy"/>.
      </t>
      <t>
        This specification deals with trust operations; 
        it doesn't cover or touch protocol operations
        outside those of metadata derivation and exchange. 
        In OpenID Connect terms, these are protocol
        operations other than 
        <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 doesn't mean that this specification can only be used
        together with OpenID Connect. On the contrary, it can equally be
        used to build OAuth 2.0 federations or other protocols
        that depend on the dynamic exchange of Entity metadata.
      </t>
    </section>
    <section title="Components" anchor="components">
      <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 always 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 SHOULD be prepared to publish an Entity
          Statement about themselves (Entity Configuration).
        </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 is done to
          prevent cross-JWT confusion (see <xref target="RFC8725"/>, section 3.11).
        </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 statement. If the <spanx style="verb">iss</spanx> and
              the <spanx style="verb">sub</spanx> are identical, the
              issuer is making a statement about itself and this Entity Statement
              is 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 on or 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 Conditional. A
              <xref target="RFC7517">JSON Web Key Set (JWKS)</xref>
              representing the public part of the subject
              Entity's signing keys. The corresponding private key is
              used by Leaf Entities to sign Entity Statements about themselves,
              and intermediate entities to sign statements about other entities.
              The keys that can be found here are intended to verify the signature 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> element of the respective Entity Statement.
              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 Key ID (<spanx style="verb">kid</spanx>).
              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="aud">
              <vspace/>
              OPTIONAL.
              The Entity Statement MAY be specifically created for an Entity.
              The Entity Identifier for that Entity MUST appear in this claim.
            </t>
            <t hangText="authority_hints" anchor="authority_hints">
              <vspace/>
              OPTIONAL. Array of strings representing
              the Entity Identifiers of intermediate entities or Trust Anchors
              that MAY issue an Entity Statement about the issuer Entity.
              For all entities except for Trust Anchors that do not have any
              superiors this is REQUIRED and MUST NOT be the empty list [].
              This claim MUST be absent from an
              Entity Configuration issued by a Trust Anchor with no superiors.
            </t>
            <t hangText="metadata">
              <vspace/>
              REQUIRED Conditional. JSON object including protocol
              specific metadata claims that represent the Entity's metadata.
              Each key of the JSON object represents a metadata type
              identifier, and each value MUST be a JSON object representing
              the metadata according to the metadata schema of that metadata
              type. An Entity Statement MAY contain multiple
              metadata statements, but only one for each metadata type.
              If the Entity Statement is an Entity Configuration,
              then the Entity Statement MUST contain a
              <spanx style="verb">metadata</spanx>
              claim.
              If <spanx style="verb">iss</spanx> and
              <spanx style="verb">sub</spanx>
              are not the same,
              then the Entity Statement MAY contain a
              <spanx style="verb">metadata</spanx>
              claim containing metadata asserted by a superior about the
              Entity identified by <spanx style="verb">sub</spanx>.
              If a <spanx style="verb">metadata</spanx> claim appears beside a
              <spanx style="verb">metadata_policy</spanx> claim in an
              Entity Statement then for each entity type, 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/>
              REQUIRED Conditional. JSON object that describes
              a metadata policy.
              A metadata_policy applies to the entity described in this
              Entity Statement as well as to all entities that appear beneath the
              entity described in this Entity Statement. This distinguishes
              <spanx style="verb">metadata_policy</spanx> from
              <spanx style="verb">metadata</spanx> which only applies to the
              subject itself.
              Each key of the JSON object represents a metadata type
              identifier, and each value MUST be a JSON object representing
              the metadata policy according to the metadata schema of that
              metadata type. An Entity Statement MAY contain multiple
              metadata policy statements, but only one for each metadata type.
              Only non Leaf Entities MAY contain a
              <spanx style="verb">metadata_policy</spanx>
              claim. Leaf entities MUST NOT contain a
          <spanx style="verb">metadata_policy</spanx> claim.
            </t>
            <t hangText="constraints">
              <vspace/>
              OPTIONAL. JSON object that describes a set of Trust Chain
              constraints. There is more about this in
              <xref target="chain_constraints"/>.
            </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 <xref target="RFC7515">JWS</xref> 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 Entity Statement claim names in the
              Entity Statement
              in the <spanx style="verb">crit</spanx> list.
              Producers MUST NOT use the empty list
              <spanx style="verb">[]</spanx>
              as the <spanx style="verb">crit</spanx> value.
            </t>
            <t hangText="policy_language_crit">
              <vspace/>
              OPTIONAL.
              The <spanx style="verb">policy_language_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
              <xref target="RFC7515">JSON Web Signature (JWS)</xref>
              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 policy language statements in the
              Entity Statement
              in the <spanx style="verb">policy_language_crit</spanx> list.
              Producers MUST NOT use the empty list
              <spanx style="verb">[]</spanx>
              as the <spanx style="verb">policy_language_crit</spanx> value.
            </t>
            <t hangText="trust_marks">
              <vspace/>
              OPTIONAL. A JSON array of objects, each representing
              a Trust Mark.  
              
              Each JSON object MUST contain the following two claims 
              and MAY contain other claims if needed. All the claims in the 
              JSON object MUST have the same values as those 
              contained in the Trust Mark JSON Web Token.
              
              <list style="hanging">
                <t hangText="id">
                  The Trust Mark unique identifier. 
                  It MUST be the same value as the 
                  <spanx style="verb">id</spanx>
                  claim contained in the 
                  Trust Mark JSON Web Token.
                </t>
                <t hangText="trust_mark">
                  A signed JSON Web Token that represents a Trust Mark.
                </t>
              </list>
              There is more about Trust Marks in
              <xref target="trust_marks"/>.
            </t>
            <t hangText="trust_marks_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 that
              describes an entity that is not a Trust Anchor.
              It is a JSON object with keys representing Trust Mark identifiers and values
              being an array of trusted entities representing the accreditation authority.
              If the value list bound to a Trust Mark identifier is empty it
              means that anyone can issue Trust Marks with that identifier.
              There is more about Trust Marks in <xref target="trust_marks"/>.
            </t>
            <t hangText="trust_anchor_id">
              <vspace/>
              OPTIONAL.
              An OP MUST use this claim to tell the RP which Trust Anchor it
              chose to use when responding to an explicit client registration 
              (<xref target="explicit">Explicit Client Registration</xref>).
              The value of <spanx style="verb">trust_anchor_id</spanx> is the 
              Entity Identifier of a Trust Anchor.
            </t>
          </list>
        </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>

                      <figure>
              <preamble>
                The following is a non-normative example of
                a <spanx style="verb">trust_marks_issuers</spanx> claim value:
              </preamble>
              <artwork><![CDATA[
{
  "https://openid.net/certification/op": ["*"],
  "https://refeds.org/wp-content/uploads/2016/01/Sirtfi-1.0.pdf":
    ["https://swamid.se"]
}
              ]]></artwork>
              </figure>

        <figure>
          <preamble>
            The following is a non-normative example of an Entity Statement
            before
            serialization and adding a signature. 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>

          <artwork><![CDATA[
{
  "iss": "https://feide.no",
  "sub": "https://ntnu.no",
  "iat": 1516239022,
  "exp": 1516298022,
  "crit": ["jti"],
  "jti": "7l2lncFdY6SlhNia",
  "policy_language_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"]},
      "scope": {
        "subset_of": ["openid", "profile", "email", "phone"]}
    }
  },
  "constraints": {
    "max_path_length": 2
  },
  "jwks": {
    "keys": [
      {
        "alg": "RS256",
        "e": "AQAB",
        "key_ops": ["verify"],
        "kid": "key1",
        "kty": "RSA",
        "n": "pnXBOusEANuug6ewezb9J_...",
        "use": "sig"
      }
    ]
  }
}
]]></artwork>

        </figure>
      </section>

      <section title="Trust Chain" anchor="trust_chain">
        <t>
          In an OpenID Connect identity federation, entities that together build
          a Trust Chain can be 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.
            </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,
          has zero or more Entity Statements
          issued by intermediates about subordinates,
          including the Entity 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 MAY end with the
          Entity Configuration of the Trust Anchor.
        </t>
        <t>
          If present, the Trust Anchor's Entity Configuration
          at the end of the chain contains configuration of the federation,
          such as the public keys of the Trust Anchor and other parameters
          considered within the trust evaluation.
          When this is this case, the Trust Chain
          consequentially contains the configuration of the federation
          at the date 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 the RP,
            </t>
            <t>
              an Entity Statement about the RP published by Organization A,
            </t>
            <t>
              an Entity Statement about Organization A published by federation F.
            </t>
          </list>
        </t>
        <t>
          A Trust Chain MUST always be possible to order such that:
          If we name the Entity Statements ES[0] (the Leaf Entity's
          Entity Configuration) to ES[i] (an Entity Statement issued
          by the Trust Anchor), i>0 then:
          <list style="symbols">
            <t>
              The <spanx style="verb">iss</spanx> Entity in one Entity Statement
              is always the
              <spanx style="verb">sub</spanx>
              Entity in the next.
              ES[j]['iss'] == ES[j+1]['sub'], j=0,...,i-1 .
            </t>
            <t>
              There MUST always be a signing key carried in the
              <spanx style="verb">jwks</spanx>
              claim in
              ES[j] that can be used to verify the signature of ES[j-1],
              j=i,...,1 .
            </t>
            <t>
              It MUST be possible to verify the signature of ES[0] with
              one of the keys in ES[0]['jwks'].
            </t>
          </list>
        </t>
        <t>
          The signing key that MUST be used to verify ES[i] is distributed
          from the Trust Anchors to any Entity that needs to verify a
          Trust Chain in some secure out-of-band way not described in this
          document.
        </t>
      </section>
    </section>
    <section anchor="metadata" title="Metadata">
      <t>
        This specification does allow new metadata
        types to be defined, to support use cases outside OpenID Connect
        federations.
        The metadata type identifier will uniquely identify which metadata
        specification to utilize.
      </t>
      <t>
        The metadata document MUST be a JSON object. Beyond that there is
        no restriction.
      </t>
      <t>
        Metadata used in federations typically reuses existing metadata
        standards.
        If needed, the metadata schema is extended
        with additional properties relevant in a federated context.
      </t>

      <section title="OpenID Connect and OAuth2 Metadata" anchor="common_metadata">
      <t>
        For instance, for OpenID Connect federations, this specification uses
        metadata values from
        <xref target="OpenID.Discovery">OpenID Connect Discovery 1.0</xref>
        and
        <xref target="OpenID.Registration">OpenID Connect Dynamic Client
          Registration 1.0
        </xref>
        and adds additional values used for federations.
      </t>
      <t>
        For OAuth2 federations, this specification uses metadata values from
        OAuth 2.0 Authorization Server Metadata as specified in <xref target="RFC8414"/>.
      </t>

      <t>
        For both OpenID Connect and OAuth2 metadata the following additional properties
        are defined.
      </t>

      <t>
          <list style="hanging">
            <t hangText="organization_name">
              <vspace/>
              OPTIONAL. A human-readable
              name representing the organization owning the Entity.
              If the owner is a physical person
              this MAY be, for example, the name of a person. Note 
              that this information will be publicly available.
            </t>
            <t hangText="signed_jwks_uri">
              <vspace/>
              OPTIONAL. A URI pointing to a signed JWT having the Entity's
              JWK Set as its payload. The JWT MUST be signed using a Federation
              Entity Key.
              A signed JWT can contain the following claims, all except
              <spanx style="verb">keys</spanx> defined in
              <xref target="RFC7519"/>:
              <list style="hanging">
                <t hangText="keys">
                  <vspace/>
                  REQUIRED. List of JWKs.
                </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 at which the JWT was
                  issued.
                </t>
                <t hangText="exp">
                  <vspace/>
                  OPTIONAL. This claim identifies the time at which the JWT is
                  no longer valid.
                </t>
              </list>
              There are more claims 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 deemed to not be very useful in this context and are therefore
              to be omitted.


            <figure>
              <preamble>
                The following is a non-normative example of a signed JWKS
                before serialization and adding a signature.
              </preamble>
              <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",
      "iat": 1618410883
    }
]]>
              </artwork>
            </figure>

            <figure>
            <preamble>
                The following is a non-normative example of an RP's Entity Configuration:
            </preamble>

                <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/jwks.jose",
          "jwks_uri":"https://openid.sunet.se/rp/signed_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>
            </t>

            <t hangText="jwks">
              <vspace/>
              OPTIONAL. JSON Web Key Set document, passed by value, as
              defined in <xref target="RFC7517"/>.
              This parameter is intended
              to be used by participants that, for some reason, are
              unable to use the <spanx style="verb">signed_jwks_uri</spanx>
              parameter.
              One significant downside of <spanx style="verb">jwks</spanx>
              is that it does not enable key rotation
              (which <spanx style="verb">signed_jwks_uri</spanx> and
              <spanx style="verb">jwks_uri</spanx> do).
            </t>

        </list>
      </t>
      </section>

      <section title="Usage of the claims 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 OAuth2 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 title="RP Metadata" anchor="RP_metadata">
        <t>
          The metadata 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>
          are allowed in a metadata statement.
        </t>
        <t>
          In addition, the parameters defined in <xref target="metadata"/>
          for OpenID Connect and OAuth2 entities and the following are added:
          <list style="hanging">
            <t hangText="client_registration_types">
              <vspace/>
              REQUIRED. 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>

      </section>

      <section title="OP Metadata" anchor="OP_metadata">
        <t>
          The metadata 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>
          are applicable.
        </t>
        <t>
          In addition, the parameters defined in <xref target="metadata"/>
          for OpenID Connect and OAuth2 entities and the following are added:
        </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 as described in <xref target="explicit"/>,
              then this claim is REQUIRED.
            </t>
            <t hangText="request_authentication_methods_supported">
              <vspace/>
              OPTIONAL.
              A JSON Object defining the client authentications supported for each endpoint.
              The endpoint names are defined in the IANA
              "OAuth Authorization Server Metadata" registry
              <xref target="IANA.OAuth.Parameters"/>.
              Other endpoints and authentication methods are possible, if made
              recognizable according
              to established standards and not in conflict with the operating
              principles of this specification.
              In OpenID Connect Core, no client authentication is performed at the authentication
              endpoint. Instead, because the request itself is authenticated.
              What it amounts to is that the OP maps
              information in the request (like the redirect_uri) to information it has gained
              on the client, through static or dynamic registration.
              If the map is successful, then the request is permitted to be processed.
              If the RP uses Automatic Registration, as defined in <xref target="automatic"/>,
              the OP has no prior knowledge
              of the RP. Therefore, the OP must start by gathering
              information about the RP using the process outlined in
              <xref target="federation_configuration"/>. Once it has the RP's
              metadata, the OP can then verify the request in the same way
              as if it had known the RP's metadata beforehand.
              To make the request verification more secure we demand the use of
              a client authentication or verification method that proves that
              the RP is in possession of a key that appears in the RP's metadata.
              <vspace/>
              Client authentication methods are for instance:
              <list style="hanging">
                <t hangText="private_key_jwt">
                  <vspace/>
                  <spanx style="verb">private_key_jwt</spanx>.
                  This authentication process 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/>
              A client verification method, on the other hand,
              is something like:
              <list style="hanging">
                <t hangText="request_object">
                  <vspace/>
                  This uses a Request Object as described in
                  <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>.
                  There is more about this in
                  <xref target="automatic"/>.
                  Here the verification is based on the fact that the request
                  object is signed with a key the RP is in control of.
                </t>
              </list>
              <vspace/>
              The claim value of this parameter is a JSON object with members representing
              authentication request methods and as values lists of client
              authentication/verification methods that can be used together with the
              authentication request method.
              <vspace/>
              Examples of authentication request methods are
          <list style="symbols">
        <t>
          Authentication Request, as described in Section 3 of
          <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>, and
        </t>
        <t>
          Pushed Authorization Request (PAR), as described in <xref target="RFC9126"/>.
        </t>
          </list>
          <vspace/>
              If AR is used, then a client verification method like
              <spanx style="verb">request_object</spanx> can be used.
              If PAR is used then client authentication methods like
              <spanx style="verb">private_key_jwt</spanx>,
              <spanx style="verb">tls_client_auth</spanx> and
              <spanx style="verb">self_signed_tls_client_auth</spanx>
              can be used.
            </t>

        <t hangText="request_authentication_signing_alg_values_supported">
          <vspace/>
          OPTIONAL.
          JSON array containing a list of the JWS signing algorithms
          (<spanx style="verb">alg</spanx> values)
          supported for the signature on the JWT <xref target="RFC7519" />
          used in the <spanx style="verb">request_object</spanx>
          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>

        <t>
          The following is a non-normative example of an OP's Entity Configuration:
        </t>
        <figure>
          <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 metadata type identifier is
          <spanx style="verb">oauth_authorization_server</spanx>.
        </t>
        <t>
          All parameters defined in Section 2 of
          <xref target="RFC8414">RFC 8414</xref>
          and <xref target="common_metadata"/> are applicable.
          In addition, all the parameters defined
          for <xref target="OP_metadata"/>  are
          applicable for this Entity.
        </t>
      </section>

      <section title="OAuth Client">
        <t>
          The metadata type identifier is
          <spanx style="verb">oauth_client</spanx>.
        </t>
        <t>
          All parameters defined in Section 2 of
          <xref target="RFC7591">RFC 7591</xref>
          are applicable.
          In addition, the parameters defined in <xref target="metadata"/>
          for OpenID Connect and OAuth2 entities are added.
        </t>
      </section>

      <section title="OAuth Protected Resource">
        <t>
          The metadata type identifier is
          <spanx style="verb">oauth_resource</spanx>.
          In addition to those defined in
          <xref target="draft-jones-oauth-resource-metadata">
              draft-jones-oauth-resource-metadata
          </xref>,
          the parameters defined in <xref target="metadata"/>
          for OpenID Connect and OAuth2 entities are added.
        </t>
      </section>
      <section title="Federation Entity">
        <t>
          The metadata type identifier is
          <spanx style="verb">federation_entity</spanx>.
        </t>
        <t>
          All Entities in a federation MAY expose this metadata type. 
          The Entities that expose federation API endpoints 
          MUST expose this metadata type. 
        </t>
        <t>
          The following properties are allowed:
          <list style="hanging">
            <t hangText="federation_fetch_endpoint">
              <vspace/>
              OPTIONAL.
              The fetch endpoint described in
              <xref target="fetch_endpoint"/>. 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"/>. 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"/>. 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>.
            </t>
            <t hangText="organization_name">
              <vspace/>
              OPTIONAL. A human-readable
              name representing the organization owning the Entity.
              If the owner is a physical person
              this MAY be, for example, the name of a person. Note
              that this information will be publicly available.
              It is RECOMMENDED that each federation Entity 
              expose this claim.
            </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 to documentation of
              conditions and policies relevant to this Entity.
            </t>
            <t hangText="homepage_uri">
              <vspace/>
              OPTIONAL. URL to a generic home page
              representing this Entity.
            </t>
          </list>
        </t>
        <t>Example</t>
        <figure>
          <artwork><![CDATA[
"federation_entity": {
  "federation_fetch_endpoint":
    "https://example.com/federation_fetch",
  "federation_list_endpoint":
    "https://example.com/federation_list",
  "federation_trust_mark_status_endpoint": "https://example.com/status"
  "organization_name": "The example cooperation",
  "homepage_uri": "https://www.example.com"
}
]]></artwork>
        </figure>
      </section>

    </section>
    <section title="Federation Policy" anchor="federation_policy">
      <section title="Metadata Policy" anchor="metadata_policy">
        <t>
          An Entity can publish metadata policies pertaining to subordinate
          entities of a specific type. Entity type identifiers specified in
          this document can be found in <xref target="metadata"/>.
        </t>
        <section title="metadata_policy">
        <t>
          A <spanx style="verb">metadata_policy</spanx> for a specific entity
          type has the following structure:
          <list style="symbols">
            <t>It consists of one or more policy entries.</t>
            <t>Each policy entry applies to one metadata parameter, such as
              <spanx style="verb">id_token_signed_response_alg</spanx>.
            </t>
            <t>Each policy entry consists of one or more operators, which can be
              value modifiers or value checks.
            </t>
            <t>An operator can only appear once in a policy entry.</t>
          </list>
        </t>
        <t>
          It SHOULD be noted that claim names without language tags are different
          from the same claim but with language tags.
        </t>
        <t>
          <figure>
            <preamble>
              An example of a policy entry:
            </preamble>
            <artwork><![CDATA[
"id_token_signed_response_alg": {
  "default": "ES256",
  "one_of" : ["ES256", "ES384", "ES512"]
}
]]></artwork>
          </figure>
        </t>
        <t>
          <figure>
            <preamble>
              Which fits into a metadata policy like this:
            </preamble>
            <artwork><![CDATA[
"metadata_policy" : {
  "openid_relying_party": {
    "id_token_signed_response_alg": {
      "default": "ES256",
      "one_of" : ["ES256", "ES384", "ES512"]
    }
  }
}
]]></artwork>
          </figure>
        </t>
        </section>
        <section title="Operators">
          <t>
            Value modifiers are:
            <list style="hanging">
              <t hangText="value">
                <vspace/>
                Disregarding what value the parameter had, if any, the
                parameter's value will be set to the operator's value.
              </t>
              <t hangText="add">
                <vspace/>
                Adds the value or values specified to the metadata parameter.
                If any of the specified values are already present
                as values of the parameter, they will not be added.
                If the parameter has no value,
                then the parameter is initialized with the specified value(s).
              </t>


              <t hangText="default">
                <vspace/>
                If no value is assigned to this parameter, then the parameter's
                value will be set to the operator's value(s).
              </t>
            </list>
          </t>
          <t>
            Value checks are:
            <list style="hanging">
              <t hangText="one_of">
                <vspace/>
                The value of the parameter MUST be one of the ones listed in
                this directive.
              </t>
              <t hangText="subset_of">
                <vspace/>
                The resulting value of the parameter will be the intersection of
                the
                values in the directive and the values of the parameter.
              </t>
              <t hangText="superset_of">
                <vspace/>
                The values of the parameter MUST contain the ones in the
                directive.
                We define superset in a mathematical way, that is, equality is
                included.
              </t>
              <t hangText="essential">
                <vspace/>
                If <spanx style="verb">true</spanx>, then the parameter MUST have a value.
              </t>
            </list>
          </t>
          <t>
            Note that when a parameter is defined to be a space-separated
            list of strings like for <spanx style="verb">scope</spanx> in
            <xref target="RFC7591"/> <spanx style="verb">subset_of</spanx>,
            <spanx style="verb">superset_of</spanx> and
            <spanx style="verb">default</spanx> are still expressed as lists of strings.
        This language from <xref target="RFC6749"/> also applies for such 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>
        </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>
                applies 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>).
                This means that <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">
          <t>
            If there is more than one 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 we have defined in <xref target="trust_chain"/>, policies are
            combined
            starting with ES[i] and then adding the policies from ES[j]
            j=i-1,..,1
            before applying the combined policy to the Entity's metadata.
          </t>
          <t>
            After each combination, the policy for each parameter MUST
            adhere to the rules defined in <xref target="policy_restr"/>.
          </t>
          <section title="Merging Operators">
            <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 is
                  NOT allowed unless the two operator values are equal.
                </t>
                <t hangText="default">
                  <vspace/>
                  Merging two <spanx style="verb">default</spanx> operators is
                  NOT allowed unless the two operator values are equal.
                </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>.
                </t>
              </list>
            </t>
          </section>
        </section>
        <section title="Applying Policies">
          <t>
            Once combining the Metadata policies has been accomplished, the next
            step is to apply the combined policy to the metadata.
          </t>
          <t>
            Doing that, one follows these steps for each parameter in the
            policy.
          </t>
          <t>
            <list style="numbers">
              <t>
                If there is a <spanx style="verb">value</spanx> operator in the
                policy, its value would be applied without any additional action.
              </t>
              <t>
                Add whatever value is specified in an <spanx style="verb">add</spanx>
        operator.
              </t>
              <t>
                If the parameter still has no value, apply the
        <spanx style="verb">default</spanx> if there is one.
              </t>
              <t>
                Do the essential check. If <spanx style="verb">essential</spanx> is
                missing as an operator,
                <spanx style="verb">essential</spanx>
                is to be treated as if set to <spanx style="verb">false</spanx>.
                If <spanx style="verb">essential</spanx> is defined to be
        <spanx style="verb">true</spanx>,
                then the claim
                MUST have a value by now. Otherwise applying the operator MUST
                fail.
              </t>
              <t>
                Do the other checks. Verify that the value is
        <spanx style="verb">one_of</spanx> or that the
                values are <spanx style="verb">subset_of</spanx>/<spanx
                      style="verb">superset_of</spanx>. If the parameter values
                do not fall within the allowed boundaries,
        applying the operator MUST fail.
              </t>
              <t>
                 If more than one value is specified in
                 <spanx style="verb">one_of</spanx> and the Leaf Entity
                 does not specify the metadata claim for which
                 <spanx style="verb">one_of</spanx> is referred to,
                 it is an implementation choice which of the values in
                 the <spanx style="verb">one_of</spanx> array will be used.
              </t>
            </list>
          </t>
        </section>
        <section title="Policy Combination Example">
          <figure>
            <preamble>
              A federation's policy for OAuth2 clients:
            </preamble>
            <artwork><![CDATA[
{
  "scope": {
    "subset_of": [
      "openid",
      "eduperson",
      "phone"
    ],
    "superset_of": [
      "openid"
    ],
    "default": [
      "openid",
      "eduperson"
    ]
  },
  "token_endpoint_auth_method": {
    "one_of": [
      "client_secret_post",
      "client_secret_basic"
    ]
  },
  "contacts": {
    "add": "helpdesk@federation.example.org"
  }
}
]]></artwork>
          </figure>
          <figure>
            <preamble>
              An organization's policy for OAuth2 clients:
            </preamble>
            <artwork><![CDATA[
{
  "scope": {
    "subset_of": [
      "openid",
      "eduperson",
      "address"
    ],
    "default": [
      "openid",
      "eduperson"
    ]
  },
  "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 combined metadata policy then becomes:
            </preamble>
            <artwork><![CDATA[
{
  "scope": {
    "subset_of": [
      "openid",
      "eduperson"
    ],
    "superset_of": [
      "openid"
    ],
    "default": [
      "openid",
      "eduperson"
    ]
  },
  "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>
      </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">policy_language_crit</spanx> list,
          as is done for <xref target="RFC7515">JWS</xref> header parameters
          with the <spanx style="verb">crit</spanx> parameter.
          If the policy language extension keyword
          is listed in the <spanx style="verb">policy_language_crit</spanx> list
          and not understood, then the metadata MUST be rejected.
        </t>
      </section>
      <section title="Policy Example">
        <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:
          </preamble>
          <artwork><![CDATA[
{
  "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:
          </preamble>
          <artwork><![CDATA[
{
  "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:
          </preamble>
          <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>
        <t>
          The metadata for the Entity in question,
      after applying the policies above,
      would then become:
        </t>
        <figure>
          <artwork><![CDATA[
{
  "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="Applying Constraints" anchor="chain_constraints">
        <t>A constraint specification 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. Array of strings. Each string is an entity type.
              Entity type identifiers specified in this document
              can be found in <xref target="metadata"/>.
              This constraint restricts what types of Leaf Entities that MAY
              appear beneath the entity described in this Entity Statement.
            </t>
          </list>
        </t>
        <t>The following is a non-normative example of such a specification:</t>
        <figure>
          <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>
          If a subordinate Entity Statement contains a constraint specification
          that is more restrictive than the one in effect, then the more
          restrictive constraint is in effect from here on.
        </t>
        <t>
          If a subordinate Entity 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
            intermediaries 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 that is greater than or equal to zero.
          </t>
          <t>
            Not adding a max_path_length constraint just means that there is
            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>Entity Statement by Intermediate 1 (I1) about LE</t>
              <t>Entity Statement by Intermediate 2 (I2) about I1</t>
              <t>Entity Statement by 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 equal to or bigger than 2.
              </t>
              <t>
                TA specifies <spanx style="verb">max_path_length</spanx> of 2,
                I2 specifies <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 Entity 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 name
            subtrees. Any name matching a restriction in the excluded
            claim is invalid regardless of 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 possible for Leaf Entities beneath an
            entity. If there is no <spanx style="verb">allowed_leaf_entity_types</spanx>
            defined it means that any type is allowed.
          </t>
        </section>
      </section>
      <section title="Trust Marks" anchor="trust_marks">
        <t>
          Technically, Trust Marks as used by this specification are signed
          JWTs.
        </t>
        <t>
          The Trust Marks are signed by a federation accredited
          authority.
          The validation of such a signed statement is performed
          in the same way that an Entity Configuration is validated.
          To make this validation possible the key used by the Trust Mark
          Issuer to sign Trust Marks MUST be one of its the Federation Entity Keys.
        </t>
        <t>
          Note that a federation MAY allow an Entity to self-sign
          some 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 (see <xref target="RFC8725"/>, section 3.11).
        </t>


        <section title="Trust Mark Claims" anchor="trust_mark_claims">
          <t>These are the Trust Mark Claims:</t>
          <t>
            <list style="hanging">
              <t hangText="iss">
                <vspace/>
                REQUIRED. String. The issuer of the Trust Mark.
              </t>
              <t hangText="sub">
                <vspace/>
                REQUIRED. String. The Entity this Trust Mark applies to.
              </t>
              <t hangText="id">
                <vspace/>
                REQUIRED. String. An identifier of the Trust Mark. 
                The Trust Mark <spanx style="verb">id</spanx>
                MUST be collision-resistant 
                across multiple federations.
                It is RECOMMENDED that the
                <spanx style="verb">id</spanx>
                value is built 
                using the unique 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. When this Trust Mark was issued.
        Expressed as Seconds Since the Epoch, per <xref target="RFC7519"/>.
              </t>
              <t hangText="logo_uri">
                <vspace/>
                OPTIONAL. String. A URL that points to a mark/logo that the
                subject is allowed to display to a user of the Entity.
              </t>
              <t hangText="exp">
                <vspace/>
                OPTIONAL. Number. When this Trust Mark is not valid anymore.
                Expressed as Seconds Since the Epoch, per <xref target="RFC7519"/>.
        If not present, it means that
                the Trust Mark is valid forever.
              </t>
              <t hangText="ref">
                <vspace/>
                OPTIONAL. String. URL that points to information connected to
                the issuance of this Trust Mark.
              </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>
        </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 Anchors it wants to use.
          </t>
          <t>Validating a Trust Mark issuer follows the procedure set out in
            <xref target="resolving_trust"/>. Validating the Trust Mark
            itself is described in <xref target="status_endpoint"/>
          </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_marks_issuers</spanx> claim
            in its Entity Configuration to publish this information.
          </t>
          <t>
            For other externally issued Trust Marks, it is an out-of-band process
            to define and announce accreditation authorities to other entities
            and it is left to the discretion of the receiving party to assign
            an appropriate level of trust to such Trust Marks.
          </t>
        </section>
        <section title="Trust Mark Examples" anchor="trust_example">
          <figure>
            <preamble>
                A non-normative example of a Trust Mark claim inside an Entity Configuration is:
            </preamble>
            <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"
      ],

       ... follows other claims ...

   ... follows other claims ...

]]></artwork>
          </figure>

          <figure>
            <preamble>
                An example of a decoded Trust Mark issued to a RP,
                attesting the conformance to a national
                public service profile:
            </preamble>
            <artwork><![CDATA[
{
  "id":"https://federation.id/openid_relying_party/public/",
  "iss": "https://trust-anchor.gov.id",
  "sub": "https://rp.cie.id",
  "iat": 1579621160,
  "organization_name": "Organization name",
  "policy_uri": "https://rp.cie.id/privacy_policy",
  "tos_uri": "https://rp.cie.id/info_policy",
  "service_documentation": "https://rp.cie.id/api/v1/get/services",
  "ref": "https://rp.cie.id/documentation/manuale_operativo.pdf"
}

]]></artwork>
          </figure>

          <figure>
            <preamble>
                An example of a decoded Trust Mark issued to a RP,
                attesting its conformance to the rules for
                data management of underage users:
            </preamble>
            <artwork><![CDATA[
{
  "id":"https://federation.id/openid_relying_party/private/under-age",
  "iss": "https://trust-anchor.gov.id",
  "sub": "https://rp.cie.id",
  "iat": 1579621160,
  "organization_name": "Organization name",
  "policy_uri": "https://rp.cie.id/privacy_policy",
  "tos_uri": "https://rp.cie.id/info_policy"
}

]]></artwork>
          </figure>

          <figure>
            <preamble>
                An example of a Trust Mark attesting a stipulation of an
                agreement between a RP and an Attribute Authority:</preamble>
            <artwork><![CDATA[
{
  "id": "https://deleghedigitali.gov.it/openid_relying_party/sgd/",
  "iss": "https://deleghedigitali.gov.it",
  "sub": "https://rp.cie.id",
  "iat": 1579621160,
  "logo_uri": "https://deleghedigitali.gov.it/sgd-cmyk-150dpi-90mm.svg",
  "organization_type": "public",
  "id_code": "123456",
  "email": "info@rp.cie.id",
  "organization_name#it": "Nome dell'organizazzione",
  "policy_uri#it": "https://rp.cie.id/privacy_policy",
  "tos_uri#it": "https://rp.cie.id/info_policy",
  "service_documentation": "https://rp.cie.id/api/v1/get/services",
  "ref": "https://deleghedigitali.gov.it/documentation/manuale_operativo.pdf"
}
]]></artwork>
          </figure>

          <figure>
            <preamble>
                An example of a Trust Mark asserting
                conformance to a security profile:
            </preamble>
            <artwork><![CDATA[
{
  "iss": "https://secusign.org",
  "sub": "https://example.com/op",
  "iat": 1579621160,
  "id": "https://secusign.org/level/A",
  "logo_uri": "https://secusign.org/static/levels/
    certification-level-A-150dpi-90mm.svg",
  "ref": "https://secusign.org/conformances/"
}
]]></artwork>
          </figure>

          <figure>
            <preamble>An example of a decoded self-signed Trust Mark:</preamble>
            <artwork><![CDATA[
{
  "iss": "https://example.com/op",
  "sub": "https://example.com/op",
  "iat": 1579621160,
  "id": "https://openid.net/certification/op",
  "logo_uri": "http://openid.net/wordpress-content/uploads/2016/
    05/oid-l-certification-mark-l-cmyk-150dpi-90mm.svg",
  "ref": "https://openid.net/wordpress-content/uploads/2015/
    09/RolandHedberg-pyoidc-0.7.7-Basic-26-Sept-2015.zip"
}
]]></artwork>
          </figure>

          <figure>
            <preamble>An example of a third-party accreditation authority:
            </preamble>
            <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.
          The requesting party would make the following request to the Entity
          <spanx style="verb">https://openid.sunet.se</spanx>
          to obtain its configuration information:
        </t>
        <t>
          <figure>
            <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 
          and the content type set to 
          <spanx style="verb">application/entity-statement+jwt</spanx>,
          to make it clear that the response contains a signed Entity Statement.
          In case of an error, the response 
          SHOULD be produced in accordance with what is defined in
          <xref target="error_response"/>.
        </t>
        <t>The following is a non-normative example response from an
          intermediate Entity, before serialization and adding a signature:
        </t>
        <t>
          <figure>
            <artwork><![CDATA[
200 OK
Content-Type: application/entity-statement+jwt

{
  "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 Entity Statements" anchor="fetch_endpoint">
        <t>
          All Entities that are expected to publish Entity Statements about other
          entities MUST expose a Fetch endpoint.
        </t>
        <t>
          Fetching Entity Statements is performed to collect Entity Statements
          one by one to gather Trust Chains.
        </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 statement.
        </t>

        <section title="Fetch Entity Statements Request"
                 anchor="fetch_statement">
          <t>
            The request MUST be an HTTP request using the GET method and
            the https scheme to a resolved federation 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="iss">
                <vspace/>
                OPTIONAL. The Entity Identifier of the issuer
                from which the Entity Statement 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 Statements must come from. Without this
                parameter, the issuer matches to the Entity at
                which the request was made.
              </t>
              <t hangText="sub">
                <vspace/>
                OPTIONAL. The Entity Identifier of the subject
                for which the Entity Statement is issued. If this
                parameter is left out, it is considered to be the same as the
                issuer and would indicate a request for a self-signed
                statement.
              </t>
            </list>
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of an API
              request for an Entity Statement:
            </preamble>
            <artwork><![CDATA[
GET /federation_fetch_endpoint?
iss=https%3A%2F%2Fedugain.org%2Ffederation&
sub=https%3A%2F%2Fopenid%2Esunet%2Ese HTTP/1.1
Host: edugain.org
]]></artwork>
          </figure>
        </section>

        <section title="Fetch Entity Statements Response">
          <t>
            A successful response MUST use the HTTP status code 200 
            and the content type set to 
            <spanx style="verb">application/entity-statement+jwt</spanx>,
            to make it clear that the response contains a signed Entity Statement.
            If it is a negative response, it will be a JSON object and the
            content type MUST be set to
            <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 a response, before
              serialization and adding a signature:
            </preamble>
            <artwork><![CDATA[
200 OK
Content-Type: application/entity-statement+jwt

{
  "iss": "https://edugain.org/federation",
  "sub": "https://openid.sunet.se"
  "exp": 1568397247,
  "iat": 1568310847,
  "jwks": {
    "keys": [
      {
        "e": "AQAB",
        "kid": "dEEtRjlzY3djcENuT01wOGxrZlkxb3RIQVJlMTY0...",
        "kty": "RSA",
        "n": "x97YKqc9Cs-DNtFrQ7_vhXoH9bwkDWW6En2jJ044yH..."
      }
    ]
  },
  "metadata":{
    "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 the resolve endpoint to fetch
          resolved metadata and Trust Marks for an Entity as seen/trusted by
          the resolver. The resolver is supposed to fetch the subject's
          Entity Configuration, collect a Trust Chain that starts
          with the subject's Entity Statement and ends with the specified
          Trust Anchor, verify the Trust Chain and then apply all the
          policies present in the Trust Chain to the Entity Statements
          metadata. The resolver is also expected to verify that the
          present Trust Marks are active. If it finds Trust Marks that are
          not active, then those should be left out of the response set.
        </t>

        <section title="Resolve Request">
          <t>
            The request MUST be an HTTP request using the GET method and
            the https scheme 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 remote peer
                MUST use when resolving the metadata. The value is an Entity
                identifier.
              </t>
              <t hangText="type">
                <vspace/>
                OPTIONAL. A specific metadata type to resolve.
                In this document, we use the metadata types listed in
                <xref target="metadata"/>.
                If no value is given, then all metadata types are expected to
                be returned.
              </t>
            </list>
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of a resolve request:
            </preamble>
            <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 
            and the content type set to 
            <spanx style="verb">application/resolve-response+jwt</spanx>,
            containing resolved metadata and
            verified Trust Marks. 
            The resolve response JWT MAY also contain
            the sequence of the Entity Statements that compose the Trust Chain,
            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.
            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. 
                URL corresponding to the federation's Entity Identifier 
                of the issuer of the resolve response.
              </t>
              <t hangText="sub">
                <vspace/>
                REQUIRED. String. 
                URL corresponding to the federation's Entity Identifier
                of the subject for which the resolve response refers to.
              </t>
              <t hangText="iat">
                <vspace/>
                REQUIRED. Number. When this resolution was issued.
                Expressed as Seconds Since the Epoch, as defined in 
                <xref target="RFC7519"/>.
              </t>
              <t hangText="exp">
                <vspace/>
                REQUIRED. Number. When this resolution is not valid anymore.
                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"></xref>.
              </t>
              <t hangText="trust_marks">
                <vspace/>
                OPTIONAL. A JSON 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 the 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 
          SHOULD be produced in accordance with what is defined in
          <xref target="error_response"/>.

          </t>
          
          <figure>
            <preamble>
              The following is a non-normative example of a response, before
              serialization and adding a signature:
            </preamble>
            <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",
        "implicit",
        "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="Considerations">
          <t>
            The basic assumption of this specification is that an entity 
            should have direct trust in no one 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 these.
            
            If a party uses the resolve service of another Entity
            to obtain federation data, it is trusting
            the resolver to perform the validation of the cryptographically
            protected metadata correctly and to provide it with authentic results.
          </t>
        </section>
      </section>

      <section title="Entity Listings" anchor="entity_listing">
        <t>
          An Entity MAY query another Entity for a list of all the
          entities immediately subordinate to that Entity and about which
          that Entity is prepared to issue statements about.
          (In some cases, this MAY be a very large list.)
        </t>

        <section title="Entity Listings Request">
          <t>
            The request MUST be an HTTP request using the GET method and
            the https scheme 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 
                metadata type identifier 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 set the content type to 
                <spanx style="verb">application/json</spanx>, with 
                the error code set to
                <spanx style="verb">unsupported_parameter</spanx>.
              </t>
            </list>
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of an API
              request for a list of entities:
            </preamble>
            <artwork><![CDATA[
GET /list HTTP/1.1
Host: openid.sunet.se
]]></artwork>
          </figure>
        </section>

        <section title="Entity Listing Response">
          <t>
            A successful response MUST use the HTTP status code 200 
            and the content type set to <spanx style="verb">application/json</spanx>,
            containing a JSON list with the known Entity
            Identifiers.
          </t>
          
          <t>
            If the response is negative, the response 
            should be produced in accordance with what is defined in
            <xref target="error_response"/>.
          </t>
          
          <figure>
            <preamble>
              The following is a non-normative example of a response:
            </preamble>
            <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 is to allow an Entity to check whether a Trust Mark is still
          active or not. The query MUST be sent to the Trust Mark issuer.
        </t>
        <section title="Status Request">
          <t>
            The request MUST be an HTTP request using the POST method and
            the https scheme to a 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 ID of the Entity to which the Trust Mark
                was issued.
              </t>
              <t hangText="id">
                <vspace/>
                OPTIONAL. Identifier of the Trust Mark.
              </t>
              <t hangText="iat">
                <vspace/>
                OPTIONAL. When the Trust Mark was issued. If
                <spanx style="verb">iat</spanx> is not specified and the
                trust issuer have issued several Trust Marks with the
                <spanx style="verb">id</spanx> specified in the request to the
                Entity identified by <spanx style="verb">sub</spanx>; the
                last 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">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">id</spanx>
            are required.
          </t>
          <t>
            <figure>
              <preamble>
                The following is a non-normative example of a request using
                <spanx style="verb">sub</spanx> and <spanx style="verb">id</spanx>:
              </preamble>
              <artwork><![CDATA[
GET /federation_trust_mark_status_endpoint?
sub=https%3A%2F%2Fopenid.sunet.se%2FRP
&id=https%3A%2F%2Frefeds.org%2Fsirtfi
HTTP/1.1
Host: operations.swamid.se
]]></artwork>
            </figure>

          </t>
        </section>
        <section title="Status Response">
          <t>
            A successful response MUST use the HTTP status code 200 
            and the content type set to 
            <spanx style="verb">application/json</spanx>,
            to make it clear that the response contains a JSON
            object containing the claim below.
          </t>

          <t>
            If the response is negative, the response 
            SHOULD be produced in accordance with what is defined in
            <xref target="error_response"/>.
          </t>

          <t>
            <list style="hanging">
              <t hangText="active">
                <vspace/>
                REQUIRED. Boolean. Whether the Trust Mark is active or not.
              </t>
            </list>
          </t>
          <t>
            <figure>
              <preamble>
                The following is a non-normative example of a response:
              </preamble>
              <artwork><![CDATA[
200 OK
Content-Type: application/json

{
  "active": true
}
]]></artwork>
            </figure>
          </t>
        </section>
      </section>

      <section title="Federation Historical Keys endpoint">
          <t>
            The Trust Anchor MAY publish its expired 
            federation public keys at the endpoint 
            <spanx style="verb">
                /.well-known/openid-federation-historical-jwks
            </spanx>.
            
            The purpose of this endpoint is to provide 
            the list of keys previously used by the Trust Anchor
            in order to provide non-repudiation of statements signed by 
            the Trust Anchor after key rotation.

            The historical keys of the Trust Anchor 
            guarantees participants the verifiability of the Trust Chains 
            even when the federation keys are changed.
          </t>

      
      <section title="Federation Historical Keys Request">
        <t>
            The request MUST be an HTTP request using the GET method and
            the https scheme to the well known endpoint 
            <spanx style="verb">openid-federation-historical-jwks</spanx>.
          </t>
          <figure>
            <preamble>
              The following is a non-normative example of a
              request:
            </preamble>
            <artwork><![CDATA[
GET /.well-known/openid-federation-historical-jwks HTTP/1.1
Host: trust-anchor.example.com
]]></artwork>
          </figure>
      </section>

      <section title="Federation Historical Keys Response">
          <t>
            A successful response MUST use the HTTP status code 200 
            and the content type set to 
            <spanx style="verb">application/jwk-set+jwt</spanx>.
            The response is a signed JWT containing the following 
            paramenters:
          </t>
          
          <t>
          <list style="hanging">
              <t hangText="iss">
                <vspace/>
                REQUIRED. String. 
                URL corresponding to the Trust Anchor Entity Identifier.
              </t>
              <t hangText="iat">
                <vspace/>
                REQUIRED. Number. 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="jwks">
                  <vspace/>
                  REQUIRED. A
                  <xref target="RFC7517">JSON Web Key Set (JWKS)</xref>
                  representing the public part of the Trust Anchor signing keys. 
                  
                  <t>
                    The JWK Set in the <spanx style="verb">jwks</spanx> claim,
                    in addition to what is defined in 
                    <xref target="RFC7517"> JSON Web Key Set (JWKS)</xref>
                    also adopts the following claims:
                  </t>
                  
                  <t>
                    <list style="hanging">
                      <t hangText="kid">
                        <vspace/>
                        REQUIRED. Parameter is used to match a specific key.
                        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="iat">
                        <vspace/>
                        REQUIRED. Time at which the JWK 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"/>.
                         on or after which the JWK MUST NOT be considered as valid.
                      </t>
                    </list>
                  </t>
                  
              </t>
          </list>
        </t>

          <figure>
            <preamble>
              The following is a non-normative example of a response, before serialization and adding a signature:
            </preamble>
            <artwork><![CDATA[
HTTP/1.1 200 OK
Content-Type: application/jwk-set+jwt

{
    "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
            }
        ]
}
]]></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 Trust Anchor Federation Entity Keys
            are changed. 
        </t>

<!--
  describe the concept
-->
        <t>
             The Federation Historical Keys endpoint 
             publishes the list of public keys used in the past by Trust Anchor.
             The given public keys are needed by all the Entities 
             to verify the Trust Chains evaluated in the past with the
             Federation Entity Keys not published anymore in the Trust Anchor's
             Entity Configuration.
        </t>

<!--
  give the technical details.
-->
        <t>
            Federation Historical Keys endpoint response contains a signed JWT 
            that attests all the expired Trust Anchor 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 a Leaf for the 
            signature operations related to the OpenID Connect 
            requests and responses.
            For example an Entity Statement issued for a Leaf
            MAY also include the 
            <spanx style="verb">jwks</spanx> claim, 
            respectively in the claims
            <spanx style="verb">metadata</spanx> or 
            <spanx style="verb">metadata_policy</spanx>. 
            
            <t>
              A simple example: In the following Trust Chain the 
              Federation Intermediary attests the Leaf's OpenID Connect 
              <spanx style="verb">jwks</spanx>
              in the Entity Statement issued for the Leaf. The result is 
              a Trust Chain that contains the Leaf's OIDC Core jwks, 
              needed to verify historical signature on 
              request objects, ID Tokens and any other signed JWT issued by the Leaf, 
              if it is an RP or an OP.
              
              <list style="numbers">
                <t>
                  an Entity Configuration about the RP published by the RP,
                </t>
                <t>
                  an Entity 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 Core <spanx style="verb">jwks</spanx>.
                </t>
                <t>
                  an Entity Statement about Organization A published by Federation F.
                </t>
              </list>
            </t>
            
        </t>
      </section>
      
      </section>
      
      <section title="Generic Error Response" anchor="error_response">
        <t>
          If the request was malformed, or some error occurred during
          processing of the request,
          the response body SHOULD be a JSON object with the content type
          set to <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>
              
            </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>
          <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 Trust Chain and Metadata">
      <t>
        An Entity (e.g., the consumer) that wants to establish trust with a
        remote peer MUST have the remote peer's Entity Identifier and a list of
        Entity Identifiers of Trust Anchors together with the public version
        of their signing keys. The consumer will first have to fetch
        sufficient Entity Statements to establish at least one chain of trust
        from the remote peer to one or more of the configured Trust Anchors.
        After that the Entity MUST validate the Trust Chains independently,
        and -- if there are multiple valid Trust Chains and if the
        application demands it -- choose one.
      </t>

      <section anchor="fetching-es"
               title="Fetching Entity Statements to Establish a Trust Chain">
        <t>
          Depending on the circumstances, the consumer MAY either be
          handed the remote peer'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 the remote peer.
        </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
         federation API (see <xref target="federation_endpoints"/>) is used to fetch Entity
         Statements about the intermediates and the remote peer.
        </t>
        <t>
         Note: The consumer SHOULD NOT attempt to fetch
          Entity Statements it already has fetched during this
          process (loop prevention).
        </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 the remote peer to at least one of the
          trusted Trust Anchors, then the list will be empty and there is no
          way of establishing trust in the remote peer's information. How the
          consumer deals with this is out of scope for this specification.
        </t>
      </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 the consumer 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>
          To validate the chain, the following MUST be done:
        </t>
        <t>
          <list style="symbols">
            <t>
              For each Entity Statement ES[j] j=i,..,0:
              <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 j=0 verify that <spanx style="verb">iss</spanx> ==
              <spanx style="verb">sub</spanx>.
            </t>
            <t>
              For j=0,...,i-1: Verify that ES[j]['iss'] == ES[j+1]['sub']
            </t>
            <t>
              For j=0,...,i-1: Verify the signature of ES[j] using a public
              key carried in ES[j+1]['jwks'].
            </t>
            <t>
              For j == 0 verify the signature of ES[0] using a public
              key carried in ES[0]['jwks'].
            </t>
            <t>
              For j == i: verify that a) the issuer matches the configured
              identifier of a Trust Anchor and b) its signature is valid with
              the likewise configured public key of said 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 to not verify the
          signature until all the other checks have been done.
        </t>
        <t>Consumers MAY cache Entity Statements or signature verification
          results for a given time until they expire, per
          <xref target="trust_lifetime"/>.
        </t>
        <t>
          Note that the second bullet point means that, at each step in the
          Trust Chain resolution, it MUST be verified that the signing JWK is
          also present in the <spanx style="verb">jwks</spanx>
      statement claim issued by the superior.
        </t>
      </section>
      <section title="Choosing One of the Valid Trust Chains">
        <t>
          If multiple valid Trust Chains are found, the consumer will
          need to decide on which one to use.
        </t>
        <t>
          One simple rule would be to prefer a shorter chain over a longer one.
        </t>
        <t>Consumers 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>) set.
          The expiration time of the whole Trust
          Chain is set to the minimum value of
          (<spanx style="verb">exp</spanx>) within the chain.
        </t>
      </section>
    </section>

    <section title="Updating Metadata, Key Rollover, and Revocation">
      <t>
        This specification allows for a smooth process of updating metadata
        and public keys.
      </t>
      <t>
        As described above in <xref target="trust_lifetime"/>,
        each Trust Chain has an expiration time.
        A consumer of metadata using this specification MUST support
        refreshing a Trust Chain when it expires.
        How often a consumer SHOULD re-evaluate the Trust Chain depends on
        how quickly the consumer wants to find out that something has changed
        in the Trust Chain.
      </t>

      <section title="Protocol Key Rollover">
        <t>
          If a Leaf Entity publishes its public keys in the metadata part
          using <spanx style="verb">jwks</spanx>, setting an expiration time on
          the self-signed Entity
          Statement can be used to control how often the receiving Entity is
          fetching an updated version of the public key.
        </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 a reasonable expiration
          time on that Statement, such that the consumers will re-fetch the
          Entity Configuration at reasonable intervals. If the Trust Anchor wants to
          roll over its signing keys it would have 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.
            </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 gotten access to 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 Trust Anchors that it administers that is independent of the Entity Configurations
      for those Trust Anchors.
      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 retreived via the independent mechanism specified by the Federation Operator
      SHOULD be be compared to those retreived 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 consumers are expected to check the Trust Chain at regular,
          reasonably frequent times, this specification does not specify a
          standard revocation process. Specific federations MAY make a
          different choice and will then have to add such a process.
        </t>
      </section>
    </section>

    <section title="OpenID Connect Communication" anchor="client_registration">
      <t>
        This section describes how the trust framework in this specification
        is used to establish trust between an RP and an OP
        that have no explicit configuration or registration 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 disable the use of one
        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 will use the procedure that is
        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 a 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 cannot 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 a request authentication
              method using the metadata claim
              <spanx style="verb">request_authentication_methods_supported</spanx>.
            </t>
          </list>
        </t>

        <section title="Authentication Request">
          <t>
            The Authentication Request is performed by passing a
        Request Object by value as described in Section 6.1 in
            <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>
            or using pushed authorization as described in
            <xref target="RFC9126">Pushed Authorization Requests</xref>.
          </t>
          <section title="Using a Request Object" anchor="UsingAuthzRequestObject">

            <t>
              In the case where 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 restrictions apply to the JWT:
              <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 claim <spanx style="verb">iss</spanx>
          MUST contain the client identifier.
                </t>
                <t hangText="sub">
                  <vspace/>
                  MUST NOT be present. This together with the value of
          <spanx style="verb">aud</spanx>
                  SHOULD make reuse of the statement for
          <spanx style="verb">private_key_jwt</spanx>
          client authentication not feasible.
                </t>
                <t hangText="jti">
                  <vspace/>
                  REQUIRED. JWT ID. A unique identifier for the JWT, which can
                  be used to prevent reuse of the token. These tokens 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. Expiration time on or after which the JWT MUST
                  NOT be accepted for processing.
                </t>
                <t hangText="iat">
                  <vspace/>
                  OPTIONAL. Time at which the JWT was issued.
                </t>
                <t hangText="trust_chain" anchor="trust_chain_param">
                  <vspace/>
                  OPTIONAL. Array containing the sequence of the statements
                  that compose the Trust Chain between the RP that makes
                  the request and the selected Trust Anchor,
                  sorted as shown in <xref target="trust_chain"/>.
                  Due to the large size of a Trust Chain it could be necessary 
                  to use the HTTP POST method,
                  <spanx style="verb">request_uri</spanx>
                   or 
                  <xref target="RFC9126">Pushed Authorization Request</xref>
                  for the request.
                </t>
              </list>
            </t>
            <figure>
              <preamble>
                The following is a non-normative example of the Claims in a
                Request Object before base64url encoding and signing:
              </preamble>
              <artwork><![CDATA[
{
  "aud": "https://op.example.org/authorization",
  "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",
  "trust_chain" : [
    "eyJhbGciOiJSUzI1NiIsImtpZCI6Ims1NEhRdERpYnlHY3M5WldWTWZ2aUhm ...",
    "eyJhbGciOiJSUzI1NiIsImtpZCI6IkJYdmZybG5oQU11SFIwN2FqVW1BY0JS ...",
    "eyJhbGciOiJSUzI1NiIsImtpZCI6IkJYdmZybG5oQU11SFIwN2FqVW1BY0JS ..."
  ]
}
]]></artwork>
            </figure>
            <figure>
              <preamble>
                The following is a non-normative example of an Authentication
                Request using the request parameter (with line wraps within
                values for display purposes only):
              </preamble>
              <artwork><![CDATA[
https://server.example.com/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=eyJhbGciOiJSUzI1NiIsImtpZCI6IjJIbm9GUzNZbkM5dGppQ2FpdmhXTFZVSjNB
      eHdHR3pfOTh1UkZhcU1FRXMifQ.eyJhdWQiOiJodHRwczovL29wLmV4YW1wbGUub
      3JnL2F1dGhvcml6YXRpb24iLCJjbGllbnRfaWQiOiJodHRwczovL3JwLmV4YW1wb
      GUuY29tIiwiZXhwIjoxNTg5Njk5MTYyLCJpYXQiOjE1ODk2OTkxMDIsImlzcyI6I
      mh0dHBzOi8vcnAuZXhhbXBsZS5jb20iLCJqdGkiOiI0ZDNlYzBmODFmMTM0ZWU5Y
      Tk3ZTA0NDliZTZkMzJiZSIsIm5vbmNlIjoiNExYMG1GTXhkQmprR210eDdhOFdJT
      25CIiwicmVkaXJlY3RfdXJpIjoiaHR0cHM6Ly9ycC5leGFtcGxlLmNvbS9hdXRoe
      l9jYiIsInJlc3BvbnNlX3R5cGUiOiJjb2RlIiwic2NvcGUiOiJvcGVuaWQgcHJvZ
      mlsZSBlbWFpbCBhZGRyZXNzIHBob25lIiwic3RhdGUiOiJZbVg4UE05STdXYk5vT
      W5uaWVLS0JpcHRWVzBzUDJPWiIsInN1YiI6Imh0dHBzOi8vcnAuZXhhbXBsZS5jb
      20iLCJ0cnVzdF9wYXRoX2hpbnQiOlsiaHR0cHM6Ly9pbnRlcm1lZGlhcnktb25lL
      m9yZyIsImh0dHBzOi8vaW50ZXJtZWRpYXJ5LXR3by5vcmciLCJodHRwczovL3Ryd
      XN0LWFuY2hvci5vcmciXX0.yJz8KKF-TZPzxG1iKRkhldlVzn6NtNpgpFK0Bm93v
      AGnDu6XxSfK1pHFOTYCnG8DH-c8k2QsL4zHQQjwVElcWJyNJKXUAkOhNufssJD09
      6CizIjDdHuzMs9-LAJH6e7eKbsE_-17xY7JvtxZGLDNAx9Dm4gBEl7H_8U5SorGW
      dSN8biVe3gySBivy7czrG2_afitpaEFMxDgy7wuU5aWKo9L1aaRSpcKpDHNq45Mz
      Ir4JTaSzob0Eil8H-QYUqqQR-ob86_gy7bHFhQMN-0lfXHkIl3riCo2JlxnjLctf
      IRa4r6OKgFMNDqPzGqgwPuXMbjhBTuJptUgsmbEwdsGYw
]]></artwork>
            </figure>
            <section title="Processing the Authentication Request" anchor="AuthzRequestProcessing">
              <t>
                When the OP receives an incoming Authentication Request,
                the OP supports OpenID Connect 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 to the OP a Trust Chain related to itself,
                using the <xref target="trust_chain_param">trust_chain</xref>
                parameter.

                If the OP doesn't have a valid registration for the RP or
                its registration has expired, the OP MAY use the received
                Trust Chain as a hint 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 shows more than a single authority hint in
                its Entity Configuration.

                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, with every 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>
                parameter.
              </t>
              <t anchor="TrustChainParamAbsent">
                If the RP doesn't include the
                <xref target="trust_chain_param">trust_chain</xref>
                in the request or the OP doesn't 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 type
                <spanx style="verb">openid_relying_party</spanx>.
              </t>
              <t>
                The OP SHOULD furthermore consider the resolved metadata of the
                RP,
                and verify that it complies with the client metadata
                specification
                in <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 through its metadata (underneath
                <spanx style="verb">metadata/openid_relying_party</spanx>).
              </t>
            </section>
          </section>
          <section title="Using Pushed Authorization">
            <t>
              <xref target="RFC9126">Pushed Authorization Requests</xref>
              provides an
              interoperable way to push the payload of a Request Object
              directly to the AS in exchange for a
          <spanx style="verb">request_uri</spanx>.
            </t>
            <t>
              When it comes to request authentication, the applicable
              methods are four:
              <list style="symbols">
                <t>Using a JWT for 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 as described in Section 2.2 of
                  <xref target="RFC8705"/>
                  based on self-signed certificates.
                  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 as described in Section 2.1 of
                  <xref target="RFC8705"/>
                  based on public key infrastructure (PKI).
                </t>
                <t>
                  A request object as described in Section 6 of
                  <xref target="OpenID.Core">OpenID Connect Core 1.0</xref>
                </t>
              </list>
              Note that if mTLS is used, TLS client authentication MUST be
              configured and, in case of self-signed certificates, the server must
              omit the certificate chain validation.
            </t>
            <t>Using the example above, a request could look like this:</t>
            <figure>
              <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>
                All the assumptions and requirements already defined 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 underneath the
                <spanx style="verb">metadata/openid_relying_party</spanx> element.
                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 will try to verify 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 regarded as correct.
                  </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 and the certificate used is a self-signed
                    certificate, then the 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>
                </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 to understand what is wrong.
          </t>
          <t>
            In addition to the error codes defined in Section 3.1.2.6 of OpenID
            Connect Core, 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 error response:
            </preamble>
            <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>
        Note that we anticipate that Automatic Registration could be employed
        for use cases beyond OpenID Connect Federation.
        If used with pure OAuth 2.0, for instance,
        Automatic Registration would occur during Authorization Requests.
        If for a particular such use case the client does not need to be securely identified,
        then the requirement for signed requests could be relaxed.
      </t>
        </section>

      </section>
      <section title="Explicit Registration" anchor="explicit">
        <t>
      This method involves performing an explicit registration step for a new client
      before the RP interacts with an OP for the first time,
          similarly to the process specified by
          <xref target="OpenID.Registration">OpenID Connect Dynamic Client Registration 1.0</xref>,
          but where the client registration request contains the Entity Configuration
          or an entire Trust Chain.
        </t>
        <section anchor="Clireg" title="Client Registration">
          <section anchor="Cliregreq" title="Client Registration Request">
            <t>
              An OP that supports OpenID Dynamic Client Registration as extended
              by this specification, signals this by having the claim
              <spanx style="verb">federation_registration_endpoint</spanx>
              in the OP's metadata.
            </t>
            <t>
              Given that the OP supports Explicit Registration, the RP
              progresses as follows:
            </t>
            <t>
              <list style="numbers">
                <t>
                  Once it has a list of acceptable Trust Anchors to the OP,
                  it MUST choose the subset it wants to progress with. This
                  subset can be as small as one Trust Anchor, but it can also
                  contain more than one.
                </t>
                <t>
                  Using this subset of Trust Anchors, the RP will choose 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.
                </t>
                <t>
                  The RP will now 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.
                </t>
                <t>
                  The RP MAY include its Entity Configuration
                  in a Trust Chain regarding itself.
                  The Registration Request will contain an
                  array containing the sequence of the
                  statements that compose the Trust Chain
                  between the RP that makes the request and the
                  selected Trust Anchor.
               </t>
                <t>
                  The Entity Configuration, or the entire Trust Chain,
                  is sent, using POST, to the
                  <spanx style="verb">federation_registration_endpoint</spanx>
                  defined in this document.
                </t>
                <t>
                  The content type of the Registration Request MUST be set to
                  <spanx style="verb">application/entity-statement+jwt</spanx>
                  if it contains only the Entity Configuration of the
                  requestor. Otherwise if it contains the Trust Chain, the
                  content type of the Registration Request MUST be set to
                  <spanx style="verb">application/trust-chain+json</spanx>.
                </t>
              </list>
            </t>
          </section>

          <section anchor="cliregresp" title="Client Registration Response">
            <section title="OP Constructing the Response">
              <t>
                <list style="numbers">
                  <t>
                    After the OP receives the registration request, it
                    checks if this contains an Entity Configuration or an
                    entire Trust Chain.
                 </t>
                 <t>
                    If the request contains an Entity Configuration, the OP
                    collects and
                    evaluates the Trust Chains starting with the
                    <spanx style="verb">authority_hints</spanx>
                    in the Entity Configuration of the requestor.
                    After it has verified at least one Trust Chain it
                    MUST verify that the signature on the received registration
                    request is correct.
                    If the OP finds more than one acceptable Trust Chain,
                    it MUST choose one Trust Anchor from those chains as the one it will
                    proceed with.
                  </t>
                  <t>
                    If the request contains a Trust Chain,
                    the OP MAY evaluate the statements in the Trust Chain
                    to make its Federation Entity Discovery procedure more efficient,
                    especially if the RP shows more than a single authority
                    hint in its Entity Configuration.

                  </t>
                  <t>
                    At this point, if there already exists a client
                    registration under the same Entity Identifier then that
                    registration MUST be regarded as invalid.
                    Note
                    that key material from the previous registration SHOULD be
                    kept to enable verifying signatures or decrypting
                    archived data.
                  </t>
                  <t>
                    The OP will now construct metadata policies and assertions
                    that, if applied to the RP's metadata statement, will result
                    in metadata that the OP finds acceptable.
                    Note
                    that the Client ID the OP chooses does not have to be
                    the same as the Entity Identifier of the RP.
                    To the Entity Statement it MUST add a
                    <spanx style="verb">trust_anchor_id</spanx>
                    claim, containing the Trust Anchor chosen in step 2.
                  </t>
                  <t>
                    It will sign and return the registration response (a signed
                    Entity Statement) to the RP.
                  </t>
                  
                  <t>
                    A successful response MUST use the HTTP status code 200 
                    and the content type set to 
                    <spanx style="verb">application/jose</spanx>.
                  </t>
                  <t>
                    If the response is negative, the response 
                    SHOULD be produced in accordance with what is defined in
                    <xref target="error_response"/>.
                  </t>
                  
                </list>
              </t>
            </section>

            <section title="RP Parsing the Response">
              <t>
                <list style="numbers">
                  <t>
                    If the response is positive, 
                    the RP verifies the correctness of the received Entity
                    Statement, making sure that one of the
                    <spanx style="verb">authority_hints</spanx>
                    it added to the registration request will lead to the
                    Trust Anchor the OP named using the claim
                    <spanx style="verb">trust_anchor_id</spanx>.
                  </t>
                  <t>
                    The RP MUST NOT apply metadata policies and assertions
                    from the Trust Chains that the OP provides because those
                    are not valid for the RP's metadata.
                    The RP MUST apply policies and assertions to the metadata
                    using one of its own Trust Chains that ends in the Trust
                    Anchor that the OP chose.
                    Once it has applied those policies and assertions, it can
                    then apply the policies and assertions returned from the OP.
                    This is equivalent to adding the OP's metadata policies and
                    assertions to the Trust Chain in between the RP's and its
                    immediate superior's Entity Statements.
                    When the RP has applied all the metadata policies and
                    assertions to its metadata statement, it then stores
                    the result and will use the agreed-upon metadata when
                    talking to the OP.
                  </t>
                  <t>
                    At this point the RP also knows which Trust Chain it should
                    use when evaluating the OP's metadata. It can therefore
                    apply the metadata policies and assertions on the OP's
                    metadata using the relevant Trust Chain and store the result
                    as the OP's metadata.
                  </t>
                  <t>
                    If the RP does not accept the received Entity Statement for
                    some reason, then it has the choice to restart the
                    registration process or to give up.
                  </t>
                </list>
              </t>
            </section>
          </section>
        </section>

        <section title="After Client Registration">
          <t>
            A client registration using the explicit method is not expected to
            be valid forever. The Entity Statements exchanged all have
            expiration times, which means that the registration will eventually
            time out. An OP can also, for administrative reasons, decide that a
            client registration is not valid anymore. An example of this could
            be the OP leaving the federation used to register an RP.
          </t>

          <t>
            The temporary nature of explicit registration means that an RP must
            expect its registration to become invalidated at any time, causing
            RP requests to the OP, such as authorization, token or UserInfo
            requests, to fail. An RP MAY devise appropriate strategies to
            re-register with the OP and restart the transaction when such a
            condition occurs.
          </t>

          <section title="What the RP MUST Do">
            <t>
              At regular intervals, the RP MUST:
            </t>
            <t>
              <list style="numbers">
                <t>
                  Starting with the OP's Entity Statement, resolve and verify
                  the Trust Chains it chooses to use when constructing the
                  registration request. If those Trust Chains do not exist
                  anymore or do not verify, then the registration SHOULD be
                  regarded as invalid and a new registration process SHOULD be
                  started.
                </t>
                <t>
                  If the OP's Entity Statement was properly formed the RP must
                  now verify that the Entity Statement it received about itself
                  from the OP is still valid.
                  Again, if that is not the case the registration
                  SHOULD be regarded as invalid and a new registration process
                  SHOULD be started.
                </t>
              </list>
            </t>
            <t>
              What is regarded as reasonable intervals will depend on
              federation policies and risk assessment by the maintainer of
              the RP.
            </t>
          </section>

          <section title="What the OP MUST Do">
            <t>
              At regular intervals, the OP MUST:
            </t>
            <t>
              <list style="numbers">
                <t>
                  If the signature on the registration request has expired, it
                  MUST mark the registration as invalid and demand that the
                  RP MUST re-register. Else
                </t>
                <t>
                  starting with the RP's client registration request, the OP
                  MUST
                  verify that there still is a valid Trust Chain terminating in
                  the Trust Anchor the OP chose during the registration process.
                </t>
              </list>
            </t>
          </section>
        </section>

        <section title="Expiration Times">
          <t>
            An OP MUST NOT assign an expiration time
            to an RP's registration that is later than the trust
            chain's expiration time.
          </t>
        </section>
      </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:

            <t anchor="MetadataUpdateHint">
            It solves the problem of OPs using RP metadata that has become stale.
            This may occur when the OP uses cached RP metadata from a Trust Chain
            that hasn't reached its expiration time yet. By passing the
            <xref target="trust_chain_param">trust_chain</xref>
            in the Request the RP can notify the OP that a
            change has taken place, thus letting the OP update its client
            registration and prevent potential temporary faults due to stale metadata.
            </t>

            <t anchor="TrustPathHint">
            It enables the RP to pass a verifiable hint which trust path to
            take in order 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 anchor="ECHint">
            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>
         </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>.
    The paragraphs that follow are excerpted from there.
      </t>
      <t>
    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
    represented as <spanx style="verb">family_name#ja-Hani-JP</spanx>.
    As another example, both <spanx style="verb">website</spanx> and
    <spanx style="verb">website#de</spanx> Claim Values might be returned,
    referencing a Web site in an unspecified language and a Web site
    in German.
      </t>
      <t>
    Since Claim Names are case sensitive, it is strongly RECOMMENDED
    that language tag values used in Claim Names be spelled using the
    character case with which they are registered in the
    IANA "Language Subtag Registry" <xref target="IANA.Language"/>.
    In particular, normally language names are spelled with lowercase characters,
    region names are spelled with uppercase characters, and
    scripts are spelled with mixed case characters.
    However, since BCP47 language tag values are case insensitive,
    implementations SHOULD interpret the language tag values supplied
    in a case-insensitive manner.
      </t>
      <t>
    Per the recommendations in BCP47, language tag values for Claims
    SHOULD only be as specific as necessary.
    For instance, using <spanx style="verb">fr</spanx> might be sufficient
    in many contexts, rather than <spanx style="verb">fr-CA</spanx> or
    <spanx style="verb">fr-FR</spanx>.
    Where possible, OPs SHOULD try to match requested Claim locales with
    Claims it has.  For instance, if the Client asks for a Claim with
    a <spanx style="verb">de</spanx> (German) language tag and the OP
    has a value tagged with <spanx style="verb">de-CH</spanx> (Swiss German)
    and no generic German value, it would be appropriate for the OP
    to return the Swiss German value to the Client.
    (This intentionally moves as much of the complexity of language tag
    matching to the OP as possible, to simplify Clients.)
      </t>
    </section>

    <section anchor="IANA" title="IANA Considerations">

      <section anchor="MetadataRegistry" title="OAuth Authorization Server Metadata Registry">
    <t>
      This specification registers the following metadata names 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): Section <xref target="OP_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 the OP
              </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:
        URI pointing to a signed JWT having the Entity's JWK Set 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="OP_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="OP_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 definition
      in the IANA "OAuth Dynamic Client Registration Metadata" registry
      <xref target="IANA.OAuth.Parameters"/>
      established by <xref target="RFC7591"/>.
    </t>
    <section anchor="draft-jones-oauth-resource-metadata" title="OAuth 2.0 Protected Resource Metadata">
    <t>
        This specification defines a metadata format that an OAuth 2.0 client
        can use to obtain the information needed to interact with an OAuth
        2.0 protected resource.
    </t>
    </section>
    <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:
        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): Section <xref target="RP_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 the RP
          </t>
          <t>
        Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
          </t>
          <t>
        Specification Document(s): Section <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:
        URI pointing to a signed JWT having the Entity's JWK Set as its payload
          </t>
          <t>
        Change Controller: OpenID Foundation Artifact Binding Working Group - openid-specs-ab@lists.openid.net
          </t>
          <t>
        Specification Document(s): Section <xref target="RP_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 Connect 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 Connect 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, mbj@microsoft.com
          </t>
          <t>
        Intended usage: COMMON
          </t>
          <t>
        Restrictions on usage: none
          </t>
          <t>
        Author: Michael B. Jones, mbj@microsoft.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, mbj@microsoft.com
          </t>
          <t>
        Intended usage: COMMON
          </t>
          <t>
        Restrictions on usage: none
          </t>
          <t>
        Author: Michael B. Jones, mbj@microsoft.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, mbj@microsoft.com
          </t>
          <t>
        Intended usage: COMMON
          </t>
          <t>
        Restrictions on usage: none
          </t>
          <t>
        Author: Michael B. Jones, mbj@microsoft.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, mbj@microsoft.com
          </t>
          <t>
        Intended usage: COMMON
          </t>
          <t>
        Restrictions on usage: none
          </t>
          <t>
        Author: Michael B. Jones, mbj@microsoft.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>

    </section>
      </section>

    <section anchor="ParameterRegistry" title="OAuth Parameter Registry">
        <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): Section <xref target="AuthzRequestProcessing"/> of [[ this specification ]]
              </t>
            </list>
          </t>
        </section>

      </section>

    </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 represent a
        filter against a propagation attacks. An attacker
        could exploit the Federation Entity Discovery mechanism and use an OIDC Federation
        to propagate many http requests. For each authorization request, crafted
        by an anonymous client, the OP would produce ~3 http requests to third parties
        in absence of intermediaries, and at least 5 http requests with at
        least one intermediary. If an OP doesn't find at least one
        valid Trust Mark in an Entity Configuration it should reject the request and
        temporary bans the requestor.
      </t>
      <t>
        If client authentication is not demanded at the Resolve endpoint
        then incoming requests should not by default result in immediate
        collection (Federation Entity Discovery process) and evaluation of Trust Chains.
      </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 Connect Federation but equally valid for
	other protocols when HTTPS to HTTP reverse proxies are used.
      </t>
    </section>
    </section>
  </middle>

  <back>

    <references title="Normative References">
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3339.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4732.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5646.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8615.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7515.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7517.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7519.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7591.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7638.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8414.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8705.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9101.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9126.xml"?>

      <reference anchor="OpenID.Core"
                 target="http://openid.net/specs/openid-connect-core-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="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="3" month="August" year="2015"/>
        </front>
      </reference>

      <reference anchor="OpenID.Discovery"
                 target="http://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="3" month="August" year="2015"/>
        </front>
      </reference>

      <reference anchor="OpenID.Registration"
                 target="http://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="3" month="August" year="2015"/>
        </front>
      </reference>

      <reference anchor="IANA.Language" target="https://www.iana.org/assignments/language-subtag-registry">
        <front>
          <title>Language Subtag Registry</title>
          <author>
            <organization>IANA</organization>
          </author>
      <date/>
        </front>
      </reference>

    </references>

    <references title="Informative References">
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2046.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6749.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6838.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8725.xml"?>
      <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"?>

      <reference anchor="IANA.OAuth.Parameters" target="http://www.iana.org/assignments/oauth-parameters">
        <front>
          <title>OAuth Parameters</title>
          <author>
            <organization>IANA</organization>
          </author>
      <date/>
        </front>
      </reference>

      <reference anchor="IANA.MediaTypes" target="http://www.iana.org/assignments/media-types">
        <front>
          <title>Media Types</title>
          <author>
            <organization>IANA</organization>
          </author>
      <date/>
        </front>
      </reference>

    </references>

    <section
            title="Provider Information Discovery and Client Registration in a Federation">
      <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 to the InCommon
        federation.
      </t>

      <figure>
        <preamble>
          The players
        </preamble>
        <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 at
        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 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
              Entity Statement endpoint, as described in
              <xref target="fetch_statement"/>.
            </t>
          </list>
        </t>
        <t>
          Once the previous 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 JWKS that the Entity
              plans to publish in its Entity Configuration.
            </t>
          </list>
        </t>
        <t>
          Now before the federation operator starts adding entities, there have to
          be policies in place 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 think about 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 Leaf Entity (in this case
          https://op.umu.se) using the process defined in
          <xref target="federation_configuration"/>.
          What follows thereafter is this sequence of steps:
          <list style="numbers">
            <t>Pick out the immediate superior entities using the authority
              hints
            </t>
            <t>
              Fetch the configuration for each such Entity. This uses the
              process defined in
              <xref target="federation_configuration"/>
            </t>
            <t>
              Using the fetch endpoint of the superiors to
              ask for information about the subordinate Entity
              <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 Entity Statements issued
          by a superior about its subordinate are used together with the
          Entity Configuration issued by the Leaf.
        </t>
        <t>
          The Entity Configuration concerning intermediates is not
          part of the Trust Chain.
        </t>
        <section title="Configuration Information for 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>
            <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 https://umu.se. So that is the next step.
          </t>
          <t>
            This Entity Configuration is the first link in the Trust Chain.
          </t>
        </section>
        <section title="Configuration Information 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>
          <t>The request will look like this:</t>
          <figure>
            <artwork><![CDATA[
GET /.well-known/openid-federation HTTP/1.1
Host: umu.se
            ]]></artwork>
          </figure>
          <t>And the GET will return:</t>
          <figure>
            <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
            Statement is
            the <spanx style="verb">federation_fetch_endpoint</spanx>,
            which is used in the next step.
          </t>
        </section>
        <section
                title="Entity 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>
          <t>The request will look like this:</t>
          <figure>
            <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>
          <t>and the result is this:</t>
          <figure>
            <artwork><![CDATA[
{
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://umu.se",
  "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\u00e5"
      },
      "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"
        ]
      }
    }
  },
  "sub": "https://op.umu.se"
}
]]></artwork>
          </figure>
          <t>
            This is the second link in the Trust Chain.
          </t>
          <t>
            Notable here is that this path leads to two Trust Anchors using the
            same next step ("https://swamid.se").
          </t>
        </section>
        <section title="Configuration Information 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>
          <t>The request will look like this:</t>
          <figure>
            <artwork><![CDATA[
GET /.well-known/openid-federation HTTP/1.1
Host: swamid.se
            ]]></artwork>
          </figure>
          <t>And the GET will return:</t>
          <figure>
            <artwork><![CDATA[
{
  "authority_hints": [
    "https://edugain.geant.org"
  ],
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "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"
    }
  },
  "sub": "https://swamid.se"
}
]]></artwork>
          </figure>
          <t>
            The only piece of information that is used from this Entity
            Statement is
            the <spanx style="verb">federation_fetch_endpoint</spanx>,
            which is used in the next step.
          </t>
        </section>
        <section
                title="Entity 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>
          <t>The request will look like this:</t>
          <figure>
            <artwork><![CDATA[
GET /fedapi?sub=https%3A%2F%2Fumu.se&
iss=https%3A%2F%2Fswamid.se HTTP/1.1
Host: swamid.se
            ]]></artwork>
          </figure>
          <t>and the result is this:</t>

          <figure>
            <artwork><![CDATA[
{
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://swamid.se",
  "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"
        ]
      }
    }
  },
  "sub": "https://umu.se"
}
]]></artwork>
          </figure>
          <t>
            This is the third link in the Trust Chain.
          </t>
          <t>
            If we assume that the issuer of this Entity 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="Configuration Information for 'https://edugain.geant.org'">
          <t>RP fetches the Entity Configuration from
            "https://edugain.geant.org" using the process defined in
            <xref target="federation_configuration"/>.
          </t>
          <t>The request will look like this:</t>
          <figure>
            <artwork><![CDATA[
GET /.well-known/openid-federation HTTP/1.1
Host: edugain.geant.org
            ]]></artwork>
          </figure>
          <t>And the GET will return:</t>
          <figure>
            <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>
            Again, the only thing we need is the
            <spanx style="verb">federation_fetch_endpoint</spanx>.
            As described in
            <xref target="key_rollover_anchor"/>,
            note SHOULD also be
            taken to <spanx style="verb">jwks</spanx> as the Trust Anchor MAY be
            performing a key rollover.
          </t>
        </section>
        <section
                title="Entity 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>
          <t>The request will look like this:</t>
          <figure>
            <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>
          <t>and the result is this:</t>
          <figure>
            <artwork><![CDATA[
{
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://edugain.geant.org",
  "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"
      }
    }
  },
  "sub": "https://swamid.se"
}
]]></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 would be
            the fourth and final Entity Statement in the Trust Chain.
          </t>
          <t>
            We now have the whole chain from the Entity Configuration of
            the
            Leaf Entity up until the last one that is issued by a Trust Anchor. All in
            all,
            we have:
            <list style="numbers">
              <t>Entity Configuration by the Leaf Entity (https://op.umu.se)</t>
              <t>Entity Configuration by https://umu.se</t>
              <t>Statement issued by https://umu.se about https://op.umu.se</t>
              <t>Entity Configuration by https://swamid.se</t>
              <t>Statement issued by https://swamid.se about https://umu.se</t>
              <t>Entity Configuration by https://edugain.geant.org</t>
              <t>Statement issued by https://edugain.geant.org about
                https://swamid.se
              </t>
            </list>
          </t>
          <t>
            Using the public keys of the Trust Anchor that the LIGO Wiki RP has
            been
            provided with in 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 op.umu.se">
          <t>Having verified the chain, the LIGO Wiki RP can proceed with the
            next step.
          </t>
          <t>Combining the metadata policies from the tree Entity 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:
          </t>
          <figure>
            <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\u00e5",
  "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 title="The Two Ways of Doing Client Registration">
        <t>
          As described in
          <xref target="client_registration"/>,
          there are two
          ways which 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 metadata for the RP to use. 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 Registration)">
          <t>
            The LIGO Wiki RP does not do any registration but goes directly to
            sending an Authentication Request.
          </t>
          <t>
            Here is an example of such an Authentication Request:
          </t>
          <figure>
            <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 by the Leaf Entity
                  https://wiki.ligo.org
                </t>
                <t>Statement issued by https://incommon.org about
                  https://wiki.ligo.org
                </t>
                <t>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 with in 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>
                    <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>
                    <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>
            <t>
              Combining these and apply them to the metadata for
              wiki.ligo.org:
            </t>
            <figure>
              <artwork><![CDATA[
"metadata": {
  "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>
            <t>
              The final result is:
            </t>
            <figure>
              <artwork><![CDATA[
{
  "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>
              Having that, the registration is done, and the OP MUST now use
              the keys found at the URL specified in
              <spanx style="verb">signed_jwks_uri</spanx>
              to verify the signature on the Request Object in the
              Authentication Request.
            </t>
          </section>
        </section>
        <section
                title="Client Starts with Registration (Explicit Client Registration)">
          <t>
            Here the LIGO Wiki RP sends a client registration request to the
            <spanx style="verb">federation_registration_endpoint</spanx>
        of the OP (op.umu.se).
            What it sends is an Entity Configuration.
          </t>
          <t>
            Once the OP has the Entity Statement, it proceeds with the same
            sequence of steps as laid out in <xref target="op_discovery"/>.
          </t>
          <t>
            The OP will end up with the same RP metadata as was described in
            <xref target="rp_metadata_eval"/>, but what it now can do is
            return a metadata policy that it wants to be applied to the RP's
            metadata. This metadata policy will be combined with the
            Trust Chain's combined metadata policy before being applied to the
            RP's metadata.
          </t>
          <t>
            If we assume that the OP does not support refresh tokens,
            it MAY want to add a metadata policy that says:
          </t>
          <figure>
            <artwork><![CDATA[
"metadata_policy": {
  "openid_relying_party": {
    "grant_types": {
      "subset_of": [
        "authorization_code"
      ]
    }
  }
}
]]></artwork>
          </figure>
          <t>
            Thus, the Entity Statement returned by the OP to the RP MAY look
            like this:
          </t>
          <figure>
            <artwork><![CDATA[

{
  "trust_anchor_id": "https://edugain.geant.org",
  "metadata_policy": {
    "openid_relying_party": {
      "application_type": {
        "one_of": [
          "web",
          "native"
        ]
      },
      "contacts": {
        "add": [
          "ops@incommon.org",
          "ops@edugain.geant.org"
        ]
      },
      "grant_types": {
        "subset_of": [
          "authorization_code",
          "refresh_token"
        ]
      }
    }
  },
  "metadata": {
    "openid_relying_party": {
      "client_id": "m3GyHw",
      "client_secret_expires_at": 1604049619,
      "client_secret":
        "cb44eed577f3b5edf3e08362d47a0dc44630b3dc6ea99f7a79205"
      "client_id_issued_at": 1601457619,
    }
  },
  "authority_hints": [
    "https://incommon.org"
  ],
  "aud": "https://wiki.ligo.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"
      }
    ]
  },
  "iss": "https://op.umu.se",
  "iat": 1601457619,
  "exp": 1601544019
}
]]></artwork>
          </figure>
          <t>
            And the resulting metadata used by the RP could look like:
          </t>
          <figure>
            <artwork><![CDATA[
{
  "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"
}
]]></artwork>
          </figure>

        </section>
      </section>
    </section>
    <section anchor="Notices" title="Notices">
      <t>
        Copyright (c) 2022 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:
        Heather Flanagan,
        Samuel Gulliksson,
        Takahiko Kawasaki,
        Torsten Lodderstedt,
        Roberto Polli,
        Jouke Roorda,
        Mischa Sallé,
        Marcos Sanz,
        Peter Schober,
        Michael Schwartz,
    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>
        -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 OAuth2 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>
