<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd"[ 
<!ENTITY RFC1035 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.1035.xml">
<!ENTITY RFC1738 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.1738.xml">
<!ENTITY RFC1939 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.1939.xml">
<!ENTITY RFC2119 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3492 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.3492.xml">
<!ENTITY RFC4422 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.4422.xml">
<!ENTITY RFC4648 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.4648.xml">
<!ENTITY RFC2616 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.2616.xml">
<!ENTITY RFC2234 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.2234.xml">
<!ENTITY RFC2743 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.2743.xml">
<!ENTITY RFC2818 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.2818.xml">
<!ENTITY RFC3501 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.3501.xml">
<!ENTITY RFC6120 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.6120.xml">
<!ENTITY RFC3986 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml">
<!ENTITY RFC3987 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.3987.xml">
<!ENTITY RFC5056 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.5056.xml">
<!ENTITY RFC5246 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY RFC5280 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.5280.xml">
<!ENTITY RFC5801 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.5801.xml">
<!ENTITY RFC5890 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.5890.xml">
<!ENTITY RFC5891 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.5891.xml">
<!ENTITY RFC6125 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.6125.xml">
<!ENTITY SAML20 SYSTEM 
"http://xml.resource.org/public/rfc/bibxml2/reference.OASIS.saml-core-2.0-os.xml"> 
<!ENTITY SAML20BIND SYSTEM 
"http://xml.resource.org/public/rfc/bibxml2/reference.OASIS.saml-bindings-2.0-os.xml">
<!ENTITY SAML20PROF SYSTEM 
"http://xml.resource.org/public/rfc/bibxml2/reference.OASIS.saml-profiles-2.0-os.xml">
<!ENTITY W3C.REC-html401-19991224 SYSTEM
"http://xml.resource.org/public/rfc/bibxml4/reference.W3C.REC-html401-19991224.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes"?> <?rfc symrefs="yes"?> <?rfc compact="no" ?> <?rfc
sortrefs="yes" ?> <?rfc strict="yes" ?> <?rfc linkmailto="yes" ?>
<rfc ipr="trust200902" docName="draft-ietf-kitten-sasl-saml-09.txt" category="std">
<front> 
 <title abbrev="A SASL &amp; GSS-API Mechanism for SAML"> 
  A SASL and GSS-API Mechanism for SAML
 </title> 
 <author fullname="Klaas Wierenga" initials="K." surname="Wierenga"> 
  <organization>Cisco Systems, Inc.</organization>
  <address> 
   <postal> 
    <street>Haarlerbergweg 13-19</street>
    <city>Amsterdam</city> 
    <code>1101 CH</code>
    <region>Noord-Holland</region> 
    <country>Netherlands</country> 
   </postal>
   <phone>+31 20 357 1752</phone> 
   <email>klaas@cisco.com</email> 
  </address>
 </author> 
 <author fullname="Eliot Lear" initials="E." surname="Lear">
  <organization>Cisco Systems GmbH</organization> 
  <address> 
   <postal>
    <street>Richtistrasse 7</street> 
    <city>Wallisellen</city>
    <code>CH-8304</code> 
    <region>ZH</region> 
    <country>Switzerland</country>
   </postal> 
   <phone>+41 44 878 9200</phone> 
   <email>lear@cisco.com</email>
  </address> 
 </author>
	<author initials="S." surname="Josefsson" fullname="Simon Josefsson">
	    <organization>SJD AB</organization>
	    <address>
		<postal>
		    <street>Hagagatan 24</street>
		    <city>Stockholm</city>
		    <code>113 47</code>
		    <country>SE</country>
		</postal>
		<email>simon@josefsson.org</email>
		<uri>http://josefsson.org/</uri>
	    </address>
	</author>
 <date year="2012"/>
 <abstract> 
  <t>
   Security Assertion Markup Language (SAML) has found its
   usage on the Internet for Web Single Sign-On. Simple Authentication
and
   Security Layer (SASL) and the Generic Security Service Application Program Interface (GSS-API)
   are application frameworks to generalize authentication. This memo specifies a SASL mechanism 
   and a GSS-API mechanism for SAML 2.0 that
   allows the integration of existing SAML Identity Providers with
   applications using SASL and GSS-API.
  </t> 
 </abstract> 
