Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 68904 invoked from network); 5 Aug 2010 17:12:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Aug 2010 17:12:30 -0000 Received: (qmail 75676 invoked by uid 500); 5 Aug 2010 17:12:29 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 75561 invoked by uid 500); 5 Aug 2010 17:12:28 -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 75553 invoked by uid 99); 5 Aug 2010 17:12:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 17:12:28 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.212.180] (HELO mail-px0-f180.google.com) (209.85.212.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 17:12:24 +0000 Received: by pxi3 with SMTP id 3so4032309pxi.11 for ; Thu, 05 Aug 2010 10:12:03 -0700 (PDT) Received: by 10.142.180.20 with SMTP id c20mr9022763wff.136.1281028323186; Thu, 05 Aug 2010 10:12:03 -0700 (PDT) Received: from [192.168.1.102] (c-98-248-172-14.hsd1.ca.comcast.net [98.248.172.14]) by mx.google.com with ESMTPS id q27sm395522wfc.6.2010.08.05.10.12.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 05 Aug 2010 10:12:02 -0700 (PDT) Sender: J Chris Anderson From: J Chris Anderson Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: multipart/alternative; boundary=Apple-Mail-27--74076299 Subject: Re: Issues while using couchdb http cookie auth Date: Thu, 5 Aug 2010 10:11:57 -0700 In-Reply-To: To: user@couchdb.apache.org References: Message-Id: X-Mailer: Apple Mail (2.1081) --Apple-Mail-27--74076299 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Aug 5, 2010, at 7:11 AM, Mahendra M wrote: > Hi, >=20 > I was trying to setup and use couchdb http cookie auth. I could > not find any "official" documentation for the same. A bit of searching = around > gave me these. >=20 > 1. http://pierrel.posterous.com/securing-couchdb (seems new) > 2. http://www.mail-archive.com/dev@couchdb.apache.org/msg02631.html = (2009) > 3. = http://www.jasondavies.com/blog/2009/05/27/secure-cookie-authentication-co= uchdb >=20 > My requirement is this. > * Have one db with user related docs. > * The key of the doc is the userid > * The sha1 hashed password for each user is stored in his doc. > * I want to issue cookies based on a userid and password posted to = couchdb. >=20 This is pretty much how the built-in auth works. Jan is working on a = document here: http://wiki.couchapp.org/page/authn-preview The other thing to do is just use the signup and login buttons on Futon = to do the same thing. Look in the lower right corner of = http://localhost:5984/_utils/ I have code here that also does signup and login (using the jquery = plugin that ships with couch) = http://github.com/couchapp/couchapp/blob/master/vendor/evently/account/doS= ignup.js > Originally, I was trying on writing my own show function to do an > auth. Then I saw > that couchdb itself has support for doing this. >=20 > The methods discussed in the above thread(s) are really good and I = wanted to > try it out. However, it is not working even after following both the = examples. >=20 > I keep getting an error > {"error":"unauthorized","reason":"Name or password is incorrect."} >=20 > The debug logs also don't give out much information. >=20 > Looks like I have not set up things properly and the above docs are a = bit > confusing. Also, could not find anything on the couchdb wiki. >=20 > So, I wanted to check if there is any other documentation on how to = make > use of http cookie auth. >=20 > Or has anyone tried and got it working ? >=20 > In link(1), it explains how to setup a single auth scheme for a = couchdb node and > making use of /_session to get a cookie. >=20 > In link(2), it looks like adding _login and _logout handlers to each > db. Does this > mean that each db can have it's own user/password sets ? Also, what = parameters > must be passed to _login ? Also, this says that the "users" view > values must have > a member "password" whereas the previous link asks for a member = "password_sha". >=20 > Which is the correct approach to follow ? or are both valid ? > I am a bit confused as of now :-) >=20 > Regards, > Mahendra >=20 > http://twitter.com/mahendra --Apple-Mail-27--74076299--