Hello,
First time posting here.
We have a middleware server which we forward requests to for authentication/authorization (authelia). We have no issues with the setup. We desire to have a secondary authelia server for backup purposes but would be convenient for traefik to automatically forward authentication to the active server automatically whether that be the primary or secondary.
My understanding is that chain
middleware is serial, meaning after it finishes a group, it will go to the next. I also saw circuitbreaker
but not sure if that would accomplish what I'm looking for.
Below is my config with both authelia/authelia2 middlewares.
http:
middlewares:
authelia:
forwardAuth:
address: "http://login.domain.net:9091/api/verify?rd=https://login.domain.net"
trustForwardHeader: true
authResponseHeaders:
- "Remote-User"
- "Remote-Groups"
- "Remote-Email"
- "Remote-Name"
tls:
ca: "/opt/certs_repo/certs/domain.net.ca-bundle"
cert: "/opt/certs_repo/certs/server.crt"
key: "/opt/certs_repo/certs/server.key"
authelia2:
forwardAuth:
address: "http://login2.domain.net:9091/api/verify?rd=https://login2.domain.net"
trustForwardHeader: true
authResponseHeaders:
- "Remote-User"
- "Remote-Groups"
- "Remote-Email"
- "Remote-Name"
tls:
ca: "/opt/certs_repo/certs/domain.net.ca-bundle"
cert: "/opt/certs_repo/certs/server.crt"
key: "/opt/certs_repo/certs/server.key"
authelia-chain:
chain:
middlewares:
- authelia@file
- authelia2@file
routers:
grafana-http:
rule: 'Host(`grafana.domain.net`)'
entryPoints:
- http-insecure
service: grafana
middlewares:
- https-redirect
grafana-https:
rule: 'Host(`grafana.domain.net`)'
entryPoints:
- https-secure
service: grafana
middlewares:
- authelia-chain@file
- headers-chain@file
tls:
domains:
- main: "domain.net"
sans:
- "*.domain.net"
services:
grafana:
loadBalancer:
servers:
- url: "http://127.0.0.1:3000"
With the above, a user MUST login into both middlewares before accessing the service. It would be nice if it were authelia middleware else authelia2 middleware
.
Is this even possible?
Hope i was clear.
Any input is much appreciated.
Best,
Dave