sebschlue commented on issue #1950:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/1950#issuecomment-1747271779

   Thank you very much for your reply. 
   
   Unfortunately, this does not work for me.
   
   If I understand this correctly, then "jack1" is the name of the consumer 
object and "default" is the name of the namespace.
   
   I have now tried to get this working with a simple example of the standard 
kubernetes dashboard deployed in "kubernetes-dashboard" namespace:
   
   
   ```
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: kubernetes-dashboard
     namespace: kubernetes-dashboard
   spec:
     http:
     - authentication:
         enable: true
         type: basicAuth
       backends:
       - serviceName: kubernetes-dashboard
         servicePort: 443
       match:
         hosts:
         - XXX
         paths:
         - /*
       name: rule
       plugins:
       - name: redirect
         enable: true
         config:
           http_to_https: true
       - name: ip-restriction
         enable: true
         config:
           whitelist:
           - XXX
       - name: consumer-restriction
         enable: true
         config:
           whitelist:
           - kubernetes-dashboard_kubernetes-dashboard-basic-auth
   ---
   apiVersion: apisix.apache.org/v2
   kind: ApisixConsumer
   metadata:
     name: kubernetes-dashboard-basic-auth
     namespace: kubernetes-dashboard
   spec:
     authParameter:
       basicAuth:
         secretRef:
           name: kubernets-dashboard-basic-auth
   ---
   apiVersion: apisix.apache.org/v2
   kind: ApisixTls
   metadata:
     name: kubernetes-dashboard
     namespace: kubernetes-dashboard
   spec:
     hosts:
     - XXX
     secret:
       name: XXX
       namespace: ingress-apisix
   ---
   apiVersion: apisix.apache.org/v2
   kind: ApisixUpstream
   metadata:
     name: kubernetes-dashboard
     namespace: kubernetes-dashboard
   spec:
     scheme: https
   ``` 
   
   Basic Auth works, so if I disable consumer-restriction, everything is fine.
   
   But once I enable consumer-restriction, I get error message
   
   ```
   {"message":"The consumer_name is forbidden."}
   ```
   
   
   


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