From 34457b84ef4e016f96570f7d0cb72bfd0b1d4bec Mon Sep 17 00:00:00 2001 From: Pavol Ipoth Date: Sat, 2 Sep 2023 22:03:58 +0200 Subject: [PATCH] Add hint for secure cookie and http host --- pkg/keycloak/proxy/handlers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/keycloak/proxy/handlers.go b/pkg/keycloak/proxy/handlers.go index 46b80832..c3e2ef42 100644 --- a/pkg/keycloak/proxy/handlers.go +++ b/pkg/keycloak/proxy/handlers.go @@ -70,6 +70,12 @@ func (r *OauthProxy) getRedirectionURL(wrt http.ResponseWriter, req *http.Reques } } + if scheme == constant.UnsecureScheme && r.Config.SecureCookie { + hint := "you have secure cookie set to true but using http " + hint += "use https or secure cookie false" + r.Log.Warn(hint) + } + redirect = fmt.Sprintf("%s://%s", scheme, host) default: redirect = r.Config.RedirectionURL