Conversation
✅ Deploy Preview will be available once build job completes!
|
| - **Secret type**: The secret must be of type `Opaque` with a key named `auth` containing the JWKS data in JSON format. | ||
| - **realm**: (Optional) The realm parameter sets the authentication realm displayed in the WWW-Authenticate header when authentication fails. | ||
| - **keyCache**: (Optional) Specifies how long NGINX Plus caches the JWKS keys in memory. Valid values include time units like `10s`, `1m`, `1h`. This reduces the need to re-read the secret file for each request. If not specified, keys are cached indefinitely until NGINX is reloaded. | ||
|
|
There was a problem hiding this comment.
I think we should also mention (either now or once we support remote), that this example uses File and what that means.
|
|
||
| JWT authentication in NGINX Gateway Fabric validates JSON Web Tokens using JSON Web Key Sets (JWKS). The JWKS contains the public keys used to verify the JWT signatures. When a request arrives with a JWT in the `Authorization` header, NGINX Plus validates the token against the configured JWKS before forwarding the request to your application. | ||
|
|
||
| This guide demonstrates JWT authentication using a local JWKS file stored in a Kubernetes Secret. |
There was a problem hiding this comment.
should we mention explicitly that remote JWT is excluded currently to avoid any confusion
| - **realm**: (Optional) The realm parameter sets the authentication realm displayed in the WWW-Authenticate header when authentication fails. | ||
| - **keyCache**: (Optional) Specifies how long NGINX Plus caches the JWKS keys in memory. Valid values include time units like `10s`, `1m`, `1h`. This reduces the need to re-read the secret file for each request. If not specified, keys are cached indefinitely until NGINX is reloaded. |
There was a problem hiding this comment.
| - **realm**: (Optional) The realm parameter sets the authentication realm displayed in the WWW-Authenticate header when authentication fails. | |
| - **keyCache**: (Optional) Specifies how long NGINX Plus caches the JWKS keys in memory. Valid values include time units like `10s`, `1m`, `1h`. This reduces the need to re-read the secret file for each request. If not specified, keys are cached indefinitely until NGINX is reloaded. | |
| - **keyCache**: (Optional) Controls how long NGINX Plus caches the JWKS keys in memory. Supported values use standard time units such as 10s, 1m, or 1h. Caching avoids reloading the JWKS from the Secret for every request, improving performance. If not specified, the keys remain cached indefinitely and are only refreshed when NGINX is reloaded. |
sounds clearer I think
| ## Setup | ||
|
|
||
| In this part of the document, you will set up several resources in your cluster to demonstrate usage of the AuthenticationFilter CRD with JWT authentication. | ||
|
|
||
| ## Deploy sample applications |
There was a problem hiding this comment.
something is weird here.
There is a H2 header about Setup with a sentence followed with another H2 header for Deploy sample applications
Is the "Deploy ..." section part of Setup?
If it is not a subsection, the text under Setup does not make sense by itself.
If it is a subsection all the heading levels after Setup need to be reviewed
| apiVersion: gateway.nginx.org/v1alpha1 | ||
| kind: AuthenticationFilter | ||
| metadata: | ||
| name: jwt-auth | ||
| spec: | ||
| type: JWT | ||
| jwt: | ||
| file: | ||
| secretRef: | ||
| name: jwt-auth | ||
| realm: "Restricted jwt-auth" | ||
| keyCache: "1h" |
There was a problem hiding this comment.
| apiVersion: gateway.nginx.org/v1alpha1 | |
| kind: AuthenticationFilter | |
| metadata: | |
| name: jwt-auth | |
| spec: | |
| type: JWT | |
| jwt: | |
| file: | |
| secretRef: | |
| name: jwt-auth | |
| realm: "Restricted jwt-auth" | |
| keyCache: "1h" | |
| apiVersion: gateway.nginx.org/v1alpha1 | |
| kind: AuthenticationFilter | |
| metadata: | |
| name: jwt-auth | |
| spec: | |
| type: JWT | |
| jwt: | |
| source: File | |
| file: | |
| secretRef: | |
| name: jwt-auth | |
| realm: "Restricted jwt-auth" | |
| keyCache: "1h" |
There was a problem hiding this comment.
We need to add source: File here otherwise we get this error:
The AuthenticationFilter "jwt-auth" is invalid:
* spec.jwt.source: Required value
Proposed changes
Checklist
Before sharing this pull request, I completed the following checklist:
Footnotes
Potentially sensitive information includes personally identify information (PII), authentication credentials, and live URLs. Refer to the style guide for guidance about placeholder content. ↩