Kong / kong

🦍 The Cloud-Native API Gateway and AI Gateway.
https://konghq.com/install/#kong-community
Apache License 2.0
39.05k stars 4.79k forks source link

How a Kong Basic Auth Plugin can be restricted to set of consumers? #13371

Closed sasahoo-tibco closed 3 months ago

sasahoo-tibco commented 3 months ago

Discussed in https://github.com/Kong/kong/discussions/13367

Originally posted by **sasahoo-tibco** July 12, 2024 I have set up the basic auth Kong Plugin and created a Consumer using a Kubernetes secret. This configuration works for all consumers using that secret. I have an ingress that uses this plugin. However, I want the Kong Plugin to work only with a specific set of consumers, not all. Specifically, I would like to know if the Kong Plugin can be configured to work with a single consumer. For example: Ingress 'A' uses Kong Basic Auth Plugin 'Ka' and should work only with Consumer 'A'. Ingress 'B' uses Kong Basic Auth Plugin 'Kb' and should work only with Consumer 'B'. Ingress 'A' should not authenticate Consumer 'B', and Ingress 'B' should not authenticate Consumer 'A'. Is there a solution for this scenario?
hanshuebner commented 3 months ago

Have a look here: https://discuss.konghq.com/t/limit-routes-to-specific-consumers/9774

Does this answer your question?