Skip to main content
A Kubernetes pod can get a service account token with a custom audience as a projected volume. Dodo Payments trusts this token through a kubernetes provider. Use this type for Amazon EKS also. Do not use the aws type for EKS.

Provider Settings

Dodo Payments must be able to get the discovery document and the JWKS of the issuer over HTTPS. The EKS OIDC issuer is public. For a cluster with a private issuer, use a custom provider with uploaded keys. Refer to Custom OIDC. To find the issuer of an EKS cluster, run:

Required Claims

The mapping must pin sub to one service account:
Conditions read top-level claims only. The namespace and the pod are in the kubernetes.io object, thus pin them through sub.
Add the egress IPs of the cluster, for example the NAT gateway IPs, to the allowed_cidrs of the mapping. A stolen token file then cannot do an exchange from another network.

Pod Configuration

Mount a projected service account token with the Dodo Payments audience, and point DODO_PAYMENTS_IDENTITY_TOKEN_FILE to it:
The kubelet writes a new token when the token is older than 80% of its life. With expirationSeconds: 3600, this occurs after about 48 minutes. The SDK reads the file again for each exchange.

SDK Usage

The kubernetes() helper reads /var/run/secrets/tokens/dodo-token. To use a different path, give the path to the helper. Refer to SDK Usage for the other languages.
Last modified on October 28, 2026