Describe the bug
When https post login request gateway is forwarded to security processing by http protocol, csrf detects error 302 The location of forward points to http protocol
I use spring gateway with security, and enable csrf.
The browser requests to spring gateway with https protocol,
The route is defined as lb:http://security-service,
Gateway converts https protocol to http and forwards to security processing,
When the POST /login login request,
csrf detection fails,
the returned 302 forward response Location address in the Header is the url of the http protocol,
Returning to the browser through the gateway is unchanged.
I use PreserveHostHeader and RewriteLocationResponseHeader to no avail.
Browser url changed from https protocol request to http protocol request,
I need the browser to stay on the https protocol
Describe the bug When https post login request gateway is forwarded to security processing by http protocol, csrf detects error 302 The location of forward points to http protocol
I use spring gateway with security, and enable csrf. The browser requests to spring gateway with https protocol, The route is defined as
lb:http://security-service
, Gateway converts https protocol to http and forwards to security processing, When thePOST /login
login request, csrf detection fails, the returned 302 forward response Location address in the Header is the url of the http protocol, Returning to the browser through the gateway is unchanged. I use PreserveHostHeader and RewriteLocationResponseHeader to no avail. Browser url changed from https protocol request to http protocol request, I need the browser to stay on the https protocolgateway-service.yaml
gateway-route
SecurityConfiguration