Bishnup1995 commented on issue #9893:
URL: https://github.com/apache/apisix/issues/9893#issuecomment-1993904005

   Hey @shreemaan-abhishek  thank you for your response. Please find a 
reproducible config below:
   
   1.  Create a consumer group:
   ```
   curl http://localhost:9180/apisix/admin/consumer_groups/test_users -H 
'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "plugins": {}
   }'
   ```
   2. Create 1st consumer
   ```
   curl http://localhost:9180/apisix/admin/consumers -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "username": "foo1",
        "group_id": "test_users",
       "plugins": {
           "basic-auth": {
               "username": "foo1",
               "password": "bar1"
           }
       }
   }'
   ```
   3. Create 2nd consumer
   ```
   curl http://localhost:9180/apisix/admin/consumers -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "username": "foo2",
        "group_id": "test_users",
       "plugins": {
           "jwt-auth": {
                   "secret": 
"dz-e6*6-fo*c4zh^mjihqcw2)#zea@z&_asdd06#-^2utxxc*b",
                   "key": "foo2",
                   "exp": 86400
               }
       }
   }'
   ```
   4. Create Route
   ```
   curl http://localhost:9180/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["GET"],
       "uri": "/api/*",
       "plugins": {
           "multi-auth":{
            "auth_plugins":[
               {
                  "basic-auth":{ }
               },
               {
                 "jwt-auth": {}
               }
            ]
         },
          "proxy-rewrite": {
               "regex_uri": ["^/api/(.*)", "/$1"]
           },
          "consumer-restriction": {
                   "whitelist": ["test_users"],
                   "type": "consumer_group_id",
                   "rejected_msg": "Access Dinied",
                   "rejected_code": 403,
                   "_meta": {
                       "disable": false
                   }
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "localhost:9180": 1
           }
       }
   }'
   ```
   5. Access the route
   `curl localhost:9080/api/apisix/admin/consumers -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1'  -H 'Authorization: 
eyJhbGciOiJIUzI1NiJ9.eyJrZXkiOiJmb28yIiwic3ViIjoidGVzdCIsImp0aSI6IjU1NWM4NGI3LTc1ODEtNDZiYS04NDJmLTJhZTU0MGQzM2MwZCIsImlzcyI6InRlc3QiLCJpYXQiOjE3MTAzMjE1MjUsImV4cCI6MTcxMDM4MTUyNX0.D6c9pGwnjdEo-Js1Nrrmr0bJ-ZL2NWKFQp2aea0zDUg'`
   
   **Note:** When I execute the below query it **works**
   `curl localhost:9080/api/apisix/admin/consumers -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1'  -i -ufoo1:bar1`


-- 
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