</front>
<middle> 
<section title="Introduction"> 
<t> 
<xref target="OASIS.saml-core-2.0-os">Security Assertion Markup Language (SAML) 2.0</xref> is a set 
of specifications that provide various means for a user to be identified to a relying party (RP) 
through the exchange of (typically signed) assertions issued by an identity provider (IdP).  
It includes a number of protocols, <xref target="OASIS.saml-bindings-2.0-os">protocol bindings</xref>, 
and <xref target="OASIS.saml-profiles-2.0-os">interoperability profiles</xref> designed for different 
use cases.
</t> 
<t> 
<xref target="RFC4422">Simple Authentication and Security Layer (SASL)</xref> is a generalized 
mechanism for identifying and authenticating a user and for optionally negotiating a security layer 
for subsequent protocol interactions. SASL is used by application protocols like 
<xref target="RFC3501">IMAP</xref>, <xref target="RFC1939">POP</xref> and 
<xref target="RFC6120">XMPP</xref>. The effect is to make 
modular authentication, so that newer authentication mechanisms can be added as needed. This memo 
specifies just such a mechanism. 
</t> 
<t>
The <xref target="RFC2743">Generic Security Service Application
Program Interface (GSS-API)</xref> provides a framework for
applications to support multiple authentication mechanisms through a
unified programming interface.  This document defines a pure SASL
mechanism for SAML, but it conforms to the new bridge between SASL and
the GSS-API called <xref target="RFC5801">GS2</xref>.  This means that
this document defines both a SASL mechanism and a GSS-API mechanism.
The GSS-API interface is OPTIONAL for SASL
implementers, and the GSS-API considerations can be avoided in
environments that use SASL directly without GSS-API.
</t>
<t> As currently envisioned, this mechanism
enables interworking between SASL and SAML in order to assert
the identity of the user and other attributes to relying parties. As such, while servers
(as relying parties) will advertise SASL mechanisms (including SAML),
clients will select
the SAML SASL mechanism as their SASL mechanism of choice. </t> 
<t>The SAML mechanism described in this memo aims to re-use the
Web Browser SSO profile defined in section 4.1 of <xref target="OASIS.saml-profiles-2.0-os">the 
SAML profiles 2.0 specification</xref>  to 
the maximum extent and therefore does not establish a separate authentication, integrity and 
confidentiality mechanism.  The mechanism assumes a security layer, such as Transport
Layer Security (<xref target="RFC5246">TLS</xref>), will continue to be used. This specification 
is appropriate for use when a browser instance is available. In the absence of a browser 
instance, SAML profiles that don't require a browser such as the Enhanced Client or Proxy 
profile (as defined in section 4.2 of <xref target="OASIS.saml-profiles-2.0-os">the 
SAML profiles 2.0 specification</xref> may be used, but that is outside the scope of this 
specification.
</t>
<t><xref target="overview"/> describes the interworking between SAML and
SASL: this document requires enhancements to the Relying Party (the SASL server) and to
the Client, as the two SASL communication end points, but no changes to
the SAML Identity Provider are necessary. To accomplish this goal some
indirect messaging is tunneled within SASL, and some use of external
methods is made.</t> 
<t> <figure anchor="overview" title="Interworking
Architecture"> <artwork><![CDATA[ 


                                    +-----------+
                                    |           |
                                   >|  Relying  |
                                  / |  Party    |
                                //  |           |
                              //    +-----------+
                   SAML/    //            ^
                   HTTPS  //           +--|--+
                        //             | S|  |
                       /             S | A|  |
                     //              A | M|  |
                   //                S | L|  |
                 //                  L |  |  |
               //                      |  |  |
             </                        +--|--+
      +------------+                      v
      |            |                 +----------+
      |  SAML      |     HTTPS       |          |
      |  Identity  |<--------------->|  Client  |
      |  Provider  |                 |          |
      +------------+                 +----------+

]]></artwork> </figure> </t> 
 <section anchor="terminology" title="Terminology"> 
  <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">RFC 2119</xref>.</t>
  <t>The reader is assumed to be familiar with the terms used in the 
  <xref target="OASIS.saml-core-2.0-os">SAML 2.0 specification</xref>.</t> 
 </section>
 <section anchor="applicability" title="Applicability"> 
  <t>
  Because this mechanism transports information that should not be
  controlled by an attacker, the SAML mechanism MUST only be used over
  channels protected by TLS, or over similar integrity protected and
  authenticated channels.  In addition, when TLS is used the client
  MUST successfully validate the server certificate (<xref target="RFC5280"/>,
  <xref target="RFC6125"/>)</t>
   <t>Note: An Intranet does not constitute such an integrity protected and authenticated channel!
   </t>
  </section>
 </section>
