Skip to main content

DigestAuth

The DigestAuth middleware grants access to services to authorized users only.


Configuration Example

---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: test-auth
spec:
digestAuth:
secret: authsecret

Configuration Options

FieldDescriptionDefaultRequired
usersArray of authorized users. Each user must be declared using the name:realm:encoded-password format.
The option users supports Kubernetes secrets.
(More information here)
""No
usersFilePath to an external file that contains the authorized users for the middleware.
The file content is a list of name:realm:encoded-password. (More information here)
""No
realmAllow customizing the realm for the authentication."traefik"No
headerFieldAllow defining a header field to store the authenticated user.""No
removeHeaderAllow removing the authorization header before forwarding the request to your service.falseNo

users

  • If both users and usersFile are provided, the two are merged. The contents of usersFile have precedence over the values in users.
  • For security reasons, the field users doesn't exist for Kubernetes IngressRoute, and one should use the secret field instead.

usersFile

  • If both users and usersFile are provided, the two are merged. The contents of usersFile have precedence over the values in users.
  • For security reasons, the field users doesn't exist for Kubernetes IngressRoute, and one should use the secret field instead.

Passwords format

Use htdigest to generate passwords.