Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B849D8E4B for ; Tue, 16 Aug 2011 19:33:26 +0000 (UTC) Received: (qmail 68288 invoked by uid 500); 16 Aug 2011 19:33:24 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 68194 invoked by uid 500); 16 Aug 2011 19:33:24 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 68186 invoked by uid 99); 16 Aug 2011 19:33:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2011 19:33:23 +0000 X-ASF-Spam-Status: No, hits=2.4 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SINGLE_HEADER_2K,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of marcello.nuccio@gmail.com designates 209.85.218.52 as permitted sender) Received: from [209.85.218.52] (HELO mail-yi0-f52.google.com) (209.85.218.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2011 19:33:17 +0000 Received: by yie13 with SMTP id 13so299771yie.11 for ; Tue, 16 Aug 2011 12:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=ISVOjKQdWwczMpBO0Bnmci7EiDLJdy1VVNMR0Xl0uMY=; b=s8Kq8t9UBLOqIMm1QoiSMGnCC443IZ5boq3qye0kDiU8lKpWoYOSqHChnzu04LiTcP OObPFFoM7LcMIDV3QVhyU2go/Tx16elLV1iKVxqtISBAZJoGnN3uHEiFezowIm5UEcH4 GVpFPEAQ2pgpfef9aekHlqBuZ/KmOVqCu/B9w= MIME-Version: 1.0 Received: by 10.43.46.193 with SMTP id up1mr73683icb.352.1313523175702; Tue, 16 Aug 2011 12:32:55 -0700 (PDT) Received: by 10.42.245.1 with HTTP; Tue, 16 Aug 2011 12:32:55 -0700 (PDT) In-Reply-To: References: <4E371B93.8060303@kearns.net.au> Date: Tue, 16 Aug 2011 21:32:55 +0200 Message-ID: Subject: Re: to CouchApp or not to CouchApp From: Marcello Nuccio To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 2011/8/16 Jens Alfke : > > On Aug 16, 2011, at 9:52 AM, Marcello Nuccio wrote: > > But, by default, CouchDB does not send the WWW-Authenticate header, > and no one has asked to change this default. > > Actually I do think that should be changed, I just hadn=E2=80=99t asked f= or it. I lost a couple of hours trying to figure out why I couldn=E2=80=99t= get auth to work on my server, until someone told me I had to edit the con= fig file to get correct behavior. +1 I thought this default was there for a good reason, but if there's no problem to change it, then follow the standard. > On Aug 16, 2011, at 10:41 AM, Robert Newson wrote: > > You said 'what is not standard' and I told you. Not sending the header > for a 401 is response is not standard (the standard says we MUST send > it). > > We cannot follow the standard here, we are going to have to find some > compromise heuristic. > > IMHO the best behavior is: > > - CouchDB intrinsically returns a 401, with the required WWW-Authenticate= header. That is the correct HTTP behavior when the client is trying to acc= ess a read-protected resource without being authenticated. +1 > - There would be some way for a CouchApp to intercept and override this r= esponse, so that it can instead return a custom response such as a 302 redi= rect to its own login page. +1 The only problem I see is: How does it know (the couchapp) what to do? May be that this simply shifts the problem from the server to the couchapp... the problem of the heuristic to use is still here... > Returning a 302 rather than a 401 is prioritizing the app-server usage of= CouchDB over the REST/database server usage, and I think that=E2=80=99s ba= ckwards. I agree with prior messages in this thread that CouchApps are nift= y but limited, and we shouldn=E2=80=99t be breaking regular HTTP behavior i= n the server just so that CouchApps can show fancy login pages. ok. Marcello