It is impossible to add documents to the database with the user - "You are not the server administrator",

I am having problems with users being created who can actually send something to the database to which I have listed them. I followed the steps here ( Creating Ordinary Users in CouchDB ) and looked through countless documentation pages, trying to figure it out. (Example: http://wiki.apache.org/couchdb/Security_Features_Overview ).

I am using v1.5 and trying to set the user "testAdmin" as the administrator for the "test" database. superadmin is my admin account created via futon interface.

If I check the security document, I can see my permissions there, which should allow the user testAdmin to access the database:

curl -X GET http://superadmin:1234@localhost:5984/test/_security

Answer:

   { 
      "admins": 
         { "names":["testAdmin"],
           "roles":[]
         },
      "readers":
         { "names":["testUser"],
           "roles":[]
         }
    }

Then, if I run this, I get: "You are not a server administrator."

curl -X PUT http://testAdmin:5678@localhost:5984/test/ -d '{"abc": "def"}'

Answer:

{"error":"unauthorized","reason":"You are not a server admin."}

I tried to switch the user to a reader, I also tried to use another user that I created, which is currently listed as a reader, and I constantly encounter the same error.

Change: . I can log into Futon with the users that I created, just fine, and their permissions seem to work fine inside Futon, but I still can't use curl successfully.

+4
source share
4 answers

. , POST.

+4

curl -u USER:PASS -X PUT "http://host:port/db_target" -d '{...}'

, .

+1

@Kxepal . , , .

superadmin, couchdb . / , , ..

, , . , _security, , , couchdb, dbadmin , dbreader member . futon admin members

.

. , .

. .

, @Kxepal, . . , superadmin.

0

, Fauxton "" , , , , , .

, , .

0

Source: https://habr.com/ru/post/1534605/


All Articles