<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="../rfc2629.xslt"?><!DOCTYPE rfc SYSTEM 'rfc2629.dtd'[<!ENTITY rfc1939 PUBLIC '' 'bibxml/reference.RFC.1939.xml'><!ENTITY rfc2119 PUBLIC '' 'bibxml/reference.RFC.2119.xml'><!ENTITY rfc2616 PUBLIC '' 'bibxml/reference.RFC.2616.xml'><!ENTITY rfc2782 PUBLIC '' 'bibxml/reference.RFC.2782.xml'><!ENTITY rfc2818 PUBLIC '' 'bibxml/reference.RFC.2818.xml'><!ENTITY rfc3023 PUBLIC '' 'bibxml/reference.RFC.3023.xml'><!ENTITY rfc3501 PUBLIC '' 'bibxml/reference.RFC.3501.xml'><!ENTITY rfc5785 PUBLIC '' 'bibxml/reference.RFC.5785.xml'><!ENTITY rfc6125 PUBLIC '' 'bibxml/reference.RFC.6125.xml'>]><?rfc rfcedstyle="yes" ?><?rfc toc="yes"?><?rfc tocdepth="4"?><!-- default = 3 --><?rfc symrefs="yes"?><?rfc sortrefs="yes"?><?rfc compact="yes"?><?rfc subcompact="no"?><!-- <?rfc strict="yes"?> --><!-- <?rfc comments="yes"?> --><!-- <?rfc inline="yes"?> --><rfc category="std" ipr='trust200902' docName='draft-daboo-aggregated-service-discovery-01'>  <front>    <title abbrev="Aggregated Service Discovery">Aggregated Service Discovery</title>    <author initials="A." surname="McMillan" fullname="Andrew McMillan">      <organization abbrev="Morphoss">Morphoss Ltd</organization>      <address>        <postal>          <street>6 Karoro Place</street>          <city>Porirua</city>          <code>5024</code>          <country>New Zealand</country>        </postal>        <email>andrew@morphoss.com</email>        <uri>http://www.morphoss.com/</uri>      </address>    </author>    <author initials="C." surname="Daboo" fullname="Cyrus Daboo">      <organization abbrev="Apple Inc.">Apple Inc.</organization>      <address>        <postal>          <street>1 Infinite Loop</street>          <city>Cupertino</city>          <region>CA</region>          <code>95014</code>          <country>USA</country>        </postal>        <email>cyrus@daboo.name</email>        <uri>http://www.apple.com/</uri>      </address>    </author>    <date />    <area>Applications</area>    <abstract>      <t>This specification describes how clients can discover multiple services to configure themselves with a minimum of user-provided information, as short as possible sequence of queries and with a minimum of overhead for administrators of the services.</t>    </abstract>  </front>  <middle>    <section title='Introduction'>      <t>There are currently various systems in place for discovery and configuration of individual protocols, but the process can often require an extensive series of requests using different protocols to discover all of the details needed to set up the various client services which an individual might use to interact with an organisation or service provider.</t>      <t>Consider Jason, a new employee at Example Enterprises. Jason needs to configure his e-mail program to use <xref target="RFC3501">IMAP</xref> + TLS on port 143 against mail.example.com, he needs to send mail on port 8557 via TLS+SMTP to smtp.example.com, his calendar is on port 8443 at https://caldav.example.com:8443/calendar/, and so forth. Some of these things can be discovered relatively easily, with a combination of DNS queries (including SRV lookups, certificate checking, and http requests). However, each protocol has its own requirements and settings and each has to be done separately. Whilst the client can "hide" the multiple service setup from the user, the actual implementation often requires separate code and processes to manage, making it more complex that it needs to be.</t>      <t>This specification defines a single protocol which will allows for   discovery of a variety of services in a single call, allowing developers to simplify the coding and user interface in client software, and in particular in  multi-function client software such as a combined e-mail and calendar client.</t>    </section>    <section title='Open Issues'>      <t>        <list style='numbers'>          <t>XML vs JSON for the document format</t>          <t>Support custom service attributes without the need for formal registration? If so, would we need a "critical" attribute to indicate ones that must be understood?</t>          <t>Is it OK to embed certificate details for the actual services or a root certificate?</t>          <t>Do we want to support delegation of service information to another service discovery document? That might be useful in cases where different services at the same domain are under the control of different "authorities".</t>          <t>Should we define a local area network discovery mechanism? i.e., client connects to local network and immediately sees a set of services it could configure for the user.</t>          <t>Should we specify whether clients should re-check account information on a regular basis for updates, or should we rely on in-protocol account redirection?</t>        </list>      </t>    </section>    <section title='Conventions Used in This Document'>      <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>      <t>        The namespace "urn:ietf:params:xml:ns:servicediscovery" is reserved for the XML elements defined in this specification. XML elements defined by individual implementations MUST NOT use the "urn:ietf:params:xml:ns:caldav" namespace, and instead should use a namespace that they control.      </t>    </section>    <section title='Overview'>      <t>The following outlines the steps a client carries out to setup multiple services for a user:        <list style='numbers'>          <t>The client software is expected to capture a user identifier and domain name (possibly entered in the form of an email address) from the user, and possibly a password. e.g., 'cyrus@example.com'.</t>          <t>The client would make an initial <xref target="RFC2782">DNS SRV</xref> query for '_servicediscovery._tcp.example.com'. The result of the SRV lookup will be a hostname that is then used in place of the user supplied domain name for the next steps. If the SRV lookup is unsuccessful, then the user supplied domain name is used for the next steps.</t>          <t>The client then makes an <xref target="RFC2616">HTTP GET request</xref> against the server, using <xref target="RFC2818">TLS</xref>, requesting the URL 'https://{domain name}/.well-known/servicediscovery?id={user identifier}', where '{domain name}' is the host name determined from step #2, and '{user identifier}' is the user supplied identifier from step #1. The client will follow any redirects and respond to any authentication challenges. Where the user did not provide an appropriate authentication token in the first step the client software will prompt for it at this point</t>          <t>The client will receive an XML document in step #3 conforming to the format described in <xref target='document-format'/>. The client parses this document to extract information about the available services. At that point it can either present a list of services to the user so that they can decide exactly what they want setup, or it can automatically setup services for all those it supports.</t>        </list>      </t>    </section>    <section title='Aggregated Service Discovery Document Format' anchor='document-format'>      <t>The aggregated service discovery document is an XML document. The document contains two groups of information: overall service provider information (e.g., name, icon "badge", contact information), and a list of each service supported. Each service will contain some information common to each type of service, and then information specific to each service.</t>      <t>The XML DTD is defined in <xref target='schema'/>. Each element is described below. An example of such an aggregated service discovery document for some common services is shown in <xref target="example1"/>.</t>      <section title='SD:servicediscovery'>        <t>The root element for the document</t>        <section title='SD:provider'>          <t>Contains information describing the service provider, that can be used by clients to "group" individual services together under a common name or section when presenting details to the user.</t>          <section title='SD:name'>            <t>The name for the service provider.</t>          </section>          <section title='SD:description'>            <t>The description of the service provider.</t>          </section>          <section title='SD:image'>            <t>An image that can be used as an "icon" for the service provider. The image data MUST be base64 encoded. The image SHOULD NOT exceed a size of 128 x 128 pixels.</t>          </section>          <section title='SD:contact'>            <t>Contact information for the service provider.</t>            <section title='SD:email'>              <t>An email address that can be used to contact the service provider.</t>            </section>            <section title='SD:uri'>              <t>A URI for a webpage providing information about the service provider.</t>            </section>          </section>          <section title='SD:manage'>            <t>A URI for a webpage where a user can manage details of their account. e.g., a place where users can go to add additional (possibly payment required) services.</t>          </section>        </section>        <section title='SD:entry'>          <t>Provides detail for a specific service</t>          <section title='SD:service'>            <t>The service type. This MUST be an IANA registered service type. The service type will determine what additional information is present within the enclosing SD:entry element.</t>          </section>          <section title='SD:application'>            <t>Identifies the nature of the service to allow similar services to be grouped together. This is used in conjunction with the SD:priority element to group services of different types so that only one of the services within the group will be configured. For example, the <xref target="RFC3501">IMAP</xref> and <xref target="RFC1939">POP3</xref> protocols will have SD:service values of 'imap' and 'pop3' respectively, and they could be given the same SD:application value of 'mailstore'. If the service provider prefers its users to use IMAP over POP3 (assuming the client supports IMAP), then the SD:priority value for the IMAP service would have a higher value than that for the POP3 service.</t>          </section>          <section title='SD:priority'>            <t>A positive, non-zero integer value that is used by the service provider to indicate a preference for one particular service over another within the same application group. Multiple services within a group may share the same priority, indicating that the service provider does not wish to express a preference. Services with a higher numbered priority are to be preferred over lower numbered ones.</t>          </section>          <section title='SD:host'>            <t>The hostname of the server providing the service.</t>          </section>          <section title='SD:port'>            <t>The network port number of the server providing the service.</t>          </section>          <section title='SD:tls'>            <t>Provides detail of transport layer security to be used with the service.</t>            <section title='SD:required'>              <t>If present, indicates that clients MUST use transport layer security when connecting to the server providing the service.</t>            </section>            <section title='SD:certificate'>              <t>TODO: not sure we should have this as opposed to relying on normal certificate verification for each service. If present, indicates details about TLS certificates that the server will present to the client during TLS negotiation. Clients can use these certificate details to "short circuit" certificate verification for the service.</t>            </section>          </section>          <section title='SD:auth'>            <t>Provides detail of authentication to be used with the service.</t>            <t>TODO element details</t>          </section>        </section>      </section>    </section>    <section title='Finding the Aggregated Service Discovery Information'>      <t>        A ".well-known" URI is registered by this specification: "servicediscovery" (see <xref target='iana'/>). This URI points to a resource that the client can use to retrieve the aggregated service discovery document for the site.  Clients MUST handle HTTP redirects on the ".well-known" URI. Clients MUST handle HTTP authentication on the ".well-known" URI.      </t>      <t>        When requesting the document clients MUST include a URI query parameter "id" set to the user identifier entered by the user. When responding to the request, the server MUST tailor the aggregated service discovery document for the user making the request and MUST require HTTP authentication by that user before returning the document.      </t>    </section>    <section title='Handling multiple, alternative services'>      <t>        The SD:application and SD:priority elements provide a way for a service provider to distinguish multiple services of the same type, as well as allow the client to select the most appropriate service when several alternatives exist.      </t>      <t>        For example, consider the case of a service provider supporting two separate email retrieval services, one the "primary" account, and the other for "internal" messaging only. It is expected that clients configure accounts for both services. Each service also offers either <xref target="RFC3501">IMAP</xref> or <xref target="RFC1939">POP3</xref> as an email retrieval protocol. In this case the aggregated service discovery document would contain four SD:entry elements: two describing an IMAP service and two describing a POP3 service. Each entry would contain an SD:application element that groups one IMAP and one POP3 service together for each of the "primary" and "internal" account groups. Each entry would also contain an SD:priority element indicating the service providers preference for clients to use either IMAP or POP3. An example of such an aggregated service discovery document is shown in <xref target="example2"/>.      </t>      <t>        When a client retrieves and processes such a document, it would first group services based on the SD:application value. For each group, it iterates over the list of entries in the group, ordered by SD:priority values, and configures an account for the first one it finds with an SD:service that it supports.      </t>    </section>    <section title='Internationalization Considerations' anchor='i18n'>      <t>        Some elements of the service discovery document can contain human readable text that clients might choose to present to a user. Clients SHOULD use the Accept-Language header behavior described in Section 14.4 of <xref target='RFC2616'/> to ensure the server can return a document suitable for the user's chosen language. Servers SHOULD support variations of the service discovery document based on language, returning the appropriate variation in response to client requests. When doing so the xml:lang attribute SHOULD be included on all XML elements in the document that have been localized.      </t>    </section>    <section title='Security Considerations' anchor='security'>      <t>        When using an SRV lookup to discover a server hosting the service discovery document, a malicious attacker with access to the DNS server data, or able to get spoofed answers cached in a recursive resolver, can potentially cause clients to connect to a server hosting a bogus service discovery document with service data chosen by the attacker. In the absence of a secure DNS option, clients SHOULD check that the target FQDN returned in the SRV record matches the original service domain that was queried. If the target FQDN is not in the queried domain, clients SHOULD verify with the user that the SRV target FQDN is suitable for use before executing any connections to the host.      </t>      <t>        HTTP requests for the service-discovery document MUST be performed via TLS. Clients MUST use the procedure outlined in Section 4.3 of <xref target='RFC6125'/> to verify the service.      </t>    </section>    <section title='IANA Considerations' anchor='iana'>      <section title='Namespace Registration' anchor='iana-namespace'>        <t>Registration request for the aggregated service discovery namespace:          <list>            <t>URI: urn:ietf:params:xml:ns:servicediscovery</t>            <t>Registrant Contact: IESG</t>            <t>XML: None. Namespace URIs do not represent an XML specification.</t>          </list>        </t>      </section>      <section title="Media Type" anchor="iana-media-type">        <t>This section defines the MIME media type for use with the aggregated service discovery XML data.        <list style="hanging">          <t hangText="Type name:">application</t>          <t hangText="Subtype name:">servicediscovery+xml</t>          <t hangText="Required parameters:">none</t>          <t hangText="Optional parameters:">charset as defined for application/xml in <xref target='RFC3023'/>; per <xref target='RFC3023'/>, use of the charset property parameter with the value "utf-8" is "STRONGLY RECOMMENDED"</t>          <t hangText="Encoding considerations:">Same as encoding considerations of application/xml as specified in <xref target='RFC3023'/></t>          <t hangText="Security considerations:">See <xref target='security'/>.</t>          <t hangText="Interoperability considerations:">This media type provides a format for aggregated service discovery information based on XML.</t>          <t hangText="Published specification:">This specification.</t>          <t hangText="Applications which use this media type:">Applications that configure services.</t>          <t hangText="Additional information:">            <list style="hanging">              <t hangText="Magic number(s):">None</t>              <t hangText="File extension(s):">None</t>              <t hangText="Macintosh file type code(s):">None specified.</t>            </list>          </t>          <t hangText="Person &amp; email address to contact for further information:">IESG</t>          <t hangText="Intended usage:">COMMON</t>          <t hangText="Restrictions on usage:">There are no restrictions on where this media type can be used.</t>          <t hangText="Author:">See the "Author's Address" section of this document.</t>          <t hangText="Change controller:">IETF</t>        </list>        </t>      </section>      <section title="Well-Known URI Registration">        <t>          This document defines a ".well-known" URI using the registration procedure and template from Section 5.1 of <xref target='RFC5785'/>.        </t>        <section title='servicediscovery Well-Known URI Registration'>          <t>            <list style='hanging'>               <t hangText="URI suffix:">servicediscovery</t>                       <t hangText="Change controller:">IETF.</t>                       <t hangText="Specification document(s):">This RFC.</t>                       <t hangText="Related information:">None.</t>            </list>          </t>        </section>      </section>    </section>    <section title='Acknowledgments'>      <t></t>    </section>  </middle>  <back>    <references title='Normative References'>      &rfc2119;      &rfc2616;      &rfc2782;      &rfc2818;      &rfc3023;      &rfc5785;      &rfc6125;    </references>    <references title='Informative References'>      &rfc1939;      &rfc3501;    </references>    <section title='Change History (to be removed prior to publication as an RFC)'>      <t>Changes in -01:       <list style='numbers'>        <t>Renamed various elements for clarity.</t>        <t>Added an SD:manage element.</t>        <t>Added a section on handling of multiple, alternative services, together with a second appendix example.</t>      </list></t>    </section>    <section title='Aggregated Service Discovery Schema' anchor='schema'>      <t>				<figure>					<artwork><![CDATA[<!ELEMENT servicediscovery (provider?, entry*) >  <!ELEMENT provider (name?, description?, image?,                      contact?, manage?) >    <!ELEMENT name (#PCDATA) >    <!ELEMENT description (#PCDATA) >    <!ELEMENT image (#PCDATA) >    <!ELEMENT contact (email?, uri?) >      <!ELEMENT email (#PCDATA) >      <!ELEMENT uri (#PCDATA) >    <!ELEMENT manage (#PCDATA) >  <!ELEMENT entry (service, (application, priority)?,                      host?, port?, tls?, auth?, ANY) >    <!ELEMENT service (#PCDATA) >    <!ELEMENT application (#PCDATA) >    <!ELEMENT priority (#PCDATA) >    <!ELEMENT host (#PCDATA) >    <!ELEMENT port (#PCDATA) >    <!ELEMENT tls (required?, certificate*) >      <!ELEMENT required EMPTY >      <!ELEMENT certificate (data|id|hash) >        <!ELEMENT data (#PCDATA) >        <!ELEMENT id (#PCDATA) >        <!ELEMENT hash (#PCDATA) >    <!ELEMENT auth (type, details?) >        <!ELEMENT type (#PCDATA) >        <!ELEMENT details (userpswd|ANY) >          <!ELEMENT userpswd (userid?, password?) >            <!ELEMENT userid (#PCDATA) >            <!ELEMENT password (#PCDATA) >            <!ELEMENT principal-URL (#PCDATA) >  ]]></artwork>				</figure>      </t>    </section>    <section title='Example of multiple services' anchor='example1'>      <t>				<figure>					<artwork><![CDATA[GET /.well-known/servicediscovery?id=cyrus@example.com HTTP/1.1Host:example.com:443Authorization: basic QmFzZTY0IGlzIGVhc3kgdG8gZGVjb2RlContent-Type: application/servicediscovery+xmlContent-Length: xxx<?xml version="1.0" standalone="no"?><servicediscovery xmlns="urn:ietf:params:xml:ns:servicediscovery">  <provider>    <name>Super-duper ISP</name>    <description>      Super-duper ISP is the home for all your data.    </description>    <contact>      <email>superduper@example.com</email>      <uri>http://www.example.com</uri>    </contact>    <manage>http://www.example.com/myaccount.html</manage>  </provider>    <entry>    <service>imap</service>    <application>mail-access</application>    <priority>2</priority>    <host>imap.example.com</host>    <port>143</port>    <tls>      <required />    </tls>    <auth>      <type>CRAM-MD5</type>    </auth>  </entry>  <entry>    <service>pop3</service>    <application>mail-access</application>    <priority>1</priority>    <host>pop.example.com</host>    <port>110</port>    <tls>      <required />    </tls>    <auth>      <type>CRAM-MD5</type>    </auth>  </entry>  <entry>    <service>submission</service>    <host>mail.example.com</host>    <port>587</port>    <tls>      <required />    </tls>    <auth>      <type>CRAM-MD5</type>    </auth>  </entry>  <entry>    <service>caldav</service>    <host>calendar.example.com</host>    <port>443</port>    <tls>      <required />    </tls>    <auth>      <type>Digest</type>    </auth>    <principal-URL>https://calendar.example.com/principals/users/cyrus</principal-URL>  </entry>  <entry>    <service>carddav</service>    <host>contacts.example.com</host>    <port>443</port>    <tls>      <required />    </tls>    <auth>      <type>Digest</type>    </auth>    <principal-URL>https://contacts.example.com/principals/users/cyrus</principal-URL>  </entry></servicediscovery>]]></artwork>        </figure>      </t>    </section>    <section title='Example - multiple, alternative mail retrieval services' anchor='example2'>      <t>				<figure>					<artwork><![CDATA[GET /.well-known/servicediscovery?id=cyrus@example.com HTTP/1.1Host:example.com:443Authorization: basic QmFzZTY0IGlzIGVhc3kgdG8gZGVjb2RlContent-Type: application/servicediscovery+xmlContent-Length: xxx<?xml version="1.0" standalone="no"?><servicediscovery xmlns="urn:ietf:params:xml:ns:servicediscovery">  <provider>    <name>Mail Agrregator ISP</name>    <description>      Primary and internal email services.    </description>    <contact>      <email>emails@example.com</email>      <uri>http://www.example.com</uri>    </contact>    <manage>http://www.example.com/myaccount.html</manage>  </provider>    <entry>    <service>imap</service>    <application>primary email</application>    <priority>2</priority>    <host>imap.example.com</host>    <port>143</port>    <tls>      <required />    </tls>    <auth>      <type>CRAM-MD5</type>    </auth>  </entry>  <entry>    <service>pop3</service>    <application>primary email</application>    <priority>1</priority>    <host>pop.example.com</host>    <port>110</port>    <tls>      <required />    </tls>    <auth>      <type>CRAM-MD5</type>    </auth>  </entry>  <entry>    <service>imap</service>    <application>internal email</application>    <priority>2</priority>    <host>imap.example.com</host>    <port>143</port>    <tls>      <required />    </tls>    <auth>      <type>CRAM-MD5</type>    </auth>  </entry>  <entry>    <service>pop3</service>    <application>internal email</application>    <priority>1</priority>    <host>pop.example.com</host>    <port>110</port>    <tls>      <required />    </tls>    <auth>      <type>CRAM-MD5</type>    </auth>  </entry></servicediscovery>]]></artwork>        </figure>      </t>    </section>  </back></rfc>