<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> <!-- used by XSLT processors -->
<!-- OPTIONS, known as processing instructions (PIs) go here. -->
<!-- For a complete list and description of PIs,
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable PIs that most I-Ds might want to use. -->
<?rfc strict="yes" ?> <!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC): -->
<?rfc toc="yes"?> <!-- generate a ToC -->
<?rfc tocdepth="2"?> <!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references: -->
<?rfc symrefs="yes"?> <!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?> <!-- sort the reference entries alphabetically -->
<!-- control vertical white space:
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?> <!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?> <!-- keep one blank line between list items -->
<!-- end of popular PIs -->
<rfc  category="info" docName="draft-poehn-dame-06" ipr="trust200902">
  <front>
    <title abbrev="Metadata Exchange in SAML Web SSO Profile">Integration of Dynamic Automated
  Metadata Exchange into the SAML 2.0 Web Browser SSO Profile</title>
    <author fullname="Daniela Poehn" initials="D." surname="Poehn">
      <organization>Leibniz Supercomputing Centre</organization>
      <address>
        <postal>
      <street>Boltzmannstrasse 1</street>
      <city>Garching n. Munich</city>
      <region>Bavaria</region>
      <code>85748</code>
      <country>Germany</country>
        </postal>
      <phone>+49 (0) 89 35831 8763</phone>
<!-- <facsimile/> -->
      <email>poehn@lrz.de</email>
<!-- <uri/> -->
      </address>
    </author>
    <author fullname="Stefan Metzger" initials="S." surname="Metzger">
      <organization>Leibniz Supercomputing Centre</organization>
      <address>
        <postal>
      <street>Boltzmannstrasse 1</street>
      <city>Garching n. Munich</city>
      <region>Bavaria</region>
      <code>85748</code>
      <country>Germany</country>
        </postal>
      <phone>+49 (0) 89 35831 8846</phone>
<!-- <facsimile/> -->
      <email>metzger@lrz.de</email>
<!-- <uri/> -->
      </address>
    </author>
    <author fullname="Wolfgang Hommel" initials="W." surname="Hommel">
      <organization abbrev="Universitaet der Bundeswehr Muenchen">Universitaet der Bundeswehr Muenchen, Computer Science Department</organization>
      <address>
        <postal>
      <street>Werner-Heisenberg-Weg 39</street>
      <city>Neubiberg</city>
      <region>Bavaria</region>
      <code>85577</code>
      <country>Germany</country>
        </postal>
      <phone>+49 (0) 89 6004 2495</phone>
<!-- <facsimile/> -->
      <email>wolfgang.hommel@unibw.de</email>
<!-- <uri/> -->
      </address>
    </author>
	    <author fullname="Michael Grabatin" initials="M." surname="Grabatin">
      <organization abbrev="Universitaet der Bundeswehr Muenchen">Universitaet der Bundeswehr Muenchen, Computer Science Department</organization>
      <address>
        <postal>
      <street>Werner-Heisenberg-Weg 39</street>
      <city>Neubiberg</city>
      <region>Bavaria</region>
      <code>85577</code>
      <country>Germany</country>
        </postal>
      <phone>+49 (0) 89 6004 3992</phone>
<!-- <facsimile/> -->
      <email>michael.grabatin@unibw.de</email>
<!-- <uri/> -->
      </address>
    </author>
    <date month='June' year="2016" />
<area>Applications</area>
      <keyword>Federated identity management</keyword>
      <keyword>Security assertion markup language</keyword>
      <keyword>On-demand metadata exchange</keyword>
      <keyword>Trusted third party</keyword>
      <keyword>Technical trust establishment</keyword>
      <keyword>Dynamic Federations</keyword>
<!-- <keyword/> -->
    <abstract>
      <t>
        This document specifies the integration of Dynamic Automated
        Metadata Exchange (DAME) through an intermediate trusted
        third party into the Security Assertion Markup Language
        (SAML) 2.0 Web Browser SSO Profile. The user-triggered, on-demand, and fully automated metadata
        exchange between identity provider (IDP) and service
        provider (SP) is intended for scenarios in which the
        a-priori, e.g., federation-based exchange of SAML metadata
        is neither practical, scalable nor mandatory for non-technical
        aspects, such as contract-based trust building between IDP
        and SP. The main benefit of DAME is the removal of waiting times
        for users and manual setup tasks for IDP and SP
        administrators before users can access the service. Implementations of DAME can leverage existing metadata
        repositories, such as REEP, and metadata transfer protocols,
        such as MD Query.
    </t>
    </abstract>

    </front>
  <middle>

