WGLC p7: Parsing auth challenges

Ben Niven-Jenkins <ben@niven-jenkins.co.uk> Mon, 29 April 2013 18:56 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7E04C21F9AA9 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 29 Apr 2013 11:56:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.599
X-Spam-Level:
X-Spam-Status: No, score=-10.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EkO888k3dPUu for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 29 Apr 2013 11:56:51 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 96B6B21F9AA7 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 29 Apr 2013 11:56:30 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UWtFC-0005nb-Fy for ietf-http-wg-dist@listhub.w3.org; Mon, 29 Apr 2013 18:56:10 +0000
Resent-Date: Mon, 29 Apr 2013 18:56:10 +0000
Resent-Message-Id: <E1UWtFC-0005nb-Fy@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <ben@niven-jenkins.co.uk>) id 1UWtF2-0005ms-DB for ietf-http-wg@listhub.w3.org; Mon, 29 Apr 2013 18:56:00 +0000
Received: from mailex.mailcore.me ([94.136.40.61]) by lisa.w3.org with esmtp (Exim 4.72) (envelope-from <ben@niven-jenkins.co.uk>) id 1UWtF1-0006wR-Rz for ietf-http-wg@w3.org; Mon, 29 Apr 2013 18:56:00 +0000
Received: from [81.134.152.4] (helo=xxx.corp.velocix.com) by mail4.atlas.pipex.net with esmtpa (Exim 4.71) (envelope-from <ben@niven-jenkins.co.uk>) id 1UWtEg-0005Xf-Pr for ietf-http-wg@w3.org; Mon, 29 Apr 2013 19:55:39 +0100
From: Ben Niven-Jenkins <ben@niven-jenkins.co.uk>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Date: Mon, 29 Apr 2013 19:55:38 +0100
Message-Id: <8F6FB0A1-4D7E-4847-92A7-14B240FAC23A@niven-jenkins.co.uk>
To: HTTP Working Group <ietf-http-wg@w3.org>
Mime-Version: 1.0 (Apple Message framework v1085)
X-Mailer: Apple Mail (2.1085)
X-Mailcore-Auth: 9600544
X-Mailcore-Domain: 172912
Received-SPF: none client-ip=94.136.40.61; envelope-from=ben@niven-jenkins.co.uk; helo=mailex.mailcore.me
X-W3C-Hub-Spam-Status: No, score=-3.1
X-W3C-Hub-Spam-Report: AWL=-1.250, BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001
X-W3C-Scan-Sig: lisa.w3.org 1UWtF1-0006wR-Rz 1a44cc84155d1fe14f57154b75ce5ffa
X-Original-To: ietf-http-wg@w3.org
Subject: WGLC p7: Parsing auth challenges
Archived-At: <http://www.w3.org/mid/8F6FB0A1-4D7E-4847-92A7-14B240FAC23A@niven-jenkins.co.uk>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/17671
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Hi,

In sections 2.1 & 4.4 (and by reference 4.2) of p7 User Agents are guided to take "special care" when parsing WWW-Authenticate and/or Proxy-Authenticate header field values, but it is never plainly stated what that means.

From the grammar, it looks as if the critical distinction is that (ignoring any allowed whitespace for brevity):

A sequence "," token "=" means we are now receiving a parameter to an existing challenge. This is guaranteed because the "=" and value are non-optional components of auth-param. (The grammar would be unresolvably ambiguous otherwise.)

A sequence "," token and anything other than "=" means we are now receiving the start of a new challenge. This is guaranteed because token68 may not contain "," and token (for a following auth-param) may not be empty. (The grammar would be unresolvably ambiguous otherwise.)

(And if we don't get something, after whitespace elimination, which is either the end of the header field value or a token after the ",", then the value is invalid and should be rejected.)

If that interpretation is correct, it would be helpful to state this clearly, rather than merely infer it. (And if that interpretation is not correct, clearly relying on inference alone is unreliable!)

There is perhaps still the question of whether in the face of multiple WWW/Proxy-Authenticate headers, the implied "," separating their values according to #rule is still allowed to operate at both levels of the grammar, or only at the outermost (#challenge) level.

Thanks
Ben