Skip to main content

Getting Started

Configure the Plugin

Enable the plugin in your traefik configuration.

experimental:
plugins:
traefik-oidc-auth:
moduleName: "github.com/sevensolutions/traefik-oidc-auth"
version: "v0.7.0"

Configure Middleware

caution

It is highly reccomnded to change the default encryption-secret by providing your own 32-character secret using the Secret-option. You can generate a random one here: https://it-tools.tech/token-generator?length=32

This is an example using YAML file config

http:
services:
whoami:
loadBalancer:
servers:
- url: http://whoami:80

middlewares:
oidc-auth:
plugin:
traefik-oidc-auth:
Secret: "MLFs4TT99kOOq8h3UAVRtYoCTDYXiRcZ" # Please change this secret for your setup
Provider:
Url: "https://<YourIdentityProviderUrl>"
ClientId: "<YourClientId>"
ClientSecret: "<YourClientSecret>"
#UsePkce: true # Or use PKCE if your Provider supports this
Scopes: ["openid", "profile", "email"]

routers:
whoami:
entryPoints: ["web"]
rule: "HostRegexp(`.+`)"
service: whoami
middlewares: ["oidc-auth"]