ronnieroyston opened a new issue, #4661:
URL: https://github.com/apache/couchdb/issues/4661

   I have successfully implemented JWT auth. When I add this user as a server 
admin, I get `401 Unauthorized` response for any calls to `_admin`-only 
resources.
   
   ## Description
   **GET /_node/_local/_config/admins/ HTTP/1.1** (call made with Basic Auth 
"admin/admin")
   ```
   HTTP/1.1 200 OK
   {
     "**0428c67f-0c5d-4201-862f-71c1661f917f**": "random-never-used-password>",
     "admin": 
"-pbkdf2-e4e6f9060268ca9c044fcd80036ab0b2d956b470,cd30f1b9955e350318c478564ab04598,10"
   }
   ```
   
   ```
   **GET /test/_all_docs HTTP/1.1** (call made with JWT Auth to document with 
permissions allowing this user as DB admin)
   HTTP/1.1 200 OK
   {
     "total_rows": 1,
     "offset": 0,
     "rows": [
       {
         "id": "b7e07b751d8679044f4e49d166000031",
         "key": "b7e07b751d8679044f4e49d166000031",
         "value": {
           "rev": "1-6f32c3d0fc61e6d4b4ecf5fdcd0271ed"
         }
       }
     ]
   }
   
   COUCHDB LOGS
   2023-07-02 20:43:06 [notice] 2023-07-03T01:43:06.010151Z nonode@nohost 
<0.6915.0> 301e727470 localhost:5984 172.27.0.1 
0428c67f-0c5d-4201-862f-71c1661f917f GET /test/_all_docs 200 ok 70
   ```
   While
   ```
   **GET /_node/_local/_config/admins/ HTTP/1.1** (call made with JWT Auth sub 
= 0428c67f-0c5d-4201-862f-71c1661f917f to server admin only endpoint.)
   HTTP/1.1 401
   {
     "error": "unauthorized",
     "reason": "You are not a server admin."
   }
   
   COUCHDB LOGS 
   2023-07-02 20:47:11 [notice] 2023-07-03T01:47:11.907250Z nonode@nohost 
<0.6915.0> 4512ffabce localhost:5984 172.27.0.1 
0428c67f-0c5d-4201-862f-71c1661f917f GET /_node/_local/_config/admins/ 401 ok 2
   ```
   
   ## Expected Behaviour
   
   Once a server admin is added, the JWT `sub` matching the configured server 
admin username should be granted server admin access.
   
   ## Your Environment
   
   CouchDB on Docker
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to