%ents; ]>
Best Practices for Use of SASL EXTERNAL This document specifies best practices for use of the SASL EXTERNAL mechanism within XMPP. &LEGALNOTICE; 0178 Experimental Informational Standards JIG Council XMPP Core N/A &stpeter; &pgmillard; 0.3 2006-09-21 psa

Added TLS and SASL required child elements per rfc3920bis.

0.2 2006-03-09 psa

Corrected client-server failure case to place error in SASL flow rather than binding flow; added note about non-X.509 usages.

0.1 2006-03-09 psa

Initial version.

0.0.3 2006-02-10 psa/pgm

Specified inclusion of authorization identity for server-to-server.

0.0.2 2006-02-10 psa/pgm

Clarified distinction between authentication and authorization.

0.0.1 2006-02-09 psa/pgm

First draft.

&BISNOTE;

RFC 3920 allows the use of any SASL mechanism (see &rfc4422;) in XMPP authentication, including the SASL EXTERNAL mechanism. This document specifies a recommended protocol flow for such use, specifically when use of TLS is required by a deployment. The protocol flows when TLS is not required are more complicated (e.g., alternate flows involving server dialback) and may be documented in a future version of this document.

The RECOMMENDED protocol flow for client-to-server use of SASL EXTERNAL with end-user certificates is as follows:

  1. Client initiates stream to server.

    ]]>
  2. Server replies with stream header.

    ]]>
  3. Server advertises TLS stream feature.

    ]]>
  4. Client sends STARTTLS command to server.

    ]]>
  5. Server informs client to proceed.

    ]]>
  6. Client presents certificate.

  7. Server validates certificate.

    1. If certification authority is untrusted or certificate has been revoked, server closes client's TCP connection.

    2. Else server completes successful TLS negotiation and client initiates a new stream header to server.

      ]]>
  8. Server replies with stream header.

    ]]>
  9. Server advertises SASL mechanisms. Because client presented a certificate, server advertises and prefers SASL EXTERNAL mechanism.

    EXTERNAL DIGEST-MD5 ANONYMOUS ]]>
  10. Because client presented a certificate, client SHOULD consider EXTERNAL to be its preferred SASL mechanism. The client SHOULD NOT include an authorization identity (i.e., XML character data for the <auth/> element) since client-to-server authorization in XMPP is handled during resource binding.

    ]]>
  11. Server determines whether to allow authenticatation of user.

    1. If the certificate presented by the client contains only one valid XMPP address A valid XMPP address is a JID encapsulated as a subjectAltName with an ASN.1 Object Identifier of "id-on-xmppAddr" (which is equivalent to the dotted display format of "1.3.6.1.5.5.7.8.5"). that corresponds to a registered account on the server, the server SHOULD allow authentication of that JID.

      ]]>
    2. If the certificate contains more than one valid XMPP address that corresponds to a registered account on the server (e.g., because the server offers virtual hosting), the server SHOULD allow authentication of the JID whose hostname matches the 'to' address of the stream header sent by the client to the server.

      ]]>
    3. If the certificate does not contain a valid XMPP address that corresponds to a registered account on the server, the server MAY attempt to determine if there is a registered account associated with the user, for example by performing an LDAP lookup based on the Common Name in the certificate; if such a JID mapping is successful, the server SHOULD allow authentication of that mapped JID.

      ]]>
    4. If the user cannot be associated with an account registered on the server, the server MUST return a SASL failure of <not-authorized/> and close the stream.

      ]]>
  12. If SASL authentication succeeded, client opens new stream, then client and server proceed with resource binding as described in RFC 3920.

The RECOMMENDED protocol flow for server-to-server use of SASL EXTERNAL with server (domain) certificates is as follows:

  1. Server1 initiates stream to server2.

    ]]>
  2. Server2 replies with stream header.

    ]]>
  3. Server2 advertises TLS stream feature.

    ]]>
  4. Server1 sends STARTTLS command to Server2.

    ]]>
  5. Server2 informs Server1 to proceed.

    ]]>
  6. Server1 presents certificate.

  7. Server2 validates certificate.

    1. If certification authority is untrusted or certificate has been revoked, Server2 closes Server1's TCP connection.

    2. Else Server2 completes successful TLS negotiation and Server1 initiates a new stream header to Server2.

      ]]>
  8. Server2 replies with stream header.

    ]]>
  9. Server2 advertises SASL mechanisms. Because Server1 presented a certificate, Server2 advertises SASL EXTERNAL mechanism.

    EXTERNAL ]]>
  10. Because Server1 presented a certificate, Server1 SHOULD consider EXTERNAL to be its preferred SASL mechanism. Server1 SHOULD include an authorization identity (base64-encoded as described in RFC 3920) as the XML character data of the <auth/> element, which SHOULD be the same as the 'from' address on the stream header.

    Y29uZmVyZW5jZS5leGFtcGxlLm9yZwo= ]]>

    (In this case, the authorization identity is "conference.example.org".)

  11. Server2 determines if hostname is valid.

    1. If the authorization identity provided by Server1 matches one of the valid XMPP addresses A valid XMPP address is a JID encapsulated as a subjectAltName with an ASN.1 Object Identifier of "id-on-xmppAddr" (which is equivalent to the dotted display format of "1.3.6.1.5.5.7.8.5"). in the certificate or one of the Common Names in the certificates, Server2 SHOULD return success.

      ]]>
    2. Else server MUST return a ¬authorized; failure and close the stream.

      ]]>

The SASL EXTERNAL mechanism can be used outside the context of X.509 certificates, for example via Internet Protocol Security (IPSec) as specified in &rfc4301;. A future version of this specification may document best practices for use of SASL EXTERNAL outside the context of the X.509 infrastructure.

This document introduces no security considerations or concerns above and beyond those discussed in RFC 3920.

This document requires no interaction with &IANA;.

This document requires no interaction with the ®ISTRAR;.

Peter Millard, co-author of the initial version of this specification, died on April 26, 2006. The remaining author appreciates his assistance in defining the best practices described herein.