Skip to content

Commit

Permalink
try another forward auth setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Arsenikki committed Feb 13, 2025
1 parent 825338e commit 0a10c08
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 30 deletions.
2 changes: 1 addition & 1 deletion cluster/apps/media/flare-bypasser/app/helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: flare-bypasser
namespace: flare-bypasser
namespace: media
spec:
interval: 15m
chart:
Expand Down
46 changes: 17 additions & 29 deletions cluster/core/traefik/resources/forward-auth-middleware.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,41 @@
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: oauth
name: forward-auth
namespace: traefik
spec:
chain:
middlewares:
- name: traefik-https-redirect@kubernetescrd
- name: oauth-errors
- name: oauth-forward
---
# https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/overview/#configuring-for-use-with-the-traefik-v2-forwardauth-middleware
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: oauth-headers
namespace: auth
spec:
headers:
sslRedirect: true
stsSeconds: 315360000
browserXssFilter: true
contentTypeNosniff: true
forceSTSHeader: true
sslHost: ${SECRET_DOMAIN}
stsIncludeSubdomains: true
stsPreload: true
frameDeny: true
- name: forward-auth-errors
- name: forward-auth-sign-in
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: oauth-errors
namespace: auth
name: oauth2-proxy-errors
namespace: traefik
spec:
errors:
status:
- "401-403"
- 401
query: /oauth2/sign_in
service:
name: oauth2-proxy
namespace: auth
port: 80
query: "/oauth2/sign_in?rd={url}"
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: oauth-forward
namespace: auth
name: oauth2-proxy-sign-in
namespace: traefik
spec:
forwardAuth:
address: https://auth.${SECRET_DOMAIN}/oauth2/auth
address: http://oauth2-proxy.auth.svc/oauth2/auth
trustForwardHeader: true
authResponseHeaders:
- Authorization
- Set-Cookie
- X-Auth-User
- X-Secret

0 comments on commit 0a10c08

Please sign in to comment.