<section title="Authentication flow"> 
<t>While SAML
itself is merely a markup language, its common use case these days is
with <xref target="RFC2616">HTTP</xref> or <xref target="RFC2818">HTTPS</xref> and 
<xref target="W3C.REC-html401-19991224">HTML</xref>.  
What follows is a typical flow: </t> 
<t> 
<list style="numbers"> 
<t>The browser requests a resource of a Relying Party (RP) (via an HTTP request).</t> 
<t>The Relying Party redirects the browser via an HTTP redirect (as described in Section 10.3 
 of <xref target="RFC2616" />) to the Identity Provider
 (IdP) or an IdP discovery service.  When it does so, it includes
 the following parameters: (1) an authentication request that
 contains the name of resource being requested, (2) a browser
 cookie, and (3) a return URL as specified in Section 3.1 of the
 <xref target="OASIS.saml-profiles-2.0-os">SAML profiles 2.0 specification</xref>.
</t>
<t> The user
authenticates to the IdP and perhaps authorizes the release of user attributes to
the Relying Party. </t>
<t> In its authentication response, the IdP
redirects (via an HTTP redirect) the browser back to the RP with an
authentication assertion (stating that the IdP vouches that the subject has successfully 
authenticated), optionally along with some additional attributes. </t>
<t>The Relying Party now has sufficient identity
information to approve access to the resource or not, and acts
accordingly.  The authentication is concluded. </t> 
</list> </t> 
<t>When
considering this flow in the context of SASL, we note that while the
Relying Party and the client both must change
their code to implement this SASL mechanism, the IdP can remain
untouched.  The  Relying Party already has some sort of session 
(probably a TCP connection) established with the client. However, it may be
necessary to redirect a SASL client to another application or
handler. 

The steps are as follows:</t> 
<t> 
<list style="numbers"> 
 <t> The SASL server (Relying Party) advertises support for the SASL 
 SAML20 mechanism to the client </t> 
 <t> The client initiates a SASL authentication with SAML20 and sends a domain name that allows 
 the SASL server to determine the appropriate IdP</t> 
 <t>The SASL server transmits an authentication request encoded using a Uniform Resource 
 Identifier (URI) as described in RFC 3986 <xref target="RFC3986"/> and an HTTP redirect to the IdP 
 corresponding to the domain</t>
 <t> The SASL client now sends an empty response, as authentication continues via the normal SAML 
 flow and the SASL server will receive the answer to the challenge out-of-band from the SASL 
 conversation. </t>
 <t> At this point the SASL client MUST construct a URL containing the content received in the
 previous message from the SASL server. This URL is transmitted to the IdP either by the SASL 
 client application or an appropriate handler, such as a browser.</t> 
 <t>Next the user authenticates to the IdP. The manner in which the end user is authenticated to 
 the IdP and any policies surrounding such authentication is out of scope for SAML and hence for 
 this draft. This step happens out of band from SASL.</t>
 <t>The IdP will convey information about the success or failure of the authentication back to the
 the SASL server (Relying Party) in the form of an Authentication Statement or failure, using a 
 indirect response via the 
 client browser or the handler (and with an external browser client control 
 should be passed back to the SASL client). This step happens out of band from SASL.</t>
 <t> The SASL Server sends an appropriate SASL response to the client, along with an
optional list of attributes</t> 
</list> </t> 
<t>Please note: What is described here is the case in which the client has not previously 
authenticated. It is possible that the client already holds a valid SAML authentication token so 
that the user does not need to be involved in the process anymore, but that would still be external
to SASL. This is classic Web Single Sign-On, in which the Web Browser client presents the 
authentication token (cookie) to the RP without renewed user authentication at the IdP. 
</t>

<t> With all of this in mind, the flow appears as follows in <xref target="flow"/>: </t> 
<t>
<figure anchor="flow" title="Authentication flow">
<artwork><![CDATA[ 


         SASL Serv.       Client          IdP
            |>-----(1)----->|              | Advertisement
            |               |              |
            |<-----(2)-----<|              | Initiation
            |               |              |
            |>-----(3)----->|              | Authentication Request
            |               |              |
            |<-----(4)-----<|              | Empty Response
            |               |              |
            |               |< - -(5,6) - ->| Client<>IDP 
            |               |              | Authentication
            |               |              |
            |<- - - - - - - - - - -(7)- - -| Authentication Statement
            |               |              |
            |>-----(8)----->|              | SASL completion with
            |               |              | status
            |               |              |

       ----- = SASL
       - - - = HTTP or HTTPS (external to SASL)
       

]]> 
</artwork>
</figure> </t> 
</section>
<section title="SAML SASL Mechanism Specification"> 
 <t>
  This section specifies the details of the SAML SASL mechanism. See section 5 of 
  <xref target="RFC4422"/> for what is described here.