<!-- Section 1: Introduction -->
    <section title="Introduction">
      <t>
        In a federated identity management scenario, enabling communication
        between an identity provider and a service provider is possible within trust
        boundaries, which typically entails joining one or several federations
        before the exchange of metadata takes place. The exchange of SAML metadata is
        out of scope of the SAML specifications, but normally done by pre-sharing metadata
        files of all entities within the trust boundaries.
      </t>
      <t>
        This document specifies the HTTP-based <xref target="RFC7230"/> integration of
        SAML metadata exchange into the SAML2 Web Browser SSO
        <xref target="OASIS.saml-profiles-2.0-os"/> profile. Focusing on the automation
        and the on-demand initiation of the metadata exchange between an identity provider
        and a service provider to build a form of opportunistic trust, even if these do not
        share membership in a common federation a-priori or if regular federation scenarios
        are not suitable. This could be the case in projects containing partners outside
        regular federations. The initiation of the metadata exchange starts after the identity
        provider discovery in order to keep the user experience consistent with traditional
        federation-based service access.
      </t>
      <t>
        This document specifies the initiation of the metadata exchange but does not anticipate
        the use of either a public metadata registry or the metadata query itself. The metadata exchange
        is triggered by a trusted third party, which does not interfere in further
        communication once identity provider and service provider have successfully exchanged
        their metadata. In contrast to identity provider proxies, the trusted third party
        does not cache assertions nor is it involved in subsequent communication. Integrated
        identity provider discovery, the mutual exchange of required SAML metadata, and
        user authentication take place in a fully automated, user-initiated, and on-demand
        manner. To provide a flexible solution, either pull-based metadata exchange,
        such as the SAML Profile for MD Query <xref target="I-D.young-md-query-saml"/>, or any kind of push mechanism
        can be used.
      </t>

    <t>
    The degree of integration chosen for DAME explicitly does not imply that disclosing personally identifiable
    information is required from an identity provider by sending it to any
    particular service provider. This is left to appropriate means, e.g.,
    explicitly acquiring user consent, in compliance with regulations and policies.
    </t>

    <t>
    The described integration addresses the protocol, content and processing of SAML
    messages for interoperability, referring to <xref target='SAML2Int'/>, but also
    specifies some deployment details and phases for cross-boundary trust. Fitting in seamlessly with implemented SAML-based SSO workflows
    and being scalable for a large number of users and entities without exceeding
    administrative procedures, it enables to participate in dynamically set up federations.
    </t>

<!-- Section 1.1: Notation and Conventions -->
       <section title="Notation and Conventions">
        <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 1.2: Terminology -->
       <section title="Terminology">
     <t>
     This document uses identity management terminology from
           <xref target="RFC6973"/> and <xref target="OASIS.saml-glossary-2.0-os"/>. In
     particular, this document uses the terms identity provider, service
     provider and identity management. Furthermore, it uses following terminology:
     </t>
     <t>
            Entity - A single logical construct for which metadata is
     provided. This is usually either a service provider (SP)
     or an identity provider (IDP).
     </t>
     <t>
     Metadata - The SAML metadata specification is a machine-readable description of
     certain entity characteristics and contains information about, e.g., identifiers,
     endpoints, certificates and keys.
     </t>
     <t>
     Trusted Third Party - An intermediate entity facilitating interaction between different
     entities, which trust the third party (TTP).
     </t>
     </section>
    </section>

<!-- Section 2: SAML Profiles, Bindings and Metadata Extension -->
    <section title="SAML Profiles and Bindings">
     <t>
     Based on <xref target="OASIS.saml-profiles-2.0-os" />, SAML profiles define rules how
     to embed SAML assertions in or combine them with other objects as files or protocol data
     units of communication protocols. The profile defined in this document is based on
     the existing SAML Web Browser SSO profile, which implements the SAML Authentication
     Request protocol <xref target="OASIS.saml-core-2.0-os" /> enhanced by a trusted
     entity between an originating party (IDP) and a receiving party
     (SP).
     </t>
     <t>
     A SAML binding <xref target="OASIS.saml-bindings-2.0-os" /> maps request-response
     messages of the SAML protocol onto standard communication protocols. For compliance
     reasons with the underlying Web Browser SSO profile, the SAML HTTP Redirect and
     HTTP POST Bindings MUST be used. 
     </t>

     <t>
     SAML metadata information MUST be extended to support this protocol. For each
     entity a MetadataSyncLocation MUST be defined, e.g., for an IDP
     idp.example.net. To ensure conformity and uniqueness of the attribute the 
     URN namespace for GEANT  <xref target="RFC4926"/> MUST be used:
      <figure align="left" anchor="mdsynclocation" suppress-title="true">
       <artwork align="left"><![CDATA[
       <md:Extensions>
         <dame:DAMEInfo xmlns:dame="urn:geant:dame">
           <dame:MetadataSyncLocation>
             https://idp.example.net/idp/profile/SAML2/DAME
           </dame:MetadataSyncLocation>
         </dame:DAMEInfo>
       </md:Extensions>
      ]]></artwork>
      </figure>
     </t>
    </section>


<!-- Section 3: Protocol -->

    <section anchor="Protocol" title="Protocol">
     <t>
     The protocol defined in this document MUST be divided into two phases:
     </t>
     <t>
        <list style="symbols">
          <t>
             Discovery of the appropriate IDP
          </t>

          <t>
             User authentication on behalf of the SP through a TTP

            <list style="letters">
              <t hangText="short">User authentication to TTP</t>

              <t hangText="short">On-demand metadata exchange</t>

              <t hangText="short">User authentication to SP</t>
         </list>
         </t>
       </list>
     </t>
     <t>
     The protocol defined in this document primarily adds the on-demand metadata exchange
     between IDP and SP, which is triggered by the user.
     The exchange of the metadata itself is explicitly out of scope. The authentication to the
     TTP step in the latter phase is required due to the security
     considerations discussed below.
     </t>

