I'm having issues with the users I've created being able to actually submit anything into the DB I've listed them under. I've followed the steps listed here (Creating regular users in CouchDB) and reviewed countless pages of documentation trying to sort this out. (Ex: http://wiki.apache.org/couchdb/Security_Features_Overview).
I'm using v1.5 and trying to set the user "testAdmin" as the admin for the "test" DB. superadmin, in this is my admin account created through the futon interface.
If I check the security document I can see my permissions there that should allow the testAdmin user to access the DB:
curl -X GET http://superadmin:1234@localhost:5984/test/_security
response:
{
"admins":
{ "names":["testAdmin"],
"roles":[]
},
"readers":
{ "names":["testUser"],
"roles":[]
}
}
Then if I run this, I get "You are not a server admin."
curl -X PUT http://testAdmin:5678@localhost:5984/test/ -d '{"abc": "def"}'
response:
{"error":"unauthorized","reason":"You are not a server admin."}
I've tried switching the user to a reader, I've also tried using the other user I've created that's currently listed as reader, and I keep encountering the same error.
Edit: I'm able to log in to Futon with the users I've created just fine, and their permissions all appear to be working fine within Futon, but I'm still unable to use curl successfully.
You're trying to create a database instead of creating a document. If you want to create document without predefined ID - use POST request instead.
Using
curl
curl -u USER:PASS -X PUT "http://host:port/db_target" -d '{...}'
This may have been the resolution to the initial question.
It's worth adding that Fauxton often "forgets" its authentication if you leave it open and doesn't realize it, failing in odd ways until you reload the page and it realizes you need to log in again.
Short story shorter I was having a similar problem and just needed to re-authenticate to resolve it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With