XEP-XXXX: Remote Authentication

Abstract:This document defines an XMPP protocol extension that enables entities to use SASL for authentication with remote services (such as Multi-User Chat rooms).
Author:Peter Saint-Andre
Copyright:© 1999 - 2010 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:ProtoXEP
Type:Standards Track
Version:0.0.1
Last Updated:2010-12-01

WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <http://xmpp.org/extensions/> and announced on the <standards@xmpp.org> mailing list.


Table of Contents


1. Introduction
2. How It Works
3. Security Considerations
4. IANA Considerations
5. XMPP Registrar Considerations
6. XML Schema

Appendices
    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History


1. Introduction

At present, XMPP entities use SASL RFC 4422 [1] for authentication of XML streams but do not have strong authentication methods available for authentication of interactions with remote entities. One glaring example is Multi-User Chat [2], which uses only plaintext passwords for authentication. Stronger authentication technologies would be preferable. This document defines one such approach: re-use of the XMPP-specific profile of SASL already defined in XMPP Core [3].

2. How It Works

This specification simply re-uses the existing XML namespace defined in XMPP Core, and encapsulates the interactions in XMPP <iq/> stanzas.

Consider an attempt by an XMPP client to join a MUC room:

Example 1. User Seeks to Enter a Chatroom

<presence
    from='hag66@shakespeare.lit/pda'
    to='coven@chat.shakespeare.lit/thirdwitch'>
  <x xmlns='http://jabber.org/protocol/muc'/>
</presence>
  

As MUC is currently defined, the service would return a <not-authorized/> stanza error:

Example 2. Service Denies Access Because No Password Provided

<presence
    from='coven@chat.shakespeare.lit'
    to='hag66@shakespeare.lit/pda'
    type='error'>
  <x xmlns='http://jabber.org/protocol/muc'/>
  <error type='auth'>
    <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  </error>
</presence>
  

The client would then log in with a plaintext password:

Example 3. User Provides Password On Entering a Room

<presence
    from='hag66@shakespeare.lit/pda'
    to='coven@chat.shakespeare.lit/thirdwitch'>
  <x xmlns='http://jabber.org/protocol/muc'>
    <password>cauldronburn</password>
  </x>
</presence>
  

This document proposes instead that the service would return a <not-authorized/> stanza error along with an application-specific error condition Application-Specific Error Conditions [4] of <sasl-required/>.

Example 4. Service Denies Access Because No Password Provided

<presence
    from='coven@chat.shakespeare.lit'
    to='hag66@shakespeare.lit/pda'
    type='error'>
  <x xmlns='http://jabber.org/protocol/muc'/>
  <error type='auth'>
    <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    <sasl-required xmlns='urn:xmpp:errors'/>
  </error>
</presence>
  

The client would then initiate an in-band SASL negotiation with the chatroom.

First, the client will request the mechanisms supported by the chatroom.

Example 5. Client Requests Supported Mechanisms

<iq from='hag66@shakespeare.lit/pda'
    id='ja71b37f'
    to='coven@chat.shakespeare.lit'
    type='get'>
  <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
</iq>
  

The service then returns its list of supported mechanisms.

Example 6. Service Returns Supported Mechanisms

<iq from='coven@chat.shakespeare.lit'
    id='ja71b37f'
    to='hag66@shakespeare.lit/pda'
    type='result'>
  <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
    <mechanism>EXTERNAL</mechanism>
    <mechanism>SCRAM-SHA-1</mechanism>
    <mechanism>PLAIN</mechanism>
  </mechanisms>
</iq>
  

The client can then begin the authentication handshake using one of the advertised mechanisms.

Example 7. Client Chooses a Mechanism

<iq from='hag66@shakespeare.lit/pda'
    id='ib2va629'
    to='coven@chat.shakespeare.lit'
    type='set'>
  <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl'
        mechanism='SCRAM-SHA-1'>
     biwsbj1qdWxpZXQscj1vTXNUQUF3QUFBQU1BQUFBTlAwVEFBQUFBQUJQVTBBQQ==
  </auth>
</iq>
  

The handshake proceeds through a series of challenges and responses.

