Infinite authentication loop after adding basic auth

Hi @foxcris,

I do not manage to reproduce the issue. This is the scenario reproducing your use case (with less advanced TLS management) that is working. Could you check you have something similar?

version: '3.7'

services:
  traefik:
    image: traefik:v2.7
    ports:
      - "80:80"
      - "443:443"
    command:
      - --log.level=debug
      - --api.dashboard=true
      - --api.insecure=false
      - --providers.docker.exposedByDefault=false
      - --entrypoints.http.address=:80
      - --entrypoints.http.http.redirections.entrypoint.scheme=https
      - --entrypoints.http.http.redirections.entrypoint.to=https
      - --entrypoints.https.address=:443
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik_https.rule=Host(`localhost`)"
      - "traefik.http.routers.traefik_https.entrypoints=https"
      - "traefik.http.routers.traefik_https.tls=true"
      - "traefik.http.routers.traefik_https.service=api@internal"
      - "traefik.http.routers.traefik_https.middlewares=auth"
      - "traefik.http.middlewares.auth.basicauth.users=toto:$$2y$$05$$S0cQqzm8o.G4bxboJKLHqOQuJyf4h0LOX5M779tGDnxnYArWchaGS"
    tty: true
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

networks:
  traefik_proxy: {}

EDIT: User password is "toto:toto"

If you do not manage to find the issue, what is this infinite loop exactly? What do you see and where?

Thanks,
Maxence