Skip to content

Commit 649bf94

Browse files
authored
chore: document Oathkeeper bearer_token prefix config (ory#2288)
This config is available in the API, but not documented (https://github.com/ory/oathkeeper/blob/master/pipeline/authn/authenticator_bearer_token.go#L36)
1 parent c4effb8 commit 649bf94

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/oathkeeper/pipeline/authn.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ note that Gzipped responses from `check_session_url` are not supported, and will
364364
It can't be set along with `header` or `query_parameter`
365365
- `forward_http_headers` ([]string, optional - defaults ["Authorization", "Cookie"]) - If set, you can specify which headers will
366366
be forwarded.
367+
- `prefix` (string, optional) - If the bearer token does not begin with this prefix, the `bearer_token` authenticator will not
368+
handle the request.
367369

368370
```yaml
369371
# Global configuration file oathkeeper.yml
@@ -422,6 +424,25 @@ authenticators:
422424
- X-Forwarded-For
423425
```
424426

427+
```yaml
428+
# Some Access Rule Handling a Token with a Specified Prefix: access-rule-3.yaml
429+
id: access-rule-2
430+
# match: ...
431+
# upstream: ...
432+
authenticators:
433+
- handler: bearer_token
434+
config:
435+
check_session_url: https://session-store-host/check-session
436+
token_from:
437+
header: Authorization
438+
# or
439+
# header: Custom-Authorization-Header
440+
# or
441+
# cookie: auth-token
442+
# Will only handle requests with Authorization: bearer custom_token_prefix_xxxxxx
443+
prefix: "custom_token_prefix_"
444+
```
445+
425446
### `bearer_token` access rule example
426447

427448
```shell

0 commit comments

Comments
 (0)