{
"aud": "123123-1232-123123-2323-123",
"iss": "https://url",
"iat": 2112,
"nbf": 1212,
"exp": 1212,
"aio": "ewq32ee23e2e=",
"azp": "123123-1232-123123-2323-123",
"azpacr": "1",
"oid": "123123-1232-123123-2323-123",
"rh": "1.qqfn4wanflwf3aldAAA.",
"roles": [
"default"
],
"sub": "123123-1232-123123-2323-123"
}
My JWT contains the above claims. i have to validate 3 things
- audience : aud
- issuer : iss
- roles : 'roles' should be present in JWT. Its value array should contain 'default'. How can this be achieved with envoy?
I researched a bit and found a way to validate audience 'aud' and issuer 'iss'.
http_filters:
- name: envoy.filters.http.jwt_authn
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.JwtAuthentication
providers:
"auth-iam":
issuer: https://url
forward: true,
audiences:
- 123123-1232-123123-2323-123 # [audience]
remote_jwks:
http_uri: # [3]
uri: https://url/keys # [simple]
cluster: auth-iam
timeout: 5s
cache_duration:
seconds: 900
rules:
- match:
prefix: /actuator/health
- match:
prefix: /
requires:
provider_name: auth-iam