From 538a466090221df34079d3ce91ae63626cf00fff Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 18 Jul 2021 22:10:50 +0200 Subject: [PATCH] root: fix middleware exception for outpost Signed-off-by: Jens Langhammer --- authentik/root/middleware.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/authentik/root/middleware.py b/authentik/root/middleware.py index bb9e05044..5b7832130 100644 --- a/authentik/root/middleware.py +++ b/authentik/root/middleware.py @@ -23,6 +23,11 @@ class SessionMiddleware(UpstreamSessionMiddleware): return True host, _, _ = request.get_host().partition(":") if host == "localhost" and settings.DEBUG: + # Since go does not consider localhost with http a secure origin + # we can't set the secure flag. + user_agent = request.META.get("HTTP_USER_AGENT", "") + if user_agent.startswith("authentik-outpost@"): + return False return True return False