<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="../rfc2629.xslt"?><!DOCTYPE rfc SYSTEM 'rfc2629.dtd'[<!ENTITY I-D.newton-json-content-rules SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.newton-json-content-rules.xml"><!ENTITY I-D.ietf-appsawg-webfinger SYSTEM 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-appsawg-webfinger-14.xml'><!ENTITY rfc1939 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.1939.xml'><!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'><!ENTITY rfc2244 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2244.xml'><!ENTITY rfc2616 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2616.xml'><!ENTITY rfc2818 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2818.xml'><!ENTITY rfc3501 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3501.xml'><!ENTITY rfc4422 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4422.xml'><!ENTITY rfc4627 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4627.xml'><!ENTITY rfc5988 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5988.xml'><!ENTITY rfc6125 PUBLIC '' 'http://xml.resource.org/public/rfc/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-03'>  <front>    <title abbrev="Automated Service Configuration">Automated Service Configuration</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 retrieve configuration for multiple services with a minimum of user-provided information, and 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 services, 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 allow for   retrieval of a variety of service configuration information 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 clients. Configuration is retrieved from a single document on a server, improving performance over per-service configuration mechanisms that require multiple network operations. In addition, complex dependencies between different services can be easily represented, so that, for example, some services can be prioritized over others, or grouped together by "logical" function. Further, rich information about each service can be included, such as details about required transport layer security or authentication.</t>      <t>This protocol is intended to provide a simple one-way retrieval of configuration information, with the data flow from service provider to client, building on successful technologies such as HTTP and JSON to accomplish its goals. As such it differs from other "client configuration" orientated protocols, such as <xref target="RFC2244">ACAP</xref>, which have not had much deployment success due to complexity introduced by having a a two-way exchange of data, and the resulting need to keep multiple clients synchronized as changes occur.</t>    </section>    <section title='Open Issues'>      <t>        <list style='numbers'>          <t>Is it OK to embed certificate details for the actual services or a root certificate?</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>    </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 authentication information. e.g., 'cyrus@example.com'.</t>          <t>The client uses the <xref target="I-D.ietf-appsawg-webfinger">WebFinger</xref> protocol to request a link relation with the value "service-configuration", using the identifier supplied by the user, following any redirects and responding to any authentication challenges.</t>          <t>The client retrieves a <xref target="RFC4627">JSON</xref> document conforming to the format described in <xref target='document-format'/> from the target of the link relation returned in Step #2. 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='Automated Service Configuration Document Format' anchor='document-format'>      <t>The automated service configuration document is an <xref target="RFC4627">JSON</xref> document. The document contains a single object with two members representing two pieces 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 JSON document format is defined here using the syntax in <xref target="I-D.newton-json-content-rules"/>. An example of such an automated service configuration document for some common services is shown in <xref target="example1"/>.</t>          <figure>            <preamble>              JSON Content Rules for the JSON document returned for a "capabilities" action request.            </preamble>            <artwork><![CDATA[; root objectroot {  provider,  entries}; ----- provider -----; 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.provider "provider" {  provider_name,  ?description,  ?image,  ?contact,  ?manage,  ?password_reset,  ?ttl}; The name for the service provider.provider_name "name" : string; The description of the service provider.description "description" : string; A URI for an image that can be used as an "icon" for the service; provider. The URI SHOULD be an http or https URI and clients; SHOULD use standard HTTP Accept header behavior to request an; appropriate image format from the server (see Section 14.1 of; [RFC2616]). The image SHOULD NOT exceed a size of 128 x 128; pixels.image "image" : uri; Contact information for the service provider.contact "contact" {  email / (?email, uri)}; An email address that can be used to contact the service; provider.email "email" : email; A URI for a webpage providing information about the service; provider.url "url" : uri; 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.manage "manage" : uri; A URI for a webpage where a user can change their account; password.password_reset "password-reset" : uri; The minimum interval in seconds which clients SHOULD wait; before re-fetching the document to check for changes.ttl "ttl" : integer; ----- entries -----; List of services.entries "entries" [ *entry ]entry {  name,  service,  ?(group, priority),  uri / (host, ?port),  ?tls,  ?auth,}; A description for the service.name "name" : string; The service type. See below for details of the value used.service "service" : string; Identifies the nature of the service to allow similar services to; be grouped together.group "group" : string; Identifies the nature of the service to allow similar services to; be grouped together.priority "priority" : integer 1; The URI used to contact the server providing the service.uri "uri" : uri; The hostname of the server providing the service.host "host" : string; The network port number of the server providing the service.port "port" : integer 0..65535; Provides detail of transport layer security to be used with the; service.tls "tls" {  ?required,  ?at_start,  ?certificates}; Indicates that clients MUST use transport layer security when; connecting to the server providing the service.required "required" : boolean; Indicates that clients MUST initiate TLS immediately upon; connecting to the server rather than using an "in-protocol"; upgrade mechanism.at_start "at-start" : boolean; List of certificates.certificates "certificates" [ *certificate ]; Details about the TLS certificate the server will use. Clients; MAY use the specified certificate information to validate any TLS; connection to the server, otherwise existing rules for the target; protocol are used.certificate "certificate" {  cert_name /  fingerprint /  public_key}; The name of the certificate.cert_name "name" : string; The fingerprint of the certificate.fingerprint "fingerprint" : string; The fingerprint of the certificate.public_key "public-key" : string; List of authentication methods to use in server preferred order.; If the protocol supports SASL [RFC4422] then this is a list of; SASL authentication mechanisms, otherwise it is a protocol; specific list of names. In either case, clients MUST NOT use; a mechanism that is not advertised in this list.auth "auth" [ *string ]]]></artwork>          </figure>    <section title='Extensions to the Document Format'>      <t>        Additional members can be added to the JSON document root, "provider" or "entries" objects with the following rules:        <list style="numbers">          <t>Standards based members MUST be defined in an RFC and registered with IANA. TBD - precise details of this and IANA registry setup.</t>          <t>Member names that include a prefix of the form "{...}", where the contents of the curly braces is a vendor id, are considered to be vendor specific private extensions which do not require registration. TBD nature of vendor id.</t>        </list>      </t>      <t>Clients SHOULD ignore all extension member elements that they are unable to process.</t>    </section>    <section title='Service names'>      <t>        The "service" member in the "entry" object is used to convey an identifier for the type of service being described. This can have one of two forms:        <list style="numbers">          <t>An identifier from the IANA ports registry defining a service type.</t>          <t>Identifiers that include a prefix of the form "{...}", where the contents of the curly braces is a vendor id, are considered to be vendor specific private service type. TBD nature of vendor id.</t>        </list>      </t>    </section>    </section>    <section title='Finding the Automated Service Configuration Information'>      <t>        This specification makes use of the <xref target="I-D.ietf-appsawg-webfinger">WebFinger</xref> protocol to allow a client to find a link to the automated service configuration document corresponding to an identifier supplied by a user. This specification registers the "service-configuration" link relation type for use with WebFinger, to identify the links for automated service configuration documents. When the client makes a WebFinger request, it SHOULD use the "rel" query parameter, defined in Section 4.3 of <xref target="I-D.ietf-appsawg-webfinger"/>, to ensure the relevant link relations are returned. The URI referenced by the links MUST be an <xref target="RFC2818">HTTPS</xref> URI, and MUST point to a resource that the client can use to retrieve the automated service configuration document for the site.      </t>      <t>        Servers can return multiple "service-configuration" links in the webfinger response. Clients SHOULD treat each link as separate, complementary services available to the user.      </t>      <t>        When requesting automated service configuration documents, clients MUST include a URI query parameter "id" set to the user identifier entered by the user. Clients MUST handle HTTP redirects on the link URI, but MUST NOT allow a redirect to an insecure URI. When responding to the request, the server MUST tailor the automated service configuration document for the user making the request and MUST require HTTP authentication by that user before returning the document.      </t>      <t>        Clients SHOULD cache the document for a period of time no less than the value of the "ttl" member in the "provider" object, or for a minimum of 24 hours of no "ttl" member is present.      </t>    </section>    <section title='Handling multiple, alternative services'>      <t>        The "group" and "priority" members of an entry 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 automated service configuration document would contain four entry items: two describing an IMAP service and two describing a POP3 service. Each entry would contain a "group" member that groups one IMAP and one POP3 service together for each of the "primary" and "internal" account groups. Each entry would also contain a "priority" member indicating the service providers preference for clients to use either IMAP or POP3. An example of such an automated service configuration 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 automated service configuration 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 automated service configuration document based on language, returning the appropriate variation in response to client requests.      </t>    </section>    <section title='Security Considerations' anchor='security'>      <t>        When using WebFinger to discover a server hosting the automated service configuration 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 automated service configuration 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 link relation URI 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 link URI target FQDN is suitable for use before executing any connections to the host.      </t>      <t>        HTTP requests for the automated service configuration 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="Link Relation Registration">        <t>          This document defines a "service-configuration" link relation type using the registration procedure and template from Section 6.2 of <xref target='RFC5988'/>.        </t>        <section title='service-configuration Link Relation Registration'>          <t>            <list style='hanging'>               <t hangText="Relation Name:">service-configuration</t>                       <t hangText="Description:">Refers to an automated service configuration document</t>                       <t hangText="Reference:">This RFC.</t>            </list>          </t>        </section>      </section>    </section>    <section title='Acknowledgments'>    <t>      The authors would like to thank the following individuals for      contributing their ideas and providing feedback for writing this specification:      Andrew Biggs,      Mike Douglass,      Joe Hildebrand,      Paul Jones,      Markus Lanthaler,      Matt Miller,      Stepan Potys,      and      Peter Saint-Andre    </t>    <t>      The authors would also like to thank CalConnect,      The Calendaring and Scheduling Consortium,      for advice with this specification.    </t>    </section>  </middle>  <back>    <references title='Normative References'>      &I-D.newton-json-content-rules;      &I-D.ietf-appsawg-webfinger;      &rfc2119;      &rfc2616;      &rfc2818;      &rfc4422;      &rfc4627;      &rfc5988;      &rfc6125;    </references>    <references title='Informative References'>      &rfc1939;      &rfc2244;      &rfc3501;    </references>    <section title='Change History (to be removed prior to publication as an RFC)'>      <t>Changes in -03:       <list style='numbers'>        <t>Fix examples to properly show request/response headers.</t>        <t>Title change.</t>        <t>Added text to the Introduction to differentiate this from other protocols.</t>        <t>Switched to WebFinger instead of SRV.</t>      </list>      </t>      <t>Changes in -02:       <list style='numbers'>        <t>Switched to JSON document format.</t>      </list>      </t>      <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='Example of multiple services' anchor='example1'>      <t>        First comes the WebFinger request to retrieve the appropriate link relation.				<figure>					<artwork><![CDATA[>> Request <<GET /.well-known/webfinger?  resource=acct:cyrus@example.com&  rel=service-configuration HTTP/1.1Host:example.com:443Authorization: basic QmFzZTY0IGlzIGVhc3kgdG8gZGVjb2Rl>> Response <<HTTP/1.1 200 OKDate: Wed, 20 Feb 2013 09:32:12 GMTContent-Type: application/jrd+jsonContent-Length: xxx{  "subject" : "acct:cyrus@example.com",  "links" :  [    {      "rel" : "service-configuration",      "type" : "application/json",      "href" : "https://example.com/service-config"    }  ]} ]]></artwork>        </figure>      </t>      <t>        Next is the retrieval of the automated service configuration document using the URI from the WebFinger link relation.				<figure>					<artwork><![CDATA[>> Request <<GET /service-config?id=cyrus@example.com HTTP/1.1Host:example.com:443Authorization: basic QmFzZTY0IGlzIGVhc3kgdG8gZGVjb2Rl>> Response <<HTTP/1.1 200 OKDate: Wed, 20 Feb 2013 09:32:12 GMTContent-Type: application/jsonContent-Length: xxx{  "provider" : {    "name" : "Super-duper ISP",    "description" : "Super-duper ISP is the home for all your data.",    "contact" : {      "email" : "superduper@example.com",      "uri" : "http://www.example.com"    },    "manage" : "http://www.example.com/myaccount.html",    "ttl" : 2592000  },    "entries" : [    {      "name" : "Corporate Mail",      "service" : "imap",      "group" : "mail-access-1",      "priority" : 2,      "uri" : "imap:imap.example.com",      "tls" : {        "required" : true      },      "auth" : ["CRAM-MD5"]    },    {      "name" : "Corporate Mail",      "service" : "pop3",      "group" : "mail-access-1",      "priority" : 1,      "host" : "mail.example.com",      "port" : 110,      "tls" : {        "required" : true      },      "auth" : ["CRAM-MD5"]    },    {      "name" : "Corporate Mail",      "service" : "submission",      "host" : "mail.example.com",      "port" : 587,      "tls" : {        "required" : true      },      "auth" : ["CRAM-MD5"]    },    {      "name" : "Corporate Calendar",      "service" : "caldav",      "uri" : "https://calendar.example.com",      "tls" : {        "required" : true,        "at-start" : true      },      "auth" : ["Digest"]    },    {      "name" : "Corporate Contacts",      "service" : "carddav",      "uri" : "https://contacts.example.com",      "tls" : {        "required" : true,        "at-start" : true      },      "auth" : ["Digest"]    }  ]}]]></artwork>        </figure>      </t>    </section>    <section title='Example - multiple, alternative mail retrieval services' anchor='example2'>      <t>        First comes the WebFinger request to retrieve the appropriate link relation.				<figure>					<artwork><![CDATA[>> Request <<GET /.well-known/webfinger?  resource=acct:cyrus@example.com&  rel=service-configuration HTTP/1.1Host:example.com:443Authorization: basic QmFzZTY0IGlzIGVhc3kgdG8gZGVjb2Rl>> Response <<HTTP/1.1 200 OKDate: Wed, 20 Feb 2013 09:32:12 GMTContent-Type: application/jrd+jsonContent-Length: xxx{  "subject" : "acct:cyrus@example.com",  "links" :  [    {      "rel" : "service-configuration",      "type" : "application/json",      "href" : "https://example.com/service-config"    }  ]} ]]></artwork>        </figure>      </t>      <t>        Next is the retrieval of the automated service configuration document using the URI from the WebFinger link relation. This example shows two different email services: "Primary Mail" (which has both IMAP4 and POP3 services available), and "Internal Mail" (which additionally has a private "webmail" service available). An extension member is also specified for the "webmail" service.				<figure>					<artwork><![CDATA[>> Request <<GET /service-config?id=cyrus@example.com HTTP/1.1Host:example.com:443Authorization: basic QmFzZTY0IGlzIGVhc3kgdG8gZGVjb2Rl>> Response <<HTTP/1.1 200 OKDate: Wed, 20 Feb 2013 09:32:12 GMTContent-Type: application/jsonContent-Length: xxx{  "provider" : {    "name" : "Mail Agrregator ISP",    "description" : "Primary and internal email services.",    "contact" : {      "email" : "emails@example.com",      "uri" : "http://www.example.com"    },    "manage" : "http://www.example.com/myaccount.html",    "ttl" : 2592000  },    "entries" : [    {      "name" : "Primary Mail",      "service" : "imap",      "group" : "primary",      "priority" : 2,      "uri" : "imap:mail.example.com",      "tls" : {        "required" : true      },      "auth" : ["CRAM-MD5"]    },    {      "name" : "Primary Mail",      "service" : "pop3",      "group" : "primary",      "priority" : 1,      "host" : "mail.example.com",      "port" : 110,      "tls" : {        "required" : true      },      "auth" : ["CRAM-MD5"]    },    {      "name" : "Internal Mail",      "service" : "imap",      "group" : "internal",      "priority" : 2,      "uri" : "imap:int.example.com",      "tls" : {        "required" : true      },      "auth" : ["CRAM-MD5"]    },    {      "name" : "Internal Mail",      "service" : "pop3",      "group" : "internal",      "priority" : 1,      "host" : "int.example.com",      "port" : 110,      "tls" : {        "required" : true      },      "auth" : ["CRAM-MD5"]    }    {      "name" : "Internal Mail",      "service" : "{example.com}webmail",      "group" : "internal",      "priority" : 1,      "uri" : "https://int.example.com/webmail",      "{example.com}bookmark": "https://int.example.com/webmail"    }  ]}]]></artwork>        </figure>      </t>    </section>    <section title='Example - multiple links' anchor='example3'>      <t>        TODO: example of webfinger returning multiple "service-configuration" links.      </t>    </section>  </back></rfc>