Directories

Related Documentation
Minimum Version
Kong Gateway - 3.15
Incompatible with
on-prem

Kong Identity uses principals and directories to unify how Kong products represent the entities they authenticate.

  • Principal: Represents an external client, workload, or human authenticating to a Kong Gateway (not a Konnect user or Dev Portal developer).
  • Directory: Regional collection of principals. Each Konnect organization can provision up to one directory per region by default.

Principals work with:

  • Kong Gateway in Konnect: Principals can authenticate an entity for API traffic (using API keys or basic auth usernames and passwords), or can provide metadata about an entity already authenticated through another mechanism (for example, OAuth).
  • Event Gateway: Principals can provide metadata about an entity already authenticated through another mechanism (for example, SASL/SCRAM or SASL/OAUTHBEARER).
  • Dev Portal: Principals can adjust API gateway behavior based on the authenticating Dev Portal.

A directory is the organizational boundary for grouping principals and managing their identities. Directories are region-specific, and each directory controls which control planes can make authentication requests to it.

Control plane access

You can either:

  • List the control planes that can authenticate against the directory in allowed_control_planes. You can specify a maximum of 32 control planes.
  • Set allow_all_control_planes to true to allow every control plane in your organization to make authentication requests. This overrides the allowed_control_planes list.

Lookup caching

Kong Identity caches principals on the data plane so that repeated lookups don’t require a connection to Konnect. You can tune the following settings on a directory:

Setting

Description

ttl_secs How long a gateway caches a principal after it authenticates successfully from this directory. Defaults to 600 seconds (10 minutes). Minimum is 300 seconds, maximum is 86400 seconds (24 hours).
negative_ttl_secs How long a gateway waits before it looks up a principal again when the principal doesn’t exist in the directory or the credentials are invalid. Defaults to 600 seconds (10 minutes). Minimum is 300 seconds, maximum is 86400 seconds (24 hours).

For Kong Gateway, the effective cache lifetime is the smallest of the directory TTL, the TTL set on a credential, and the db_cache_ttl configured on the gateway.

Create a directory

Directory limitations

The following are default limits for directories:

  • 1 directory per region. Contact Kong Support if you need more than one directory.
  • 100,000 principals per directory. Contact Kong Support if you need higher limits.
  • Limit of 100 authentication or principal lookup requests per second per directory, not counting cached requests
  • Maximum of 32 allowed control planes per directory

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!