<!-- Section 3.1: Identifiers -->

    <section anchor="Identifiers" title="Identifier">
    <t>
    entityID - Specifies the unique identity of an entity, whose metadata is
    exchanged, as specified in <xref target="OASIS.saml-metadata-2.0-os"/> and
    <xref target="OASIS.saml-idp-discovery"/>.
    </t>
    </section>


<!-- Section 3.2: IDP Discovery -->

    <section anchor="IDPDiscovery" title="IDP Discovery">
    <t>
    A web user attempts to access a secured resource provided by a SP
    via an HTTP user agent. Missing an established technical trust relationship, a
    certain IDP MUST be discovered by the discovery functionality that is
    integrated into or accessible via the TTP.
    </t>
     <figure align="center" anchor="artdiscfig1" suppress-title="true">
        <preamble></preamble>

        <artwork align="left"><![CDATA[

     User agent               SP                     TTP
         |                    |                       |
         |----HTTP Request--->|                       |
         |                    |                       |
         |---HTTP Redirect----|                       |
         |                    |                       |
         |--------------------------HTTP Request----->|
         |                    |                       |
         |<------Selection of identity provider ----->|
         |                    |                       |
         |--------------------------HTTP Redirect-----|
         |                    |                       |
         |---HTTP Request---->|                       |
         |                    |                       |

            ]]></artwork>

        <postamble>Figure 1: Identity provider discovery.</postamble>
      </figure>

  <section anchor="Request1" title="Redirect to trusted third party">
  <t>
    Analogous to the SAML identity provider discovery profile <xref target="OASIS.saml-idp-discovery"/>,
    the SP redirects the user agent to the TTP with an
  HTTP GET request including the REQUIRED or OPTIONAL parameters specified in
  <xref target="OASIS.saml-idp-discovery"/>.
    </t>
    <t>
    In distinction to the existing discovery profile, the OPTIONAL "isPassive" parameter,
    which controls the visible interaction with the user agent, SHOULD NOT be set to "true"
  in this profile. If the parameter "isPassive" is used, the request sent to the TTP
  MUST contain the entityID of the IDP as a URL query. The URL query is indicated by the '?' 
  operator, followed by variable name entityID, '=', and the variable's value <xref target='RFC3986'/>. This template provides both
  a structural description and machine-readable instructions.
    </t>
    <t>
      The URLs of the participating entities MUST be known to the TTP
      through the metadata. The URLs depend on the implementation and MAY include
      the literal string "DAME" as query <xref target='RFC3986'/>, indicating the usage of this
      profile for dynamic automated metadata exchange.
    </t>
    </section>

    <section anchor="Response1" title="Response to service provider">
    <t>
    The TTP MUST respond by redirecting the user agent back to the
    requesting SP with an HTTP GET request message to the location
    specified in the return parameter of the original request. The unique identifier of
    the selected IDP MUST be included as value of the query string parameter
    specified as returnIDParam or the entityID if no parameter was supplied.
    </t>
    </section>

    <section anchor="Failure" title="Failure processing">
    <t>
    If the IDP was not determined or the discovery service cannot answer or
    an unspecified communication error occurs, the discovery service MAY halt further
    processing, either displaying an error message to the user agent or redirecting the
  user agent back to the SP.
    </t>
    </section>

    <section anchor="Action" title="Further actions">
    <t>
    After receiving the information about the selected IDP it is RECOMMENDED
    that the SP verifies acceptance. If the IDP has not been
    accepted, the SP halts processing and displays an error message to
  the user agent.
    </t>
    </section>
 </section>

