Re: [hybi] WebSocket handshake (HTTP and SSO)

Greg Wilkins <gregw@webtide.com> Mon, 30 August 2010 03:00 UTC

Return-Path: <gregw@webtide.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id E56CC3A68F6 for <hybi@core3.amsl.com>; Sun, 29 Aug 2010 20:00:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.749
X-Spam-Level:
X-Spam-Status: No, score=-1.749 tagged_above=-999 required=5 tests=[AWL=0.228, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id do0rZS2r2j3F for <hybi@core3.amsl.com>; Sun, 29 Aug 2010 20:00:59 -0700 (PDT)
Received: from mail-yw0-f44.google.com (mail-yw0-f44.google.com [209.85.213.44]) by core3.amsl.com (Postfix) with ESMTP id EE6423A68E1 for <hybi@ietf.org>; Sun, 29 Aug 2010 20:00:58 -0700 (PDT)
Received: by ywk9 with SMTP id 9so2261394ywk.31 for <hybi@ietf.org>; Sun, 29 Aug 2010 20:01:29 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.100.190.11 with SMTP id n11mr3952900anf.160.1283137289801; Sun, 29 Aug 2010 20:01:29 -0700 (PDT)
Received: by 10.100.248.12 with HTTP; Sun, 29 Aug 2010 20:01:29 -0700 (PDT)
In-Reply-To: <AANLkTikCVNoJnKXTOTJadYJWYR356u1wZdVNdBwEh6cg@mail.gmail.com>
References: <4C7A269F.8020306@gmail.com> <AANLkTinqJ+K-pqm7p7S+aviWVY==S0mJ9RBvNfpnTa02@mail.gmail.com> <AANLkTikCVNoJnKXTOTJadYJWYR356u1wZdVNdBwEh6cg@mail.gmail.com>
Date: Mon, 30 Aug 2010 13:01:29 +1000
Message-ID: <AANLkTik3Jo4rG8cTcHerpwPumT_X77bn9y5rDkZ8ZD33@mail.gmail.com>
From: Greg Wilkins <gregw@webtide.com>
To: John Tamplin <jat@google.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Cc: hybi <hybi@ietf.org>, Brodie Thiesfield <brodie@jellycan.com>
Subject: Re: [hybi] WebSocket handshake (HTTP and SSO)
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Aug 2010 03:01:00 -0000

John,

>From the point of view of a combined HTTP/websocket server, it would
be simplest if we can just use existing mechanisms for things like
BASIC, DIGEST, OAUTH, OpenID, acegi, NTML etc. etc.
So while there may be better security mechanism that could be applied
to websocket only client and servers, it would be unproductive to
prohibit the use of existing security mechanism if a way can be found
to use them.

For some of these, providing credentials ahead of time may be
sufficient, but others will be issuing challenges with nonces that
will need to be handled etc.  For the mechanisms that are already
supported in browser (BASIC, DIGEST), I would not think it would be
too difficult to support those if the browser had previously collected
credentials from the user (and it could just fail if it had not).

The hard ones are the mechanism that are not supported in the browser,
but in js libraries.  If they depend on headers, redirects and other
status codes, then such things need a way to be tunnelled through the
websocket API. I completely understand the reluctance to allow
arbitrary headers to be passed via the websocket API, yet I'm
concerned that will drive us to having to recreate new security
mechanisms that will in the end probably require some control over
headers anyway.  So I think the first step is to remove the
prohibition on using these mechanisms and then to build the consensus
on the use-cases that might justify support in the ws API.

cheers




On 30 August 2010 12:18, John Tamplin <jat@google.com> wrote:
> On Sun, Aug 29, 2010 at 8:44 PM, Greg Wilkins <gregw@webtide.com> wrote:
>>
>> I do not think servers will be a problem, since if you use a HTTP
>> server that supports websockets, then it is very likely to just allow
>> arbitrary HTTP conversations to take place before the upgrade (as you
>> would have to do actual work to prevent that). Jetty certainly
>> supports this.
>>
>> The problem will be the clients.  There is nothing compelling the
>> clients to open websocket connections using their HTTP stacks, which
>> may be capable of handling redirections, 401's, set-cookies and other
>> HTTP stuff commonly used for authentication and authorization. Even if
>> the clients do use their HTTP stacks for the websocket handshake,
>> there are problems with some features (eg 401's) which need
>> interaction from a user, as their may not be appropriate UI mechanisms
>> associated with websocket.  So either you will need to develop your
>> own client that you know will support the features that you want, or
>> their has to be a commonly accepted set of HTTP features that commonly
>> deployed websocket capable browsers will accept.
>>
>> My feeling is that the browsers vendors are less keen on supporting
>> HTTP features on websocket handshakes, while the server vendors are
>> very keen.  I think some time and experience with real deployments is
>> needed for those two positions to converge.  Thus I think at this
>> stage having the prohibition on such features removed is the best we
>> can expect and that will allows  servers/browsers to experiment with
>> supporting HTTP features.
>
> I agree that we need to solve authentication with WebSockets, but it isn't
> clear emulating HTTP Auth is the best answer.  Since the connection is under
> program control and the program has presumably already authenticated itself
> with the server, perhaps just providing a way to pass credentials to the
> WebSocket constructor (which would then be passed in the handshake) would be
> sufficient.  Of course that could always be done by client and server
> agreement to send the credentials as the first message, though it may be
> common enough to support it directly rather than having every app reinvent
> it slightly differently.
> --
> John A. Tamplin
> Software Engineer (GWT), Google
>