CouchDB does not "create" new users

I recently installed CouchDB on my CentOS box ('yum install couchdb'). I created an administrator account and then decided to create my first non-administrator user. I issue a command.

curl -X PUT http://admin:abc123@localhost:5984/_users/org.couchdb.user:brad \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d '{"name": "brad", "password": "asdf", "roles": [], "type": "user"}'

      

The answer looks good.

{"ok":true,"id":"org.couchdb.user:brad","rev":"3-078014aabce23da851ef243f92a7fc5c"}

      

Now, to check if the user data was created correctly, I am getting new user data.

 curl -X GET http://admin:abc123@localhost:5984/_users/org.couchdb.user:brad/

      

.. and I get the following answer, which seems to be missing some things.

{"_id":"org.couchdb.user:brad","_rev":"3-078014aabce23da851ef243f92a7fc5c","name":"brad","password":"asdf","roles":[],"type":"user"}

      

... from everything I've read, there should be additional fields .. "password_scheme", "iterations", "derivative" and "salt". Also, I created a database in Futon and set "brad" as the reader for that database, but when I try to access the DB as brad from the CLI, I get an error.

curl -X GET http://brad:asdf@localhost:5984/test_db

{"error":"unauthorized","reason":"Name or password is incorrect."}

      

Does anyone know why CouchDB is not handling the new user correctly?

+3


source to share


1 answer


It looks like your CouchDB is outdated; the new authentication stuff is in version 1.3.0+. You might be in luck with build-couchdb: https://github.com/jhs/build-couchdb



+4


source







All Articles