Example 8. Service Returns a Challenge

<iq from='coven@chat.shakespeare.lit'
    id='ib2va629'
    to='hag66@shakespeare.lit/pda'
    type='result'>
  <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    cj1vTXNUQUF3QUFBQU1BQUFBTlAwVEFBQUFBQUJQVTBBQWUxMjQ2OTViLTY5Y
    TktNGRlNi05YzMwLWI1MWIzODA4YzU5ZSxzPU5qaGtZVE0wTURndE5HWTBaaT
    AwTmpkbUxUa3hNbVV0TkRsbU5UTm1ORE5rTURNeixpPTQwOTY=
  </challenge>
</iq>
  

Example 9. Client Responds to the Challenge

<iq from='hag66@shakespeare.lit/pda'
    id='qh3bx613'
    to='coven@chat.shakespeare.lit'
    type='set'>
  <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    Yz1iaXdzLHI9b01zVEFBd0FBQUFNQUFBQU5QMFRBQUFBQUFCUFUwQUFlMTI0N
    jk1Yi02OWE5LTRkZTYtOWMzMC1iNTFiMzgwOGM1OWUscD1VQTU3dE0vU3ZwQV
    RCa0gyRlhzMFdEWHZKWXc9
  </response>
</iq>
  

Example 10. Service Informs Client of Success

<iq from='coven@chat.shakespeare.lit'
    id='qh3bx613'
    to='hag66@shakespeare.lit/pda'
    type='result'>
  <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
     dj1wTk5ERlZFUXh1WHhDb1NFaVc4R0VaKzFSU289
   </success>
</iq>
  

Having been authenticated, the client can now join the chatroom.

Example 11. User Enters the Chatroom

<presence
    from='hag66@shakespeare.lit/pda'
    to='coven@chat.shakespeare.lit/thirdwitch'>
  <x xmlns='http://jabber.org/protocol/muc'/>
</presence>
  

OPEN ISSUE: does the client need to provide a token of some kind here, or is it sufficient to send a stanza from the authenticated resource?

3. Security Considerations

There is no guarantee that stanzas sent over multiple hops will be protected with regard to confidentiality or integrity across all hops. This failing leads to the possibility of man-in-the-middle attacks. No solution to that problem is proposed in this document.

4. IANA Considerations

This document requires no action on the part of the Internet Assigned Numbers Authority (IANA) [5].

5. XMPP Registrar Considerations

The XMPP Registrar [6] shall add an error condition of <sasl-required/> to its registry of application-specific error conditions located at <http://xmpp.org/registrar/errors.html>. The registration is as follows:

Registry Submission

<condition>
  <ns>urn:xmpp:errors</ns>
  <element>sasl-required</element>
  <desc>authentication via SASL is required in order to perform the requested action</desc>
  <doc>XEP-XXXX</doc>
</condition>
  

6. XML Schema

The schema from RFC 3920 applies.


Appendices


Appendix A: Document Information

Series: XEP
Number: XXXX
Publisher: XMPP Standards Foundation
Status: ProtoXEP
Type: Standards Track
Version: 0.0.1
Last Updated: 2010-12-01
Approving Body: XMPP Council
Dependencies: XMPP Core, RFC 3920, RFC 4422
Supersedes: None
Superseded By: None
Short Name: none
This document in other formats: XML  PDF


Appendix B: Author Information

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org
URI: https://stpeter.im/


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2010 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <http://xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XMPP Standards Foundation, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.


Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.

Given that this XMPP Extension Protocol normatively references IETF technologies, discussion on the <xsf-ietf@xmpp.org> list might also be appropriate.

Errata can be sent to <editor@xmpp.org>.


Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".


Appendix G: Notes

1. RFC 4422: Simple Authentication and Security Layer (SASL) <http://tools.ietf.org/html/rfc4422>.

2. XEP-0045: Multi-User Chat <http://xmpp.org/extensions/xep-0045.html>.

3. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc3920>.

4. XEP-0182: Application-Specific Error Conditions <http://xmpp.org/extensions/xep-0182.html>.

5. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

6. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.


Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

Version 0.0.1 (2010-12-01)

First draft.

(psa)

END