Skip to content

vitaliy-leschenko/traefik-forwardauth-azuread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What is it?

This is demo how to use forwardauth middleware of traefik. You can find more details about it on official traefik docs

How to use it (in k8s)?

  1. register an app in Azure Active Directory to obtain ClientId, ClientSecret, TenantId
  2. build docker image src/TraefikAuthAAD/Dockerfile and publish it to a registry
  3. create a deploy and make sure that you override these environment variables:
  1. create a service for the deploy
  2. create a traefik middleware object:
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: auth
spec:
  forwardAuth:
    address: http://{service name or ip}/auth
    trustForwardHeader: true  
  1. use the middleware in your ingress objects