Skip to content

Commit 8376e8a

Browse files
authored
feat: Added documentation for forward_http_headers feature (#858)
1 parent b4b3b9f commit 8376e8a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/oathkeeper/pipeline/authn.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ note that Gzipped responses from `check_session_url` are not supported, and will
241241
`subject`. Example: `identity.id` for `{ "identity": { "id": "1234" } }`.
242242
- `additional_headers` (map[string]string, optional - defaults empty) - If set, you can either add additional headers or override
243243
existing ones.
244+
- `forward_http_headers` ([]string, optional - defaults ["Authorization", "Cookie"]) - If set, you can specify which headers will be
245+
forwarded.
244246

245247
```yaml
246248
# Global configuration file oathkeeper.yml
@@ -266,6 +268,24 @@ authenticators:
266268
- sessionid
267269
```
268270

271+
```yaml
272+
# Some Access Rule: access-rule-1.yaml
273+
id: access-rule-1
274+
# match: ...
275+
# upstream: ...
276+
authenticators:
277+
- handler: cookie_session
278+
config:
279+
check_session_url: https://session-store-host
280+
only:
281+
- sessionid
282+
forward_http_headers:
283+
- Connect
284+
- Authorization
285+
- Cookie
286+
- X-Forwarded-For
287+
```
288+
269289
```yaml
270290
# Some Access Rule Preserving Path: access-rule-2.yaml
271291
id: access-rule-2
@@ -343,6 +363,8 @@ note that Gzipped responses from `check_session_url` are not supported, and will
343363
request authentication. It can't be set along with `header` or `cookie`.
344364
- `cookie` (string, required, one of) - The cookie (case sensitive) that must contain a Bearer token for request authentication.
345365
It can't be set along with `header` or `query_parameter`
366+
- `forward_http_headers` ([]string, optional - defaults ["Authorization", "Cookie"]) - If set, you can specify which headers will be
367+
forwarded.
346368

347369
```yaml
348370
# Global configuration file oathkeeper.yml
@@ -395,6 +417,10 @@ authenticators:
395417
# cookie: auth-token
396418
preserve_path: true
397419
preserve_query: true
420+
forward_http_headers:
421+
- Authorization
422+
- Cookie
423+
- X-Forwarded-For
398424
```
399425

400426
### `bearer_token` Access Rule Example

0 commit comments

Comments
 (0)