From 32f68f91ffdc14ade38373b42ef4880ee185fc5e Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 10 Aug 2022 23:59:33 +0200 Subject: [PATCH] add missing www-authentication header on failed authentication --- services/proxy/pkg/middleware/authentication.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index f5f4d9115..c90522403 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -87,6 +87,7 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle } } if !isPublicPath(r.URL.Path) { + writeSupportedAuthenticateHeader(w, r) for _, s := range SupportedAuthStrategies { userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, s) } @@ -178,6 +179,7 @@ func userAgentAuthenticateLockIn(w http.ResponseWriter, r *http.Request, locks m for _, r := range ProxyWwwAuthenticate { evalRequestURI(u, r) } + fmt.Println(w.Header()) } func evalRequestURI(l userAgentLocker, r regexp.Regexp) {