Re: [hybi] Supporting OAUTH-like authentication?

Philipp Serafin <phil127@gmail.com> Fri, 29 July 2011 01:01 UTC

Return-Path: <phil127@gmail.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 248035E8007 for <hybi@ietfa.amsl.com>; Thu, 28 Jul 2011 18:01:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.599
X-Spam-Level:
X-Spam-Status: No, score=-3.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
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 gZeOgOunmD8t for <hybi@ietfa.amsl.com>; Thu, 28 Jul 2011 18:01:02 -0700 (PDT)
Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by ietfa.amsl.com (Postfix) with ESMTP id 4662E5E8001 for <hybi@ietf.org>; Thu, 28 Jul 2011 18:01:02 -0700 (PDT)
Received: by fxe6 with SMTP id 6so1997307fxe.31 for <hybi@ietf.org>; Thu, 28 Jul 2011 18:01:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=uauL/wPIfwAzfViagQrri5zDx+8HS8YslWmxZetFhKc=; b=X4c3rfMiPQ6TcyLVMT3HxGXuOht1JuLZJqaUwx2t5ldMhbtO9XgbI9DZv8uaTA9qGS SDxu8A50IZBHo2m27IMOfLmhz5NrjV5CSqdkAe1hsmFpsDMO/YBI590Urh8DJBeMcTOv idMpNzIc6taFI4CeZP8rQ1/lcb1MyUdTbfPcE=
Received: by 10.204.141.71 with SMTP id l7mr190195bku.178.1311901261295; Thu, 28 Jul 2011 18:01:01 -0700 (PDT)
Received: from [212.201.71.198] (pptp-212-201-71-198.pptp.stw-bonn.de [212.201.71.198]) by mx.google.com with ESMTPS id h7sm419985bkd.45.2011.07.28.18.00.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jul 2011 18:01:00 -0700 (PDT)
Message-ID: <4E320640.2080408@gmail.com>
Date: Fri, 29 Jul 2011 03:00:48 +0200
From: Philipp Serafin <phil127@gmail.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0
MIME-Version: 1.0
To: Greg Wilkins <gregw@intalio.com>
References: <CAH_y2NHZuYTbpMnrHU65JtZzRE-pbiXnRRh=rOTknTbc_+8gow@mail.gmail.com>
In-Reply-To: <CAH_y2NHZuYTbpMnrHU65JtZzRE-pbiXnRRh=rOTknTbc_+8gow@mail.gmail.com>
X-Enigmail-Version: 1.2
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Supporting OAUTH-like authentication?
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
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: Fri, 29 Jul 2011 01:01:03 -0000

Wouldn't it be better to move the token exchange into the actual WS
connection where we have efficient two-way communication available?

1.: Client connects to server using subprotocol "foo", which is known to
use OAuth as authentication (or e.g. "foo+oauth", if this should be
decided on per-connection basis)
2.: Client and server perform successful WS handshake
3.: Server sends token and authority URL in a WS message.
4.: Client gets token authorized
5.: Client sends authorized token back in a WS message.
6.: Server confirms that authorisation was successful.
7.: Client and server exchange messages as specified by "foo".

Am 29.07.2011 02:44, schrieb Greg Wilkins:
> All,
>
> Currently the protocol allows arbitrary headers, so in theory an
> authentication mechanism like OAUTH could be implemented by exchanging
> tokens in the headers of the handshake.    But the js API does not
> allow an application to set or see HTTP header from the handshake (nor
> should it), so that is not available as a general mechanism for token
> passing auth like OAUTH.
>
> So what other options do we have to pass tokens in the handshake?
>
> Cookies - this is possible, but kind of defeats the purpose of  token
> passing auth if tokens are to be sent/set in a way that facilitates
> wider access to them.
>
> Extensions - we could say that an OAUTH extensions is required to
> manipulate the headers of the handshake with OAUTH tokens, but I
> expect that there will be a very high barrier for an extension to be
> included in browsers, so I think that is probably a non starter (at
> least until a defacto-standard auth mechanism emerges).
>
> Subprotocol/CloseEvents - Subprotocol is a user controlled field sent
> by the handshake and closeEvents contain a reason string that could
> originate from the server application/framework.     Thus I would not
> be surprised to see these fields used (misused?) to send challenges
> and pass tokens eg.
>
>  1. Client connects to server with oauth subprotocol.
>  2. Server accepts connection but immediately closes with a reason
> string containing a token and/or authority URL. ( might be able to be
> done with a 403 HTTP response if the HTTP reason string is passed to
> the onerror call back ?? ]
>  3. Client gets the token signed by an/the authority
>  4. Client connections to server with oauth;token=value subprotocol
>  5. Server validates authorisation of token and accepts connection.
>
> [ forgive me if that is not exactly how oauth works or correct
> terminology ... but it is something like that ]
>
> Is this a good usage of the subprotocol field/reason fields?
>
> Is there a better way to integrate such authentication into the handshake?
>
>
> cheers
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi