Added setSecure option to authetication cookie

This commit is contained in:
Giuseppe Digilio
2020-02-05 11:49:59 +01:00
parent c63b88141c
commit 0336e83124

View File

@@ -160,6 +160,7 @@ public class JWTTokenRestAuthenticationServiceImpl implements RestAuthentication
if (addCookie) {
Cookie cookie = new Cookie(AUTHORIZATION_COOKIE, token);
cookie.setHttpOnly(true);
cookie.setSecure(true);
response.addCookie(cookie);
}
response.setHeader(AUTHORIZATION_HEADER, String.format("%s %s", AUTHORIZATION_TYPE, token));