jwt-auth-context validates JWTs, applies selected claim checks, and writes trusted claim values to upstream request headers.
It is intended to run before plugins that depend on authenticated user context, such as graph-context-enricher.
cd jwt-auth-context
luarocks makeOr install a built rock:
luarocks install kong-plugin-jwt-auth-context-1.0.0-1.all.rockEnable it in Kong:
export KONG_PLUGINS=bundled,jwt-auth-contextcd external_plugins
luarocks make kong-plugins-bundle-1.0.0-1.rockspec
export KONG_PLUGINS=bundled,jwt-auth-context- Extracts the token from
Authorization, cookie, or query based on config order. - Fetches and caches JWKS from the configured endpoint.
- Verifies signature, expiration, not-before, issuer, and audience.
- Optionally enforces
email_verifiedand a required role. - Clears the headers it owns and then writes trusted claim values.
- Supports
reject,pass, and redirect flows depending on the failure mode.
jwks_urljwks_cache_ttl_secondsssl_verifyexpected_issuerexpected_audiencerequire_email_verifiedrequired_roleon_missing_tokenon_invalid_tokenbrowser_redirect_urlbrowser_redirect_onlytoken_sourcescookie_namequery_param_namecustom_header_mappings
See schema.lua for the exact schema and defaults.