<!-- Section 3.3: Authentication request protocol using a Trusted Third party -->

    <section anchor="AuthRequestTTP" title="Authentication Request Protocol using a TTP">

    <t>
    In the second phase of the protocol user authentication MUST be performed. The trusted
    third party relays the SP's authentication request to the IDP. For this step,
    the authentication request of the SP is cached and a new authentication request
	is sent to the IDP as both entities do not have previously exchanged
	their metadata. These authentication requests are REQUIRED to ensure that a
	metadata exchange will be initiated only if the user has successfully been
	authenticated by the selected IDP.
    </t>

    <figure align="center" anchor="artauthfig2" suppress-title="true">
        <preamble></preamble>
        <artwork align="left"><![CDATA[

User agent         SP                 TTP                 IDP
  |                |                   |                   |
  |--HTTP Redirect-|                   |                   |
  |                |                   |                   |
  |-----------AuthRequest1------------>|                   |
  |                |                   |                   |
  |--------------------HTTP Redirect---|                   |
  |                |                   |                   |
  |----------------------------------------AuthRequest2--->|
  |                |                   |                   |
  |<-----------------User authentication------------------>|
  |                |                   |                   |
  |                |                   |<---AuthResponse2--|
  |                |                   |                   |
  |                |                   |----MDI Request--->|
  |                |                   |                   |
  |                |                   |<---MDI Response---|
  |                |                   |                   |
  |                |<----MDI Request---|                   |
  |                |                   |                   |
  |                |---MDI Response--->|                   |
  |                |                   |                   |
  |--------------------HTTP Redirect---|                   |
  |                |                   |                   |
  |----------------------------------------AuthRequest1--->|
  |                |                   |                   |
  |                |<-----------AuthResponse1--------------|
  |                |                   |                   |
  |<-HTTP Response-|                   |                   |
  |                |                   |                   |
  ]]></artwork>
     <postamble>Figure 2: User authentication Request Protocol using a TTP.</postamble>
  </figure>


    <section anchor="AuthtoTTP" title="User authentication to trusted third party">
    <t>
    In the first sub-phase the user MUST be authenticated by the selected identity
    provider, but in distinction to <xref target="OASIS.saml-idp-discovery"/>, the trusted
    third party initiates the authentication.
    </t>


      <section anchor="Request2" title="Authentication Request of SP to TTP">
      <t>
      After accepting the selected IDP, the SP creates and sends
      a SAML Authentication Request message (AuthnRequest) to the TTP
      using an HTTP Redirect to transfer the message through the user agent.

    <!-- The sessionID
    parameter MUST be included as an additional query string parameter to link the
    authentication request with the previous IDP selection.-->
    It is RECOMMENDED that this request message is signed or otherwise authenticated and
    integrity-protected by the requesting SP.
      </t>
  </section>

  <section anchor="TTP" title="Store AuthnRequest at TTP">
     <t>
     The TTP MUST temporarily store the SAML AuthnRequest message by
     means out of scope of this specification.
     </t>
     </section>

     <section anchor="Request3" title="Authentication Request of TTP to IDP">
     <t>
     After that, a second SAML AuthnRequest message MUST be sent by the trusted
     third party to the selected IDP using a HTTP redirect message to
     authenticate the user. The OPTIONAL "ForceAuthn" <xref target="OASIS.saml-core-2.0-os" /> 
     parameter MAY be included in the request.
     The AuthnRequest message SHOULD be signed or otherwise authenticated and integrity
     protected by the TTP or by the protocol binding used to deliver the
     message.
     </t>
     </section>

     <section anchor="AuthN" title="User authentication">
     <t>
     The user MUST be identified and authenticated by the IDP by some means
     out of scope of this profile. A new authentication SHOULD be performed
     unless the IDP can rely on a previously authenticated session.
     A previous session MUST NOT be reused if the request contains a "ForceAuthn" parameter.
     </t>
     </section>

     <section anchor="Response2" title="Authentication Response to TTP">
     <t>
     The IDP MUST issue a SAML AuthnResponse message to the TTP
     containing one or more assertions or an error message with a status describing the error
     occurred. The HTTP POST binding MUST be used to transfer the message. It is RECOMMENDED
     that the message is signed by the IDP or otherwise authenticated or
     integrity-protected.
     </t>
     </section>
    </section>

  <section anchor="MDX" title="Metadata Exchange orchestrated by TTP">
    <t>
    In the second sub-phase, the metadata of SP and IDP are
    exchanged in a way that is orchestrated and synchronized by the TTP.
    </t>

    <section anchor="Metadata" title="MDI Request">
     <t>
     After the user has been authenticated, the TTP MUST initiate the
     metadata integration (MDI) between IDP and SP by a
     metadata integration request. The URL <xref target='RFC3986'/> sent to the entities for the MDI request SHOULD 
   contain the query elements {?action,entityID}. The variable name 'action' MUST
   be followed by '=' and the variable's value 'fetchmetadata'. The variable name 
   'entityID' is followed by '=' and the variable's value.
     </t>
     <t>
     The means used for the metadata exchange are implementation-dependent.
     The TTP MAY trigger a metadata query as described by the work in
     progress about the Metadata Query Protocol <xref target="I-D.young-md-query"/>
	 and the SAML Profile for the Metadata Query Protocol <xref target="I-D.young-md-query-saml"/>.
     </t>
     <t>
     IDP and SP MUST integrate each other's metadata in their
     configuration. It is RECOMMENDED that the IDP is triggered regarding metadata
     integration before the SP because it MAY object to accepting certain service
     providers. But any kind of concurrent operation MAY be supported.
     </t>
	 <t>
	 It is RECOMMENDED that the TTP queries the IDP before the metadata exchange
	 because it MAY be the case that the IDP has already integrated the SP's metadata. The
	 IDP SHOULD then indicate the found metadata by the appropriate HTTP status code according to <xref target="I-D.young-md-query"/>.
	 </t>
     </section>

     <section anchor="Response3" title="MDI Response">
     <t>
     After each other's metadata is integrated, each entity MUST send a metadata integration
     response message to the TTP containing the status of the integration by the HTTP
	 status code.
     </t>
     <t>
     If an entity was not able to integrate the metadata before sending the response,
     the status MUST indicate this state and a new request MUST be sent by the entity
     containing the status after the integration.
     </t>
   <t>
   If an error occurs integrating the metadata, the message MUST contain a HTTP status code
   describing the error and the TTP MUST halt further processing by
   displaying an error message to the user agent. It is RECOMMENDED to roll back any
   configuration changes by some means out of scope of this specification.
     </t>
     </section>
    </section>

    <section anchor="Response4" title="User authentication to service provider">
     <t>
     In last step the stored AuthnRequest of the SP MUST be presented by
     the TTP to the IDP if no error occurred beforehand.
   Because of the successful user authentication already initiated by the trusted third
   party, the IDP SHOULD respond with an assertion transferred to the service
   provider without further act of authentication, except for the case where the request
   contains a "ForceAuthn" parameter.
     </t>

     <t>
     The IDP MUST issue a SAML AuthnResponse message to the services provider's
     AssertionConsumerServiceURL. After receiving the response, the SP MUST
     decide if the user gets access to the requested resource based on the information contained
     within the SAML assertion.
     </t>

     </section>
     </section>
   </section>

   <!-- Section 5: Example -->

   <section anchor="Example" title="Example">
   <t>
   Considering two organizations, SP S (sp.example.com) and identity
   provider I (idp.example.net). User U initiates the SAML metadata exchange between these
   entities using an user agent through the TTP T (ttp.example.org).
   </t>

   <!-- Section 5.1: IDP Discovery -->
      <section anchor="ExampleIDP" title="IDP Discovery">

   <t>
   After requesting access to a secured resource via HTTPS, S redirects U to the
   discovery service of T:
   <figure align="left" anchor="srccode1" suppress-title="true">
     <artwork align="left"><![CDATA[
     GET /discovery/DAME?entityID=https%3A%2F%2Fsp.example.com%2FSSO
        &return=https%3A%2F%2Fsp.example.com%2FSSO%2FTTP%3FSAMLDS%3D1
        %26target%3Dtarget HTTP/1.x
     Host: ttp.example.org
    ]]></artwork>
   </figure>
   </t>

   <t>
   U selects an appropriate IDP I. T redirects U back to S using the following message:
   <figure align="left" anchor="srccode3" suppress-title="true">
     <artwork align="left"><![CDATA[
     HTTP/1.x 302 Found
     ...
     Location: https://sp.example.com/SSO/DAME?SAMLDS=1&target=target
     &entityID=https%3A%2F%2Fidp.example.net%2Fidp%2FSAMLidp
    ]]></artwork>
   </figure>
   </t>

   <t>
   <figure align="left" anchor="srccode4" suppress-title="true">
        <preamble>
        </preamble>
   <artwork align="left"><![CDATA[
     GET /SSO/DAME?SAMLDS=1&target=target
       &entityID=https%3A%2F%2Fidp.example.net%2Fidp%2FSAMLidp
     Host: sp.example.com
   ]]></artwork>
   </figure>
  </t>


 </section>

   <!-- Section 5.2: AuthN -->
      <section anchor="ExampleMeta" title="Authentication Request Protocol using a TTP">
   <t>
   Receiving U's selection, S redirects the user to T containing a SAML
   authentication request (AuthnRequest1):
   <figure align="left" anchor="srccode5" suppress-title="true">
     <artwork align="left"><![CDATA[
       HTTP/1.x 302 Found
       ...
       Location:
       https://ttp.example.org/discovery/DAME?action=authenticate
       &idpEntityID=https%3A%2F%2Fidp.example.net%2Fidp%2FSAMLidp
       &SAMLRequest=fZHNTsMwEIRfJf.....
       ...
     ]]></artwork>
   </figure>
   </t>

   <t>
    <figure align="left" anchor="srccode6" suppress-title="true">
     <artwork align="left"><![CDATA[
       GET /DAME?action=authenticate
          &SAMLRequest=fZHNTsMwEIRfJf.....
          &RelayState=target
       Host: ttp.example.org
     ]]></artwork>
    </figure>
   </t>


   <t>
   T temporarily stores the authentication request and redirects U to I sending
   a second authentication request (AuthnRequest2) containing the SAML request:
   <figure align="left" anchor="srccode8" suppress-title="true">
     <artwork align="left"><![CDATA[
       GET /idp/profile/SAML2/Redirect/SSO
          ?SAMLRequest=lZLBbhshEIZfBXHfh..... HTTP/1.x
       Host: idp.example.net
     ]]></artwork>
   </figure>
   </t>

   <t>
   After successful authentication, I issues a SAML authentication response message
   to T:
   <figure align="left" anchor="srccode9" suppress-title="true">
     <artwork align="left"><![CDATA[
       POST /SSO/SAML2/POST HTTP/1.x
       POSTDATA
          Referer:...
          Set-Cookie:...
     ]]></artwork>
   </figure>
   </t>

   <t>
   As U is successfully authenticated, I and S are triggered to fetch each others
   metadata by T using the appropriate TTPMetadataSyncLocation defined in the
   entity's SAML metadata, e.g., /idp/profile/SAML2/DAME:
   <figure align="left" anchor="srccode10" suppress-title="true">
     <artwork align="left"><![CDATA[
      GET /idp/profile/SAML2/DAME?action=fetchmetadata
         ?entityID=https%3A%2F%2Fsp.example.com%2FSSO HTTP/1.x
      Host: idp.example.net
     ]]></artwork>
   </figure>
   </t>

   <t>
    <figure align="left" anchor="srccode11" suppress-title="true">
     <artwork align="left"><![CDATA[
      GET SSO/DAME?action=fetchmetadata
         ?entityID=https%3A%2F%2Fidp.example.net%2Fidp%2FSAMLidp
      Host: sp.example.com
     ]]></artwork>
   </figure>
   </t>

   <t>
   The entities download the metadata from T using, e.g., SAML Profile for Metadata Query Protocol
   <xref target="I-D.young-md-query-saml"/>. Only I's messages to download S's metadata
   are presented here, S's messages are equivalent:
   <figure align="left" anchor="srccode12" suppress-title="true">
     <artwork align="left"><![CDATA[
      GET /metadataservice/entities/https%3A%2F%2Fsp.example.com%2F
      SSO HTTP/1.x
      Host: ttp.example.org
      Accept: application/samlmetadata+xml
      ]]></artwork>
   </figure>
   </t>

   <t>
    <figure align="left" anchor="srccode13" suppress-title="true">
     <artwork align="left"><![CDATA[
      HTTP/1.x 200 OK
      Content-Type: application/samlmetadata+xml
      <?xml version="1.0" encoding="UTF-8"?>
      <EntityDescriptor entityID="https://sp.example.com/SSO"
      xmlns="urn:oasis:names:tc:SAML:2.0:metadata">
      ...
      ]]></artwork>
   </figure>
   </t>
      
      <t>
   T sends a request to I and S in order to receive the status of the integration:
   <figure align="left" anchor="srccode14" suppress-title="true">
     <artwork align="left"><![CDATA[
      GET /metadataservice/DAME?action=add&status=status HTTP/1.x
      ]]></artwork>
   </figure>
   </t>
   <t>
   I answeres with:
    <figure align="left" anchor="srccode15" suppress-title="true">
     <artwork align="left"><![CDATA[
      HTTP/1.x 200 OK
      ]]></artwork>
   </figure>
   </t>
    

   <t>
   After successful completion T forwards S's authentication request to I:
   <figure align="left" anchor="srccode16" suppress-title="true">
     <artwork align="left"><![CDATA[
       GET /idp/profile/SAML2/Redirect/SSO
          ?SAMLRequest=fZHNTsMwEIRfJf.....
          &RelayState=target HTTP/1.x
       Host: idp.example.net
     ]]></artwork>
   </figure>
   </t>

   <t>
   I answers to S's AssertionConsumerServiceURL with a SAML Response:

   <figure align="left" anchor="srccode17" suppress-title="true">
     <artwork align="left"><![CDATA[
       POST /SSO/SAML2/POST HTTP/1.x
          POSTDATA
          ...
     ]]></artwork>
   </figure>
   </t>

   <t>
   Receiving the SAMLResponse, S redirects U to the requested resource:
    <figure align="left" anchor="srccode18" suppress-title="true">
     <artwork align="left"><![CDATA[
       HTTP/1.x 302 Found
       ...
       Location: sp.example.com/secure
       ...
     ]]></artwork>
    </figure>
   </t>

   <t>
    <figure align="left" anchor="srccode19" suppress-title="true">
     <artwork align="left"><![CDATA[
       GET /secure HTTP/1.x
          Cookie...
     ]]></artwork>
    </figure>
   </t>

   <t>
     <figure align="left" anchor="srccode20" suppress-title="true">
     <artwork align="left"><![CDATA[
       HTTP/1.x 200 OK
     ]]></artwork>
    </figure>
   </t>


   </section>

   </section>



