incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Hewitt <mar...@thenoi.se>
Subject Re: Debugging 302/Unauthorized error
Date Thu, 23 Jun 2011 16:12:47 GMT
My by-hand tests appeared to be a problem with my own stupid hands - I was using saltpassword
instead of passwordsalt in the user record, which is my own silly fault.

I'm still not sure what's wrong with our automated system, but I think I should change to
the stable branch anyway, so I'll have to find a dark hour to do that and report back if I
keep hitting the same error.

Martin


On 23 Jun 2011, at 16:42, Robert Newson wrote:

> It's possible that this got broken on trunk recently though this is
> the first such report and I don't think it's changed since the 1.1
> release.
> 
> The precedence of response content-type changed between 1.0 and 1.1
> but that doesn't seem to be your problem.
> 
> With the information providing, I'd say you're genuinely passing the
> wrong username/password combination.
> 
> B.
> 
> On 23 June 2011 11:26, Martin Hewitt <martin@thenoi.se> wrote:
>> Hi all,
>> 
>> For a while now, we've had a build process that creates a website, creates Couch
databases, creates a user for that site, and then uses that new user to create the default
design docs for the newly-created databases.
>> 
>> In the last week or so, the create view action has been returning 302 errors and,
when I run the process by hand using cURL, I get the same error.
>> 
>> My process is:
>> 
>> 1. Create user through Futon (e.g. org.couchdb.user:testuser)
>> 2. Generate a password with a salt and hash it using PHP.
>> 3. Save the new user record.
>> 4. Create a new database (e.g. testuser_database)
>> 5. Using Futon, open the Security dialog and add in ["testuser"] and ["admin"] to
the Administrator fields.
>> 6. Save the security dialog.
>> 7. Attempt a PUT of a design doc:
>> 
>>> curl -i -X PUT -d "{\"one\":\"two\"}" http://testuser:testpassword@127.0.0.1:5984/testuser_database/_design/test/
>> 
>> 8. I get an error response:
>> HTTP/1.1 302 Moved Temporarily
>> Server: CouchDB/1.2.0a1075588 (Erlang OTP/R14B)
>> Location: http://127.0.0.1:5984/_utils/session.html?return=%2Fmartin_test%2F_design%2Ftest&reason=Name%20or%20password%20is%20incorrect.
>> Date: Thu, 23 Jun 2011 15:18:36 GMT
>> Content-Type: text/plain;charset=utf-8
>> Content-Length: 67
>> Cache-Control: must-revalidate
>> 
>> {"error":"unauthorized","reason":"Name or password is incorrect."}
>> 
>> Now, I *know* that neither the password nor the username is incorrect, and, up until
a week or so ago, this build process completed without issue. Raising the CouchDB log level
to debug gives no more useful information.
>> 
>> Couch version: {"couchdb":"Welcome","version":"1.2.0a1075588"}
>> 
>> I know a recent version of Couch was released (this was built from source a month
or two ago), but, this system is in production, so I'd rather not rebuild Couch if I can avoid
it.
>> 
>> Any help debugging this problem would be greatly appreciated.
>> 
>> Many thanks,
>> 
>> Martin


Mime
View raw message