inceptivetech commented on issue #604: {"error":"unauthorized","reason":"Name 
or password is incorrect."} even if access is granted to user
URL: https://github.com/apache/couchdb/issues/604#issuecomment-310275742
 
 
   Hi,
   Objective : is to create an user which will be in _users collection and then 
provide eventdb member access to the user.
   
   things I tried out 
   1. For adding user
   
   curl -X PUT http://admin:*****@localhost:5984/_users/org.couchdb.user:dan -H 
"Accept: application/json" -H "Content-Type: application/json" -d '{"name": 
"dan", "password": "apple", "roles": [], "type": "user"}'
   
   which results in below message 
   {"error":"not_found","reason":"Database does not exist."}
   
   I searched on google for this error and come to know that system collection 
like _users are moved to port 5986 hence I fired below api
   
   curl -X PUT http://admin:*****@localhost:5986/_users/org.couchdb.user:dan -H 
"Accept: application/json" -H "Content-Type: application/json" -d '{"name": 
"dan", "password": "apple", "roles": [], "type": "user"}'
   I was able to create an user. (please note port number 5986)
   
   2. Provide eventdb member access to dan
   
   I executed below command to provide an access
   curl -X PUT http://localhost:5984/eventdb/_security -u admin:***** -H 
"Content-Type: application/json" -d '{"admins": { "names": [], "roles": [] }, 
"members": { "names": ["dan"], "roles": [] } }'
   which returns below result for me
   
   {"ok":true}
   3. Accessing eventdb using dan's credential
   
   curl -u dan:apple http://localhost:5984/eventdb
   
   it results in
   {"error":"unauthorized","reason":"Name or password is incorrect."}
   
   I was following documentation at 
http://docs.couchdb.org/en/2.0.0/intro/security.html
   
   thanks for your help.
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to