<!-- Section 6: Security considerations -->

    <section anchor="Security" title="Security Considerations">

<!-- Section 6.1: Integrity -->

      <section anchor="Integrity" title="Integrity">
      <t>
      As SAML metadata contains information necessary for the secure
      operation of interacting services, it is strongly RECOMMENDED that a
      mechanism for integrity checking is provided to clients. This MAY
      include the use of SSL/TLS at the transport layer, digital
      signatures present within the metadata document, or any other
      such mechanism.
      </t>
      <t>
         It is RECOMMENDED that the integrity checking mechanism provided by a
      responder is a digital signature embedded in the returned metadata
      document, as defined by <xref target="OASIS.saml-metadata-2.0-os"/> section 3:
      </t>
      <t>
      - SHOULD use an RSA key pair whose modulus is no less than 2048 bits
      in length.
      </t>

        <t>
      - SHOULD NOT use the SHA-1 cryptographic hash algorithm as a digest
    algorithm.
      </t>
      <t>
      - MUST NOT use the MD5 cryptographic hash algorithm as a digest
    algorithm.
      </t>
      <t>
       - SHOULD otherwise follow current cryptographic best practices in
    algorithm selection.
      </t>
      </section>

<!-- Section 6.2: Confidentiality -->
      <section anchor="Confidentiality" title="Confidentiality">
      <t>
      In many cases service metadata is public information and therefore
      confidentiality SHOULD NOT be required. In those cases, where such
        functionality is required, it is RECOMMENDED that both the requester
      and responder support SSL/TLS. Other mechanisms, such as XML
      encryption, MAY also be supported for privacy concerns.
      </t>

      </section>

