Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 69666 invoked from network); 22 Mar 2010 22:11:32 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Mar 2010 22:11:32 -0000 Received: (qmail 9925 invoked by uid 500); 22 Mar 2010 22:11:31 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 9892 invoked by uid 500); 22 Mar 2010 22:11:31 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 9884 invoked by uid 99); 22 Mar 2010 22:11:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2010 22:11:31 +0000 X-ASF-Spam-Status: No, hits=-0.2 required=10.0 tests=AWL,KHOP_SC_TOP_CIDR8,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [217.114.68.227] (HELO mail.nadir.org) (217.114.68.227) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2010 22:11:25 +0000 Received: (qmail 5060 invoked by uid 89); 22 Mar 2010 22:11:03 -0000 Received: from unknown (HELO ?192.168.1.100?) (lena@zeromail.org@95.88.81.35) by 0 with ESMTPA; 22 Mar 2010 22:11:03 -0000 Message-ID: <4BA7EAF6.6070602@zeromail.org> Date: Mon, 22 Mar 2010 23:11:02 +0100 From: Lena Herrmann User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: dev@couchdb.apache.org Subject: Re: Error when trying to create a session References: <4BA10322.9010306@zeromail.org> <9D39DCD4-8799-430B-938A-3D5CAE5AEA99@gmail.com> <4BA12A3B.90707@zeromail.org> <4BA7E491.2060302@zeromail.org> <210860A6-3797-4887-A9E7-5E34282BEEA6@gmail.com> In-Reply-To: <210860A6-3797-4887-A9E7-5E34282BEEA6@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Am 22.03.10 22:57, schrieb J Chris Anderson: > > On Mar 22, 2010, at 2:43 PM, Lena Herrmann wrote: > >> Hi, >> >> I still have the same problem. Now I ran out of things to try. >> >> Here is the code: http://gist.github.com/340562 >> > > Looking at this I'm seeing that roles needs to be an array. > > Can you show the output of prepareUserDoc()? var userDoc = CouchDB.prepareUserDoc({name: "gaius", roles: "president"}, "secretpass"); console.log(JSON.stringify(userDoc)) => {"name":"gaius","roles":"president","_id":"org.couchdb.user:gaius","salt":"959de325fdcffa2c5a7fad920b7eac5a","password_sha":"b6bedfb721bd4c786910319944faba0bc18a2f35","type":"user"} With roles as Array: var userDoc = CouchDB.prepareUserDoc({name: "gaius", roles: ["president"]}, "secretpass"); console.log(JSON.stringify(userDoc)) => {"name":"gaius","roles":["president"],"_id":"org.couchdb.user:gaius","salt":"959de325fdcffa2c5a7fad920b851c76","password_sha":"b299e011c82ea8e0ad4c6ccf0b3d26eb35ddec37","type":"user"} When I just set no roles: var userDoc = CouchDB.prepareUserDoc({name: "gaius"}, "secretpass"); console.log(JSON.stringify(userDoc)) => {"name":"gaius","_id":"org.couchdb.user:gaius","salt":"959de325fdcffa2c5a7fad920b81e54c","password_sha":"ba688eabc11ad9518255ac771aabbda6ab268364","type":"user","roles":[]} Same error in each case. Lena > > Maybe something is going wrong with eg hex_sha1 or newUuids() > > Chris > >> When trying to login, I still get a 404 with reason "Name or password is incorrect." >> >> Can someone try if this runs on their machine? Or am I missing something very stupid? >> >> Lena >> >> >> >> >> Am 17.03.10 20:15, schrieb Lena Herrmann: >>> Am 17.03.10 18:39, schrieb J Chris Anderson: >>>> >>>> On Mar 17, 2010, at 9:28 AM, Lena Herrmann wrote: >>>> >>>>> Hi, >>>>> >>>>> my code: >>>>> >>>>> var userDoc = CouchDB.prepareUserDoc({ >>>>> name: "Gaius Baltar" >>>>> }, "secret"); >>>>> db.save(userDoc); >>>>> CouchDB.login("Gaius Baltar", "secret"); >>>>> >>>>> Why does the last line get me a 401 Unauthorized? >>>>> >>>>> According to the cookie_auth.js test, it should work like this. Am I >>>>> missing something? >>>> >>>> Does it help to call _ensure_full_commit after the userDoc is saved? >>>> >>> >>> Tried it, no it doesn't ... >>> >>> Lena >>> >>> >>> >>> >>> >> > > >