Skip to content

Commit

Permalink
doc about trafic integration
Browse files Browse the repository at this point in the history
  • Loading branch information
dadrus committed Feb 4, 2022
1 parent 35e980d commit 8e26261
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 34 additions & 0 deletions docs/docs/guides/traefik-proxy-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
id: traefik-proxy-integration
title: Traefik Proxy Integration
---

[Traefik Proxy](https://doc.traefik.io/traefik/) is modern HTTP proxy and load balancer for microservices, oathkeeper can be integrated with via the [ForwardAuth Middleware](https://doc.traefik.io/traefik/middlewares/http/forwardauth/) by making use of the available [Access Control Decision API](index.md#access-control-decision-api).

To achieve this,
* configure traefik
* to make use of the aforesaid ForwardAuth middleware by setting the `address` property to the decision URL endpoint and
* by including the required header name(s), the oathkeeper sets in the HTTP responses into the `authResponseHeaders` property.
* configure the route of your service to make use of this middleware

Example (using Docker labels):

```.yaml
edge-router:
image: traefik
# further configuration
labels:
- traefik.http.middlewares.oathkeeper.forwardauth.address=http://oathkeeper:4456/decisions
- traefik.http.middlewares.oathkeeper.forwardauth.authResponseHeaders=X-Id-Token,Authorization
# further labels
service:
image: my-service
# further configuration
labels:
- traefik.http.routers.service.middlewares=oathkeeper
# further labels
```



2 changes: 1 addition & 1 deletion docs/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
]
},
{
"Guides": ["configure-deploy"]
"Guides": ["configure-deploy", "guides/traefik-proxy-integration"]
},
"reference/api",
{
Expand Down

0 comments on commit 8e26261

Please sign in to comment.