<!-- Section 6.5: Inappropriate Usage -->

    <section anchor="InapprUsage" title="Inappropriate Usage">
        <t>
        This protocol mandates the authentication of users before any trust
        between SP and IDP is
    technically established. Although this requires a further step for
    users, it protects against inappropriate usage of the user-initiated trust
    establishment process. An example of inappropriate usage is triggering the metadata
	exchange for an IDP, where the user has no account. Therefore, the 
	user MUST be authenticated before the metadata is exchanged.
    </t>

    </section>

<!-- Section 6.6: Trust -->

     <section anchor="Trust" title="Trust">
     <t>
   This protocol enables the user to trigger the SAML metadata exchange between two
   entities and establish the bi-directional technical trust relationship. This is a
   prerequisite of the subsequent exchange of user information.
   </t>
   <t>
   For entities, which require a higher level of trust, it is RECOMMENDED to make use
   of one ore more additional mechanisms, e.g., the usage of flags in metadata,
   implementation depending mechanisms in order to secure sensitive information,
   or to take organizational measures, such as requiring written contracts between
   SPs and IDPs.
   </t>
     </section>


      </section>

<!-- Section 7: IANA considerations -->

      <section anchor="IANA" title="IANA Considerations">
    <t>
    This document has no actions for IANA.
      </t>
    </section>

