Skip to content

Commit f931a65

Browse files
committed
Update defaults and add details describing Realms
1 parent d9268a0 commit f931a65

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

docs/proposals/authentication-filter.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ This document also focus on HTTP Basic Authentication and JWT Authentication. Ot
4343
| **JWT (JSON Web Token)** ||| [ngx_http_auth_jwt_module](https://nginx.org/en/docs/http/ngx_http_auth_jwt_module.html) | Tokens are used for stateless authentication between client and server. |
4444
| **OpenID Connect** ||| [ngx_http_oidc_module](https://nginx.org/en/docs/http/ngx_http_oidc_module.html)| Allows authentication through third-party providers like Google. |
4545

46+
### Understanding authentication terminoligy
47+
48+
#### Realms
49+
50+
[RFC 7617](https://www.rfc-editor.org/rfc/rfc7617) gives an overview of the Realm parameter, which is used by `auth_basic` and `auth_jwt` directives in NGINX.
51+
52+
```text
53+
The realm value is a free-form string
54+
that can only be compared for equality with other realms on that
55+
server. The server will service the request only if it can validate
56+
the user-id and password for the protection space applying to the
57+
requested resource.
58+
```
59+
60+
4661
## API, Customer Driven Interfaces, and User Experience
4762

4863
This portion of the proposal will cover API design and interaction experience for use of Basic Auth and JWT.
@@ -144,7 +159,7 @@ type BasicAuth struct {
144159
// Also configures "realm="<realm_value>" in WWW-Authenticate header in error page location.
145160
//
146161
// +optional
147-
// +kubebuilder:default="Restricted"
162+
// +kubebuilder:default=""
148163
Realm *string `json:"realm,omitempty"`
149164

150165
// OnFailure customizes the 401 response for failed authentication.
@@ -173,7 +188,7 @@ type JWTAuth struct {
173188
// Configures "realm="<realm_value>" in WWW-Authenticate header in error page location.
174189
//
175190
// +optional
176-
// +kubebuilder:default="Restricted"
191+
// +kubebuilder:default=""
177192
Realm *string `json:"realm,omitempty"`
178193

179194
// Mode selects how JWT keys are provided: local file or remote JWKS.
@@ -502,7 +517,7 @@ http {
502517

503518
For JWT Auth, there is two options.
504519

505-
1. Local JWKS file stored as as a Secret or as a ConfigMap
520+
1. Local JWKS file stored as as a Secret
506521
2. Remote JWKS from an IdP provider like Keycloak
507522

508523
#### Example JWT AuthenticationFilter with Local JWKS
@@ -558,7 +573,7 @@ spec:
558573
scheme: Bearer
559574
```
560575
561-
#### Secret referenced by filter (if using secretRef)
576+
#### Secret referenced by filter
562577
563578
```yaml
564579
apiVersion: v1
@@ -570,8 +585,6 @@ data:
570585
jwks.json: ewogICJrZXlzIjogWwogICAgewogICAgICAia3R5IjogIlJTQSIsCiAgICAgICJ1c2UiOiAic2lnIiwKICAgICAgImtpZCI6ICJleGFtcGxlLWtleS1pZCIsCiAgICAgICJhbGciOiAiUlMyNTYiLAogICAgICAibiI6ICJiYXNlNjR1cmwtbW9kdWx1cyIsCiAgICAgICJlIjogIkFRQUIiCiAgICB9CiAgXQp9Cg==
571586
```
572587
573-
Note: Secret data values must be base64-encoded and are decoded by the kubelet on mount, producing a valid jwks.json file. ConfigMap data values are plain text and should contain the raw JSON (not base64).
574-
575588
#### HTTPRoute that will reference this filter
576589
577590
```yaml

0 commit comments

Comments
 (0)