</t>
<t>
   The name of this mechanism is "SAML20". The mechanism is capable of
   transferring an authorization identity (via the "gs2-header").  The
   mechanism does not offer a security layer.
</t>
<t>
   The mechanism is client-first.  The first mechanism message from the
   client to the server is the "initial-response". As
   described in <xref target="RFC4422"/>, if the application protocol does not support
   sending a client-response together with the authentication request,
   the server will send an empty server-challenge to let the client
   begin.
   The second mechanism message is from the server to the client, containing the
   SAML "authentication-request".
   The third mechanism message is from client to the server, and is the
   fixed message consisting of "=" (i.e., an empty response).
   The fourth mechanism message is from the server to the client,
   indicating the SASL mechanism outcome.
</t>
 <section title="Initial Response" anchor="initiation"> 
  <t>
   A client initiates a &quot;SAML20&quot; authentication with SASL by sending the
   GS2 header followed by the authentication identifier (message 2 in <xref target="flow"/>) and 
   is defined as follows:  
  </t>
  <figure>
   <artwork type='abnf'>
    <![CDATA[
     initial-response = gs2-header Idp-Identifier
     IdP-Identifier = domain ; domain name with corresponding IdP
    ]]>
   </artwork>
  </figure>
 <t>
  The "gs2-header" is used as follows:
  <list>
  <t>- The "gs2-nonstd-flag" MUST NOT be present. </t>
  <t>- The "gs2-cb-flag" MUST be set to "n" because <xref target="RFC5056">channel binding</xref>
       data cannot be integrity protected by the SAML negotiation.
       (Note: In theory channel binding data could be inserted in the
       SAML flow by the client and verified by the server, but that is
       currently not supported in SAML.)</t>
  <t>- The "gs2-authzid" carries the optional authorization identity as specified in 
  <xref target="RFC5801"/> (not to be confused with the IdP-Identifier).</t>
 </list>
 </t>
  <t>Domain name is specified in <xref target="RFC1035"/>. 
  A domain name is either a "traditional domain name" as described in
  <xref target="RFC1035"/> or an "internationalized domain name" as described in
  <xref target="RFC5890"/>. Clients and servers MUST treat
  the IdP-Identifier as a domain name slot <xref target="RFC5890"/>.  They also
  SHOULD support internationalized domain names (IDNs) in the
  Idp-Identifier field; if they do so, all of the domain name's labels
  MUST be A-labels  or NR-LDH labels <xref target="RFC5890"/>, if necessary
  internationalized labels MUST be converted from U-labels to A-labels by
  using the Punycode encoding <xref target="RFC3492"/> for A-labels prior to sending them to the 
  SASL-server as described in the protocol specification for <xref target="RFC5891">Internationalized Domain Names in
  Applications</xref>. 
 </t>
</section> 

 <section title="Authentication Request" anchor="AuthenticationRequest"> 
   <t>The SASL Server transmits to the SASL client a URI that redirects the SAML client to the IdP 
   (corresponding to the domain that the user provided), with a SAML authentication request
   as one of the parameters  (message 3 in <xref target="flow"/>) in the following way:
   </t>
  <figure>
   <artwork type='abnf'>
    <![CDATA[
     authentication-request = URI
    ]]>
   </artwork>
  </figure>
 <t>
  URI is specified in <xref target="RFC3986"/> and is encoded according to
   Section 3.4 (HTTP Redirect) of the <xref target="OASIS.saml-bindings-2.0-os">SAML
   bindings 2.0 specification</xref>. The SAML authentication request is encoded according to 
   Section 3.4 (Authentication Request) of the <xref target="OASIS.saml-core-2.0-os">SAML
   core 2.0 specification</xref>. Should the client support  Internationalized Resource
   Identifiers (IRIs) <xref target="RFC3987"/> it MUST first convert the IRI to a URI before 
   transmitting it to the server <xref target="RFC5890"/>.
 </t>
 <t>
   Note: The SASL server may have a static mapping of domain to corresponding IdP or alternatively
   a DNS-lookup mechanism could be envisioned, but that is out-of-scope for this document.
   </t>
   <t>
   Note: While the SASL client MAY sanity check the URI it received, ultimately it is the SAML IdP
   that will be validated by the SAML client which is out-of-scope for this document.
   </t>
 <t>
 The client then sends the authentication request via an HTTP GET (sent over a server-authenticated 
 TLS channel) to the IdP, as if
   redirected to do so from an HTTP server and in accordance with the Web Browser SSO profile, 
   as described in section 3.1 of <xref target="OASIS.saml-profiles-2.0-os">SAML
   profiles 2.0 specification</xref> (message 5 and 6 in <xref target="flow"/>).
