diff --git a/authentik/root/middleware.py b/authentik/root/middleware.py index bb9e050447..5b78321306 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