Configure traefik with authentik

Hello everyone,

I just finished setup a traefik instance and before make it accessible by everyone I want to use authentik as forwardAuth. I created the middleware but it don't show up in the traefik dashboard and I have this error in the traefik logs

middleware "authentik@docker" does not exist" entryPointName=https routerName=whoami@docker

I have try with authentik@file but same error

entryPoints:
  web:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: "https"
          scheme: "https"
  https:
    address: ":443"
    forwardedHeaders:
      trustedIPs: "173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/12,172.64.0.0/13,131.0.72.0/22,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.0/8"
certificatesResolvers:
  cloudflare:
    acme:
      email: "acme@email.fr"
      storage: "/etc/traefik/acme.json"
      dnsChallenge:
        provider: "cloudflare"
        delayBeforeCheck: 0
        resolvers:
          - "1.1.1.1:53"  
          - "1.0.0.1:53"
          - "8.8.8.8:53" 
        disablePropagationCheck: true
api: 
  dashboard: true
  insecure: true

# Configuration des fournisseurs de services
providers:
  docker:
    exposedByDefault: false

#Configuration des middlewares
http:
  middlewares:
    authentik:
      forwardAuth:
        address: https://auth.domain.tld/outpost.goauthentik.io/auth/traefik
        trustForwardHeader: true
        authResponseHeaders:
          - X-authentik-username
          - X-authentik-groups
          - X-authentik-email
          - X-authentik-name
          - X-authentik-uid
          - X-authentik-jwt
          - X-authentik-meta-jwks
          - X-authentik-meta-outpost
          - X-authentik-meta-provider
          - X-authentik-meta-app
          - X-authentik-meta-version

I'm new to traefik so I think I didn't a part of the docs correctly :confused:

Thanks for your help !!

Traefik static config doesn’t have a http root element (reference). If you want to define a standard middleware, then you need to create a dynamic config file and load it in static config with providers.file.

Thanks a lot that work now !!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.