</t>
<t>
   The client handles both user authentication to the IdP and
   confirmation or rejection of the authentiation of the RP (out-of-scope for this document).
</t>
<t>
   After all authentication has been completed by the IdP, the IdP will send a redirect message 
   to the client in the form of a URI corresponding to the Relying Party as specified  
   in the authentication request ("AssertionConsumerServiceURL") and with the SAML response as one 
   of the parameters (message 7 in <xref target="flow"/>).
 </t>
 <t>Please note: this means that the SASL server needs to implement a SAML 
 Relying Party. Also, the SASL server needs to correlate the
  session it has with the SASL client with the appropriate SAML authentication result. 
  It can do so by comparing the ID of the SAML authentication request it has issued 
  with the one it receives in the SAML authentication statement.
 </t>
 </section> 
 <section title="Outcome and parameters" anchor="outcome"> 
  <t>
  The SASL server (in its capacity as a SAML Relying Party) now validates the SAML authentication
   response it received from the SAML client via HTTP or HTTPS.
</t>
<t>
   The outcome of that validation by the SASL server constitutes a SASL mechanism
   outcome, and therefore (as stated in <xref target="RFC4422"/>) SHALL be used to set 
   state in the server accordingly, and it SHALL be used by the server to report 
   that state to the SASL client as described in <xref target="RFC4422"/> Section 3.6  
   (message 8 in <xref target="flow"/>).
  </t>
 </section>
</section>
<section title="SAML GSS-API Mechanism Specification" anchor="gss-api">
 <t>
   This section and its sub-sections are not required for SASL
   implementors, but this section MUST be observed to implement the GSS-
   API mechanism discussed below.
</t>
<t>
 This section specify a GSS-API mechanism that when used via the GS2
 bridge to SASL behaves like the SASL mechanism defined in this
 document.  Thus, it can loosely be said that the SAML SASL mechanism
 is also a GSS-API mechanism.

 The SAML user takes the role of the GSS-API Initiator and the SAML
   Relying Party takes the role of the GSS-API Acceptor.  The SAML
   Identity Provider does not have a role in GSS-API, and is considered an
   internal matter for the SAML mechanism. The
   messages are the same, but 
 </t>
<t>  
   a) the GS2 header on the client's first
   message and channel binding data is excluded when SAML is used as a
   GSS-API mechanism, and 
 </t>
<t>  
   b) the RFC2743 section 3.1 initial context token header is prefixed to 
   the client's first authentication message (context token).
</t>
<t>
   The GSS-API mechanism OID for SAML is OID-TBD (IANA to assign: see
   IANA considerations).
</t>
<t>
   SAML20 security contexts MUST have the mutual_state flag
   (GSS_C_MUTUAL_FLAG) set to TRUE.  SAML does not support credential
   delegation, therefore SAML security contexts MUST have the
   deleg_state flag (GSS_C_DELEG_FLAG) set to FALSE.
</t>
<t>
The mutual authentication property of this mechanism relies on
   successfully comparing the TLS server identity with the negotiated
   target name.  Since the TLS channel is managed by the application
   outside of the GSS-API mechanism, the mechanism itself is unable to
   confirm the name while the application is able to perform this
   comparison for the mechanism.  For this reason, applications MUST
   match the TLS server identity with the target name, as discussed in <xref target="RFC6125"/>.
   More precisely, to pass identity validation the client uses the
  securely negotiated targ_name as the reference identifier and match
  it to the DNS-ID of the server certificate, and MUST reject the
  connection if there is a mismatch.  For compatibility with deployed
  certificate hierarchies, the client MAY also perform a comparison
  with the CN-ID when there is no DNS-ID present.  Wildcard matching is
  permitted.  The targ_name reference identifier is a "traditional
  domain names" thus the comparison is made using case-insensitive
  ASCII comparison.
