Product
Platform/Access controls/Other
Describe the bug
A Machine Identity with JWT Auth and an Audiences bound claim returns a
500 when the presented token's aud is a JSON array rather than a scalar string —
even when the configured audience is a member of that array:
POST /api/v1/auth/jwt-auth/login
HTTP 500 { "statusCode": 500, "error": "Internal Server Error", "message": "Something went wrong" }
Removing the Audiences constraint lets the same token authenticate (200), which
isolates the failure to the audience comparison. Array-valued aud is spec-legal
(RFC 7519 §4.1.3) and is the guaranteed shape of every Kubernetes ServiceAccount
token, so this blocks any Kubernetes workload using JWT Auth.
To Reproduce
- Create a Machine Identity with JWT Auth / JWKS, setting Audiences to
infisical and Subject to system:serviceaccount:<ns>:<sa>.
- Mint a token whose
aud array contains that audience:
kubectl create token <sa> -n <ns> --audience infisical --duration 1h
→ payload contains "aud": ["infisical"].
- Attempt login:
curl -sS -X POST https://eu.infisical.com/api/v1/auth/jwt-auth/login \
-H 'Content-Type: application/json' \
-d '{"identityId":"<id>","jwt":"<token>"}'
→ HTTP 500 "Something went wrong".
Removing the Audiences constraint and retrying the same token → 200.
Expected behavior
The audience check should treat aud as a set: accept when the configured audience
is a member, return 401 when it isn't. It should never throw a 500 on a
spec-legal claim shape, regardless of comparison semantics.
Screenshots
No response
Deployment Type
Infisical Cloud
Additional context
Environment
- Infisical Cloud, EU region (
eu.infisical.com), observed 2026-07-28
- Machine Identity → JWT Auth, JWKS configuration
- Token issuer: Kubernetes ServiceAccount OIDC issuer (RS256), JWKS served publicly
- Reproduced server-side with
curl; originally hit via External Secrets Operator
Specification references
Request ID
Workaround
Drop the Audiences constraint and rely on Issuer + Subject bound claims (loses
audience scoping).
Product
Platform/Access controls/Other
Describe the bug
A Machine Identity with JWT Auth and an Audiences bound claim returns a
500 when the presented token's
audis a JSON array rather than a scalar string —even when the configured audience is a member of that array:
Removing the Audiences constraint lets the same token authenticate (
200), whichisolates the failure to the audience comparison. Array-valued
audis spec-legal(RFC 7519 §4.1.3) and is the guaranteed shape of every Kubernetes ServiceAccount
token, so this blocks any Kubernetes workload using JWT Auth.
To Reproduce
infisicaland Subject tosystem:serviceaccount:<ns>:<sa>.audarray contains that audience:"aud": ["infisical"].HTTP 500 "Something went wrong".Removing the Audiences constraint and retrying the same token →
200.Expected behavior
The audience check should treat
audas a set: accept when the configured audienceis a member, return
401when it isn't. It should never throw a500on aspec-legal claim shape, regardless of comparison semantics.
Screenshots
No response
Deployment Type
Infisical Cloud
Additional context
Environment
eu.infisical.com), observed 2026-07-28curl; originally hit via External Secrets OperatorSpecification references
audis an array of case-sensitive strings, with a singlestring permitted as shorthand for the one-audience case; the array is the general
form. https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3
spec.audiencesis a list, so issued tokens alwaysserialize
audas an array.https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-request-v1/
Request ID
req-i5q6h5ZJs2EcXPWorkaround
Drop the Audiences constraint and rely on Issuer + Subject bound claims (loses
audience scoping).