A Consumer is an entity that identifies an external client that consumes or uses the APIs managed by Kong Gateway. Consumers can represent applications, services, or users who interact with your APIs. Since they are not always human, Kong Gateway calls them Consumers, because they “consume” the service. Kong Gateway allows you to define and manage Consumers, apply access control policies, and monitor their API usage.
Consumers are essential for controlling access to your APIs, tracking usage, and ensuring security. They are identified by key authentication, OAuth, or other authentication and authorization mechanisms. For example, adding a Basic Auth plugin to a Gateway Service or Route allows it to identify a Consumer, or block access if credentials are invalid.
By attaching a plugin directly to a Consumer, you can manage specific controls at the Consumer level, such as rate limits.
flowchart LR
Consumer(Consumer
entity)
Service(Gateway
Service)
Auth(Auth
plugin)
Upstream[Service
application]
RL["Rate Limiting
plugin"]
Client --pass
credentials--> Service
subgraph id1 ["`**KONG GATEWAY**`"]
subgraph padding[ ]
subgraph Authenticate ["Consumer Identity Added"]
direction LR
Service --> Auth
Auth--identify
Consumer-->Consumer
end
end
Consumer--> RL
end
RL --apply
per-Consumer
rate limiting--> Upstream
style Authenticate stroke-dasharray: 5 5
style padding stroke:none!important,fill:none!important