</t>
<t>
   The SAML mechanism does not support per-message tokens or
   GSS_Pseudo_random.
 </t>
 <section title="GSS-API Principal Name Types for SAML" anchor="gss-api-name-types">
  <t>
   SAML supports standard generic name syntaxes for acceptors such as
   GSS_C_NT_HOSTBASED_SERVICE (see <xref target="RFC2743"/>, Section 4.1).

   SAML supports only a single name type for initiators:
   GSS_C_NT_USER_NAME.  GSS_C_NT_USER_NAME is the default name type for
   SAML.

   The query, display, and exported name syntaxes for SAML principal
   names are all the same.  There are no SAML-specific name syntaxes
   -- applications should use generic GSS-API name types such as
   GSS_C_NT_USER_NAME and GSS_C_NT_HOSTBASED_SERVICE (see <xref target="RFC2743"/>,
   Section 4).  The exported name token does, of course, conforms to
   <xref target="RFC2743"/>, Section 3.2.
  </t>
 </section>
</section>
<section title="Examples" anchor="examples"> 
<section title="XMPP" anchor="examples-xmpp"> 
<t> Suppose the user has an identity at the SAML IdP saml.example.org and a Jabber Identifier (JID) 
"somenode@example.com", and wishes to authenticate his XMPP connection to xmpp.example.com. The 
authentication on the wire would then look something like the following: </t>
<t>Step 1: Client initiates stream to server: </t>
<figure><artwork>
<![CDATA[
<stream:stream xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'
to='example.com' version='1.0'>
]]>
</artwork></figure>
<t>Step 2: Server responds with a stream tag sent to client: </t>
<figure><artwork>
<![CDATA[
<stream:stream
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
id='some_id' from='example.com' version='1.0'>
]]>
</artwork></figure>
<t>Step 3: Server informs client of available authentication
mechanisms:</t>
<figure><artwork>
<![CDATA[
<stream:features> 
 <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
  <mechanism>DIGEST-MD5</mechanism> 
  <mechanism>PLAIN</mechanism>
  <mechanism>SAML20</mechanism> 
 </mechanisms> 
</stream:features>
]]>
</artwork></figure>
<t>Step 4: Client selects an authentication mechanism and provides the
initial client response containing the according to the definition 
in Section 4 of<xref target="RFC4648">BASE64</xref> encoded gs2-header and
domain: </t>
<figure><artwork>
<![CDATA[
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='SAML20'>
biwsZXhhbXBsZS5vcmc</auth>
]]>
</artwork></figure>
<t>The decoded string is: n,,example.org</t>
<t>Step 5: Server sends a BASE64 encoded challenge to client 
 in the form of an HTTP Redirect to the SAML IdP corresponding to example.org 
 (https://saml.example.org) with the SAML Authentication Request as specified in the redirection 
 url: </t>
<figure><artwork>
<![CDATA[
aHR0cHM6Ly9zYW1sLmV4YW1wbGUub3JnL1NBTUwvQnJvd3Nlcj9TQU1MUmVx
dWVzdD1QSE5oYld4d09rRjFkR2h1VW1WeGRXVnpkQ0I0Yld4dWN6cHpZVzFz
Y0QwaWRYSnVPbTloYzJsek9tNWhiV1Z6T25S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BTUw6Mi4wOm
Fzc2VydGlvbiI+DQogICAgICAgICAgIHVybjpvYXNpczpuYW1lczp0YzpTQU
1MOjIuMDphYzpjbGFzc2VzOlBhc3N3b3JkUHJvdGVjdGVkVHJhbnNwb3J0DQ
ogIDwvc2FtbDpBdXRobkNvbnRleHRDbGFzc1JlZj4NCiA8L3NhbWxwOlJlcX
Vlc3RlZEF1dGhuQ29udGV4dD4gDQo8L3NhbWxwOkF1dGhuUmVxdWVzdD4=
]]>
</artwork></figure>
<t>Where the decoded SAMLRequest looks like:</t>
<figure><artwork>
<![CDATA[
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
    ID="_bec424fa5103428909a30ff1e31168327f79474984" Version="2.0"
    IssueInstant="2007-12-10T11:39:34Z" ForceAuthn="false"
    IsPassive="false"
    ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
    AssertionConsumerServiceURL=
        "https://xmpp.example.com/SAML/AssertionConsumerService">
 <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
     https://xmpp.example.com
 </saml:Issuer>
 <samlp:NameIDPolicy xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
     Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
     SPNameQualifier="xmpp.example.com" AllowCreate="true" />
 <samlp:RequestedAuthnContext
     xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" 
        Comparison="exact">
  <saml:AuthnContextClassRef
      xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
      urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
  </saml:AuthnContextClassRef>
 </samlp:RequestedAuthnContext> 
</samlp:AuthnRequest>
]]>
</artwork></figure>
<t>Note: the server can use the request ID (_bec424fa5103428909a30ff1e31168327f79474984) to 
correlate the SASL session with the SAML authentication.
</t>
<t>Step 5 (alternative): Server returns error to client if no SAML Authentication Request can be 
constructed:</t>
<figure> <artwork>
<![CDATA[
<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> 
 <temporary-auth-failure/>
</failure> 
</stream:stream>
]]>
</artwork></figure>
<t>Step 6: Client sends the empty response to the challenge encoded as a single =:</t>
<figure><artwork>
<![CDATA[
<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
 =
</response>
]]>
</artwork></figure>
<t>The following steps between brackets are out of scope for this document but included to better 
illustrate the entire flow.
</t>
<t>
[The client now sends the URL to a browser instance for processing. The browser
engages in a normal SAML authentication flow (external to SASL),
like redirection to the Identity Provider (https://saml.example.org), the
user logs into https://saml.example.org, and agrees to authenticate to
xmpp.example.com. A redirect is passed back to the client browser who
sends the AuthN response to the server, containing the subject-identifier as 
an attribute. If the AuthN response doesn't contain the JID, the server maps 
the subject-identifier received from the IdP to a JID]
</t>
<t>Step 7: Server informs client of successful authentication: </t>
<figure><artwork>
<![CDATA[
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
]]>
</artwork></figure>
<t>Step 7 (alt): Server informs client of failed authentication: </t>
 
<figure><artwork>
<![CDATA[
<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> 
 <not-authorized/>
</failure> 
</stream:stream>
]]>
</artwork></figure>

<t>Please note: line breaks were added to the
base64 for clarity.</t> 
</section> 
<section title="IMAP" anchor="examples-imap"> 

  <t>The following describes an IMAP exchange.  Lines beginning with
  'S:' indicate data sent by the server, and lines starting with 'C:'
  indicate data sent by the client.  Long lines are wrapped for
  readability.</t>
<figure><artwork>
S: * OK IMAP4rev1
C: . CAPABILITY
S: * CAPABILITY IMAP4rev1 STARTTLS
S: . OK CAPABILITY Completed
C: . STARTTLS
S: . OK Begin TLS negotiation now
C: . CAPABILITY
S: * CAPABILITY IMAP4rev1 AUTH=SAML20
S: . OK CAPABILITY Completed
C: . AUTHENTICATE SAML20
S: + 
C: biwsZXhhbXBsZS5vcmc
S: + aHR0cHM6Ly9zYW1sLmV4YW1wbGUub3JnL1NBTUwvQnJvd3Nlc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uczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6
Mi4wOnByb3RvY29sIiANCiAgICAgICAgQ29tcGFyaXNvbj0iZXhhY3QiPg0KI
CA8c2FtbDpBdXRobkNvbnRleHRDbGFzc1JlZg0KICAgICAgeG1sbnM6c2FtbD
0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiI+DQogICA
gICB1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YWM6Y2xhc3NlczpQYXNz
d29yZFByb3RlY3RlZFRyYW5zcG9ydA0KICA8L3NhbWw6QXV0aG5Db250ZXh0Q
2xhc3NSZWY+DQogPC9zYW1scDpSZXF1ZXN0ZWRBdXRobkNvbnRleHQ+IA0KPC
9zYW1scDpBdXRoblJlcXVlc3Q+
]]>
</artwork></figure>