<!-- Section 8: Acknoledgements -->
    <section anchor="Acknowledgements" title="Acknowledgements">
    <t>
  The research leading to these results has received funding from the European
  Community's Seventh Framework Programme under grant agreement no 605243 (GN3plus).
  </t>
    </section>

  </middle>

<!-- References -->

  <back>

    <references title="Normative References">

        <reference anchor="RFC2119">
          <front>
          <title abbrev='RFC Key Words'>Key words for use in RFCs to Indicate Requirement
           Levels</title>
      <author initials='S.' surname='Bradner' fullname='Scott Bradner'>
      <organization>Harvard University</organization>
      </author>
      <date year='1997' month='March' />
          </front>
          </reference>


    <reference anchor='RFC3986'>
      <front>
      <title abbrev='URI Generic Syntax'>Uniform Resource Identifier (URI): Generic Syntax</title>
      <author initials='T.' surname='Berners-Lee' fullname='Tim'>
      <organization abbrev='W3C/MIT'>World Wide Web Consortium, Massachusetts Institute of Technology</organization>
      </author>
      <author initials='R.' surname='Fielding' fullname='Roy T. Fielding'>
      <organization abbrev='Day Software'>Day Software</organization>
      </author>
      <author initials='L.' surname='Masinter' fullname='Larry Masinter'>
      <organization abbrev='Adobe'>Adobe Systems Incorporated</organization>
      </author>
      <date year='2005' month='January'/>
      </front>
    </reference>

    <reference anchor='RFC7230'>
      <front>
      <title abbrev='Syntax_HTTP/1.1'>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing </title>
      <author initials='R.' surname='Fielding' fullname='Roy T. Fielding'>
      <organization abbrev='Adobe'>Adobe Systems Incorporated</organization>
      </author>
       <author initials='J.' surname='Reschke' fullname='Julian F. Reschke'>
      <organization abbrev='greenbytes'>greenbytes GmbH</organization>
      </author>
<!--
       <author initials='J.' surname='Gettys' fullname='James Gettys'>
      <organization abbrev='Compaq/W3C'>World Wide Web Consortium</organization>
      </author>
      <author initials='J.' surname='Mogul' fullname='Jeffrey C. Mogul'>
      <organization abbrev='Compaq'>Compaq Computer Corporation</organization>
      </author>
      <author initials='H.' surname='Frystyk' fullname='Henrik Frystyk Nielsen'>
      <organization abbrev='MIT/LCS'>World Wide Web Consortium</organization>
      </author>
      <author initials='L.' surname='Masinter' fullname='Larry Masinter'>
      <organization abbrev='Xerox'>Xerox Corporation</organization>
      </author>
      <author initials='P.' surname='Leach' fullname='Paul J. Leach'>
      <organization abbrev='Microsoft'>Microsoft Corporation</organization>
      </author
      <author initials='T.' surname='Berners-Lee' fullname='Tim Berners-Lee'>
      <organization abbrev='MIT/LCS'>World Wide Web Consortium</organization>
      </author>
-->
      <date year='2014' month='June'/>
      </front>
      </reference>

      <reference anchor='OASIS.saml-core-2.0-os'>
        <front>
            <title>Assertions and Protocols for the OASIS Security Assertion Markup Language (SAML) V2.0</title>
            <author initials='S.' surname='Cantor'
                    fullname='Scott Cantor et. al.'>
                <organization abbrev='Internet2'>
                Internet2
                </organization>
            </author>

            <date month='March' year='2005' />
        </front>
    </reference>


<!-- Reference SAML2Prof -->
      <reference anchor='OASIS.saml-profiles-2.0-os'>
        <front>
            <title>Profiles for the OASIS Security Assertion Markup Language (SAML) V2.0</title>
            <author initials='S.' surname='Cantor'
                    fullname='Scott Cantor et. al.'>
                <organization abbrev='Internet2'>
                Internet2
                </organization>
            </author>

            <date month='March' year='2005' />
        </front>
    </reference>

