Add a slot for a second traefik-forward-auth #31

Merged
3wordchant merged 3 commits from forward-auth-2 into master 2021-11-24 15:10:55 +00:00
4 changed files with 14 additions and 2 deletions

View File

@ -52,6 +52,8 @@ COMPOSE_FILE="compose.yml"
#COMPOSE_FILE="$COMPOSE_FILE:compose.keycloak.yml"
#KEYCLOAK_MIDDLEWARE_ENABLED=1
#KEYCLOAK_TFA_SERVICE=traefik-forward-auth_app
#KEYCLOAK_MIDDLEWARE_2_ENABLED=1
#KEYCLOAK_TFA_SERVICE_2=traefik-forward-auth_app
#####################################################################
# Prometheus metrics #

View File

@ -1,3 +1,3 @@
export TRAEFIK_YML_VERSION=v12
export FILE_PROVIDER_YML_VERSION=v3
export FILE_PROVIDER_YML_VERSION=v6
export ENTRYPOINT_VERSION=v2

View File

@ -5,7 +5,9 @@ services:
app:
deploy:
labels:
- "traefik.http.routers.traefik.middlewares=keycloak@file"
- "traefik.http.routers.${STACK_NAME}.middlewares=keycloak@file"
environment:
- KEYCLOAK_MIDDLEWARE_ENABLED
- KEYCLOAK_TFA_SERVICE
- KEYCLOAK_MIDDLEWARE_2_ENABLED
- KEYCLOAK_TFA_SERVICE_2

View File

@ -9,6 +9,14 @@ http:
authResponseHeaders:
- X-Forwarded-User
{{ end }}
{{ if eq (env "KEYCLOAK_MIDDLEWARE_2_ENABLED") "1" }}
keycloak2:
forwardAuth:
address: "http://{{ env "KEYCLOAK_TFA_SERVICE_2" }}:4181"
trustForwardHeader: true
authResponseHeaders:
- X-Forwarded-User
{{ end }}
security:
headers:
frameDeny: true