couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@apache.org>
Subject Re: auth & auth problems - non couch app
Date Sun, 09 Jan 2011 10:48:52 GMT
Hi, comments bellow

>
> created a user (hashed the password using a js sha 256)
> curl -X PUT http://admin:pass@localhost:5984/myuserdb/myuser -d
> '{"type":"user", "hashed_password":"dfdjfjsdfdj..."}'

The password field is named "password_sha" and not "hashed_password".
You must also add a "salt" field.
Also, it's SHA-1 that you should use and not SHA 256.
See the following helper function in jquery.couch.js for reference:

https://github.com/apache/couchdb/blob/trunk/share/www/script/jquery.couch.js#L25

regards,

>
> *** tried to do this but get error - invalid user or password
> curl -vX POST http://localhost:5984/myuserdb/_session -d
> 'username="myuser"&password="userpassword"'
>
>
>
>
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Mime
View raw message