<!-- Reference SAML2Bind -->
      <reference anchor='OASIS.saml-bindings-2.0-os'>
        <front>
            <title>Bindings for the OASIS Security Assertion Markup Language (SAML) V2.0</title>
            <author initials='S.' surname='Cantor'
                    fullname='Scott Cantor et. al.'>
                <organization abbrev='Internet2'>
                Internet2
                </organization>
            </author>

            <date month='March' year='2005' />
        </front>
    </reference>

<!-- Reference SAML2Meta -->
      <reference anchor='OASIS.saml-metadata-2.0-os'>
        <front>
            <title>Metadata for the OASIS Security Assertion Markup Language (SAML) V2.0</title>
            <author initials='S.' surname='Cantor'
                    fullname='Scott Cantor et. al.'>
                <organization abbrev='Internet2'>
                Internet2
                </organization>
            </author>

            <date month='March' year='2005' />
        </front>
    </reference>

<!-- Reference SAML2IDP_Discovery -->
      <reference anchor='OASIS.saml-idp-discovery'>
        <front>
            <title>Identity Provider Discovery Service Protocol and Profile</title>
            <author initials='S.' surname='Cantor'
                    fullname='Scott Cantor et. al.'>
                <organization abbrev='Internet2'>
                Internet2
                </organization>
            </author>
            <date month='March' year='2008' />
        </front>
    </reference>

    </references>

    <references title="Informative References">
 

     <reference anchor='RFC4926'>
      <front>
      <title abbrev='Geant Namespace'>A URN Namespace for GEANT</title>
      <author initials='T.' surname='Kalin' fullname='Tomaz Kalin'>
      <organization abbrev='DANTE'>DANTE</organization>
      </author>
      <author initials='M.' surname='Molina' fullname='Maurizio Molina'>
      <organization abbrev='DANTE'>DANTE</organization>
      </author>
      <date month='July' year='2007' />
      </front>
     </reference> 

	<reference anchor='RFC6973'>
     <front>
      <title abbrev='Privacy Considerations'>Privacy Considerations for Internet Protocols</title>
      <author initials='A.' surname='Cooper' fullname='Alissa Cooper'>
      <organization abbrev='CDT'>Center for Democracy and Technology</organization>
      </author>
      <author initials='H.' surname='Tschofenig' fullname='Hannes Tschofenig'>
      <organization abbrev='Nokia Siemens Networks'>Nokia Siemens Networks</organization>
      </author>
      <author initials='B.' surname='Aboba' fullname='Bernard Aboba'>
      <organization abbrev='Skype'>Skype</organization>
      </author>
      <author initials='J.' surname='Peterson' fullname='Jon Peterson'>
      <organization abbrev='NewStar'>NeuStar, Inc.</organization>
      </author>
      <author initials='J.' surname='Morris' fullname='John B. Morris, Jr.'>
      <organization abbrev='Test'>Test Company</organization>
      </author>
      <author initials='M.' surname='Hansen' fullname='Marit Hansen'>
      <organization abbrev='ULD'>Unabhaengiges Landeszentrum fuer Datenschutz Schleswig-Holstein</organization>
      </author>
      <author initials='R.' surname='Smith' fullname='Rhys Smith'>
      <organization abbrev='Janet'>Janet</organization>
      </author>
      <date month='July' year='2013' />
     </front>
    </reference>

<!-- Reference SAML2Glossary -->
         <reference anchor='OASIS.saml-glossary-2.0-os'>
        <front>
            <title>Glossary for the OASIS Security Assertion Markup Language (SAML) V2.0</title>
            <author initials='J.' surname='Hodges'
                    fullname='Jeff Hodges et. al.'>
                <organization abbrev='Neustar'>
                Neustar
                </organization>
            </author>

            <date month='March' year='2005' />
        </front>
    </reference>

  <reference anchor='I-D.young-md-query'>
     <front>
     <title>Metadata Query Protocol, draft-young-md-query-05 [work in progress]</title>
     <author initials='I.' surname='Young' fullname='Ian A. Young'>
     <organization abbrev='Independent'>Independent</organization>
     </author>
     <date month='April' year='2015' />
     </front>
  </reference>
  
    <reference anchor='I-D.young-md-query-saml'>
     <front>
     <title>SAML Profile for Metadata Query Protocol, draft-young-md-query-saml-05 [work in progress]</title>
     <author initials='I.' surname='Young' fullname='Ian A. Young'>
     <organization abbrev='Independent'>Independent</organization>
     </author>
     <date month='April' year='2015' />
     </front>
  </reference>

  <reference anchor='SAML2Int'>
    <front>
    <title>Interoperable SAML2.0 Web Browser SSO Deployment Profile</title>
    <author initials='A.' surname='Solberg' fullname='Andreas Akre Solberg et. al.'>
    <organization abbrev='UNINETT'>UNINETT</organization>
    </author>
    <date month='' year=''/>
    </front>
  </reference>

    </references>
  </back>
</rfc>
