dharders commented on issue #741: error "Unauthorized" (401) when loading 
"_security"-doc
URL: https://github.com/apache/couchdb/issues/741#issuecomment-321710834
 
 
   @wohali Yes your suspicions were correct. It does seem that it is a fauxton 
bug, as the issue isn't present if I curl from a fresh install BEFORE using 
fauxton permissions screen
   
   ```
   curl -u "admin:admin" http://127.0.0.1:5984/newuser/_security -v
   * Hostname was NOT found in DNS cache
   *   Trying 127.0.0.1...
   * Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0)
   * Server auth using Basic with user 'admin'
   > GET /newuser/_security HTTP/1.1
   > Authorization: Basic YWRtaW46YWRtaW4=
   > User-Agent: curl/7.38.0
   > Host: 127.0.0.1:5984
   > Accept: */*
   >
   < HTTP/1.1 200 OK
   < X-CouchDB-Body-Time: 0
   < X-Couch-Request-ID: 31b36ae0fe
   * Server CouchDB/2.1.0 (Erlang OTP/18) is not blacklisted
   < Server: CouchDB/2.1.0 (Erlang OTP/18)
   < Date: Fri, 11 Aug 2017 00:41:18 GMT
   < Content-Type: application/json
   < Content-Length: 86
   < Cache-Control: must-revalidate
   <
   
{"admins":{"names":[],"roles":[]},"members":{"names":["admin","newuser"],"roles":[]}}
   * Connection #0 to host 127.0.0.1 left intact
   ```
   
   After visiting permissions screen (and seeing no present members) and adding 
'admin' and 'newuser' to members then running the same curl command
   ```
   curl -u "admin:admin" http://127.0.0.1:5984/newuser/_security -v
   * Hostname was NOT found in DNS cache
   *   Trying 127.0.0.1...
   * Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0)
   * Server auth using Basic with user 'admin'
   > GET /newuser/_security HTTP/1.1
   > Authorization: Basic YWRtaW46YWRtaW4=
   > User-Agent: curl/7.38.0
   > Host: 127.0.0.1:5984
   > Accept: */*
   >
   < HTTP/1.1 200 OK
   < X-CouchDB-Body-Time: 0
   < X-Couch-Request-ID: 4460928ace
   * Server CouchDB/2.1.0 (Erlang OTP/18) is not blacklisted
   < Server: CouchDB/2.1.0 (Erlang OTP/18)
   < Date: Fri, 11 Aug 2017 00:45:44 GMT
   < Content-Type: application/json
   < Content-Length: 101
   < Cache-Control: must-revalidate
   <
   {"error":"unauthorized","reason":"Authentication 
required.","members":{"names":["admin","newuser"]}}
   * Connection #0 to host 127.0.0.1 left intact
   ```
   
   Definitely a fauxton bug. It's adding the error message to the _security 
document, which is a weird thing to do.
   
   So in summary, need to:
   
   - Don't write error message in a 200 OK db/_security document GET
   - Send auth Header data in Fauxton db/_security fetch on permissions page so 
can display members
 
----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to