<t>Where the decoded SAMLRequest looks like:</t>
<figure><artwork>
<![CDATA[
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
    ID="_bec424fa5103428909a30ff1e31168327f79474984" Version="2.0"
    IssueInstant="2007-12-10T11:39:34Z" ForceAuthn="false"
    IsPassive="false"
    ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
    AssertionConsumerServiceURL=
        "https://mail.example.com/SAML/AssertionConsumerService">
 <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
     https://xmpp.example.com
 </saml:Issuer>
 <samlp:NameIDPolicy xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
     Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
     SPNameQualifier="xmpp.example.com" AllowCreate="true" />
 <samlp:RequestedAuthnContext
     xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" 
        Comparison="exact">
  <saml:AuthnContextClassRef
      xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
      urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
  </saml:AuthnContextClassRef>
 </samlp:RequestedAuthnContext> 
</samlp:AuthnRequest>
]]>
</artwork></figure>
</section> 
</section> 
<section title="Security Considerations"> 
<t>
 This section addresses only security considerations associated
   with the use of SAML with SASL applications.  For considerations
   relating to SAML in general, the reader is referred to the SAML
   specification and to other literature.  Similarly, for general SASL
   Security Considerations, the reader is referred to that
   specification.
</t>
<section title="Man in the middle and Tunneling Attacks">
<t>
   This mechanism is vulnerable to man-in-the-middle and tunneling
   attacks unless a client always verifies the server identity before
   proceeding with authentication (see <xref target="RFC6125"/>).  Typically TLS is used to provide
   a secure channel with server authentication.
