Re: [hybi] About authentication mechanism

Ian Fette (イアンフェッティ) <ifette@google.com> Wed, 22 June 2011 00:04 UTC

Return-Path: <ifette@google.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C239721F85B6 for <hybi@ietfa.amsl.com>; Tue, 21 Jun 2011 17:04:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.49
X-Spam-Level:
X-Spam-Status: No, score=-105.49 tagged_above=-999 required=5 tests=[AWL=0.185, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, MIME_8BIT_HEADER=0.3, NORMAL_HTTP_TO_IP=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QYaoA7QXTYLF for <hybi@ietfa.amsl.com>; Tue, 21 Jun 2011 17:04:36 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by ietfa.amsl.com (Postfix) with ESMTP id 362A421F85B4 for <hybi@ietf.org>; Tue, 21 Jun 2011 17:04:36 -0700 (PDT)
Received: from hpaq5.eem.corp.google.com (hpaq5.eem.corp.google.com [172.25.149.5]) by smtp-out.google.com with ESMTP id p5M04Z2t001282 for <hybi@ietf.org>; Tue, 21 Jun 2011 17:04:35 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1308701075; bh=XP5EeKdUEij0sBSKyaaPlDXI6AE=; h=MIME-Version:Reply-To:In-Reply-To:References:Date:Message-ID: Subject:From:To:Cc:Content-Type; b=HlPsFY+qZrSjrs1iWPxT0VGm15qsOTBOEUluE6DXNf7xZFo9mxbFdkUw/p5dWzGSK SOn0mNhcmUuI90X12wtVA==
Received: from iyi20 (iyi20.prod.google.com [10.241.51.20]) by hpaq5.eem.corp.google.com with ESMTP id p5M04WAB020817 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for <hybi@ietf.org>; Tue, 21 Jun 2011 17:04:33 -0700
Received: by iyi20 with SMTP id 20so393752iyi.35 for <hybi@ietf.org>; Tue, 21 Jun 2011 17:04:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=lX3PaER6IZ+o67UffQT+zd5cL4kHi7IonYs7KKyjpEE=; b=S8a/wV7PQ9TumU9X5gT2acmfB/nBee/9a778CzIQ9nkXD9nNlKzVgeXq2ADtOpbK9F nT7omPSHXjpJI4imB/Tw==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; b=SHtvJ97AYxePYy0FS/AQwlwAZ0R+GM2SP9nMKhr125eebyBt1ad8UPtm4rZ/PvWORd v9ywjexMtwPLVS2KvVWQ==
MIME-Version: 1.0
Received: by 10.42.159.68 with SMTP id k4mr40958icx.117.1308701072199; Tue, 21 Jun 2011 17:04:32 -0700 (PDT)
Received: by 10.231.33.8 with HTTP; Tue, 21 Jun 2011 17:04:32 -0700 (PDT)
In-Reply-To: <BANLkTiksptqmTWftg7Ur98QQnp22QV7OLA@mail.gmail.com>
References: <BANLkTinerv=Ua4d-ma+uPVJjF95U1U5iXg@mail.gmail.com> <BANLkTin4mWJgQm+pfyYRs_RhRkdMBfY_Og@mail.gmail.com> <BANLkTiksptqmTWftg7Ur98QQnp22QV7OLA@mail.gmail.com>
Date: Tue, 21 Jun 2011 17:04:32 -0700
Message-ID: <BANLkTimw8T4pZieBeCjaPQJ8oYWfbTjkmg@mail.gmail.com>
From: =?UTF-8?B?SWFuIEZldHRlICjjgqTjgqLjg7Pjg5Xjgqfjg4Pjg4bjgqMp?= <ifette@google.com>
To: Greg Wilkins <gregw@intalio.com>
Content-Type: multipart/alternative; boundary=90e6ba6137b286918704a641b63b
X-System-Of-Record: true
Cc: hybi@ietf.org
Subject: Re: [hybi] About authentication mechanism
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
Reply-To: ifette@google.com
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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: Wed, 22 Jun 2011 00:04:37 -0000

Speaking as an individual,

I would not want to support this from the browser side. We finally are
starting to kill in browsers HTTP AUTH dialogs created by subresources
(images etc). Frankly it's a very poor user experience. I think most people
will use WS the way they use XHR + long polling, namely they will be on an
established page, do their authentication however they do their
authentication, set a cookie and move on. In some small corner of the
universe, a small set of applications may continue to use HTTP AUTH, but I
don't feel compelled to go out of the way to make its use any easier than if
I had requested javascript from another origin which popped up an auth
dialog. (Rather, I would probably block that as a browser).

-Ian

On Tue, Jun 21, 2011 at 4:35 PM, Greg Wilkins <gregw@intalio.com> wrote:

> On 21 June 2011 23:43, Iñaki Baz Castillo <ibc@aliax.net> wrote:
> > Hi, any comment about this please? IMHO this topic is important. If
> > I'm wrong I would like to know it :)
>
> In many respects, this is a thread that should probably occur within
> the W3C and WHATWG lists, as how browsers handle credential collection
> is much more of an issue for them than the IETF..   Note that I think
> they are in final call on their APIs as well.
>
> It is true that the current version of the draft no longer denies the
> ability of a client to handle 401 responses, so that is perhaps all
> that we need.     However it might be that we should consider if we
> recommend support for BASIC and DIGEST.
>
> cheers
>
>
>
>
>
>
>
> >
> > 2011/6/20 Iñaki Baz Castillo <ibc@aliax.net>et>:
> >> Hi, I would like to start a new thread for this topic as it seems that
> >> the draft does not cover it at all (just suggests that an HTTP
> >> response code other than 101 should be threated as RFC 2616 states:
> >>
> >>
> >>  "1.  If the status code received from the server is not 101, the
> >>        client handles the response per HTTP procedures." (p. 30)
> >>
> >>
> >> The question is: should the browser prompt the human user for
> >> user/pass as when a 401 is received in the WS handshake attemp?
> >>
> >> Imagine this case:
> >>
> >> - www.domain.org => 1.1.1.1:80
> >>
> >> - ws.domain.org => 1.1.1.2:443
> >>
> >> - I open http://www.domain.org in my browser, fill some login form and
> >> retrieve websocket connection data, including an user and pass (for
> >> Digest).
> >>
> >> - My JavaScript is then provisioned (via JavaScript WebSocket API
> >> ????) with ws connection data: server ip, port, Digest user/passwd.
> >>
> >> - My web browser starts the ws connection with ws.domain.org:443. It
> >> receives 401 with Digest (so I need a nonce from the server before
> >> using my user/passwd).
> >>
> >> - JavaScript code automatically accepts the Digest chanllenge,
> >> generates a Digest response with the provided user/passwd and the
> >> retrieved Digest nonce, and re-send the HTTP GET request (all of this
> >> without prompting the user) with the Authorization header.
> >>
> >> - If the JavaScript code would not be proviosioned with user/pass,
> >> then upon receipt of the 401 it should prompt the user (like a
> >> JavaScript alert?).
> >>
> >>
> >>
> >> So, if all this stuff is not clearly specified (and I think passing
> >> user/pass to the JavaScript WebSocket connection API does not exist)
> >> then using HTTP Digest (or Basic) will be not useful or feasible, and
> >> I expect than using cookies and all that "pure just-web stuff" will be
> >> the only way. Please, take into account that a websocket server could
> >> run in a separate server, so using cookies mechanism is not so
> >> feasible (it could or not depending the case). Neither I think that
> >> cookies (a workaround to simulate
> >> sessions in HTTP protocol) are the best way to go.
> >>
> >> IMHO the draft should do much more effort in authentication process.
> >> Please don't let the door open to ugly and/or propietary
> >> authentication solutions.
> >>
> >>
> >> My proposal is that the JavaScript WebSocket API should include a
> >> method to pass authentication 'user' and 'password' (and optionally
> >> 'realm' so it would ignore the realm para in the 401 response when
> >> using Digest rather than Basic auth).
> >>
> >> In this way, I could open a webpage, perform usual login (maybe via a
> >> HTML form as commonly extended) and then retrieve WS connection data
> >> (WS URI), including user/pass/[realm].
> >> So my JavaScript client would open a WS connection with the given
> >> destination and in case of receiving a 401 it would re-send the HTTP
> >> GET request with the appropriate Authorization header without
> >> prompting the user.
> >>
> >> This wouldn't be the only authentication mechanism, of course, but
> >> IMHO it should be documented (and covered by the JS WebSocket API).
> >>
> >> Regards.
> >>
> >> --
> >> Iñaki Baz Castillo
> >> <ibc@aliax.net>
> >>
> >
> >
> >
> > --
> > Iñaki Baz Castillo
> > <ibc@aliax.net>
> > _______________________________________________
> > hybi mailing list
> > hybi@ietf.org
> > https://www.ietf.org/mailman/listinfo/hybi
> >
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>