</t>
</section>
<section title="Binding SAML subject identifiers to Authorization Identities">
<t>
   As specified in <xref target="RFC4422"/>, the server is responsible for binding
   credentials to a specific authorization identity.  It is therefore
   necessary that only specific trusted IdPs be 
   allowed. This is typical part of SAML trust establishment between Relying Parties and IdP.  
</t>
</section>
<section title="User Privacy">
<t>
   The IdP is aware of each Relying Party that a user logs into.  There is nothing
   in the protocol to hide this information from the IdP.  It is not a
   requirement to track the visits, but there is nothing that prohibits
   the collection of information. SASL server implementers should be aware that
   SAML IdPs will  be able to track - to some extent - user access to
   their services.
</t>
</section>
<section title="Collusion between RPs">
<t>
   It is possible for Relying Parties to link data that they have collected on the users.
   By using the same identifier to log into every Relying Party, collusion between
   Relying Parties is possible.  In SAML, targeted identity was introduced.
   Targeted identity allows the IdP to transform the identifier the user
   typed in to a Relying Party specific opaque identifier.  This way the Relying Party would never
   see the actual user identifier, but a randomly generated identifier.  
 </t>  
</section>
<section title="GSS-API specific security considerations">
<t>
  Security issues inherent in GSS-API (RFC 2743) and GS2 (RFC 5801)
  apply to the SAML GSS-API mechanism defined in this document.
  Further, and as discussed in section 4, proper TLS server identity
  verification is critical to the security of the mechanism.
  </t>
  </section>
</section> 
<section title="IANA Considerations"> 
 <section title="IANA mech-profile">
 <t> The IANA is requested to register the following SASL profile: </t>
 <t>SASL mechanism profile: SAML20</t>
 <t>Security Considerations: See this document</t> 
 <t>Published Specification: See this document</t> 
 <t>For further information: Contact the authors of this document.</t>
 <t>Owner/Change controller: the IETF</t>
 <t>Intended usage: COMMON</t>
 <t>Note: None</t> 
 </section>
 <section title="IANA OID">
 <t>The IANA is further requested to assign a new entry for this GSS mechanism
   in the sub-registry for SMI Security for Mechanism Codes, whose prefix is
   iso.org.dod.internet.security.mechanisms (1.3.6.1.5.5) and to
   reference this specification in the registry.
 </t>
 </section>
</section> 
</middle> 
<back> 
<references title="Normative References"> 
&RFC1035; &RFC2818; &RFC3492; &RFC3986; &RFC3987;
&RFC2119; &RFC2616; &RFC2743; &RFC4422; 
&RFC5056; &RFC5246; &RFC5280; &RFC5890;
&RFC5891; &RFC6125; &RFC5801; &SAML20; 
&SAML20BIND; &SAML20PROF; &W3C.REC-html401-19991224;
</references>
<references title="Informative References">
 &RFC1939; &RFC3501; 
 &RFC4648; &RFC6120;
</references>
<section title="Acknowledgments"> 
<t>
The authors would like to thank Scott Cantor, Joe Hildebrand, Josh Howlett, Leif Johansson, Thomas
Lenggenhager, Diego Lopez, Hank Mauldin, RL 'Bob' Morgan, Stefan Plug and Hannes Tschofenig for 
their review and contributions.
</t> 
</section> 
<section title="Changes"> <t>This section to be removed
prior to publication.</t> <t> 
<list style="symbols"> 
 <t>09 Fixed text per IESG review</t>
 <t>08 Fixed text per Gen-Art review</t>
 <t>07 Fixed text per comments Alexey Melnikov</t>
 <t>06 Fixed text per AD comments</t>
 <t>05 Fixed references per ID-nits</t>
 <t>04 Added request for IANA assignment, few text clarifications</t>
 <t>03 Number of cosmetic changes, fixes per comments Alexey Melnikov</t>
 <t>02 Changed IdP URI to domain per Joe Hildebrand, fixed some typos</t>
 <t>00 WG -00 draft.  Updates GSS-API section, some fixes per Scott Cantor</t>
 <t>01 Added authorization identity, added GSS-API specifics, added client supplied IdP</t>
 <t>00 Initial Revision. </t> </list> </t> 
</section> 
</back> 
</rfc>
