re implement xsrf protection for scm-manager 2.0.0

This commit is contained in:
Sebastian Sdorra
2017-01-12 22:16:14 +01:00
parent 46d8b58810
commit 4e62f9552a
9 changed files with 204 additions and 500 deletions

View File

@@ -184,7 +184,10 @@ public class AuthenticationResource
// TODO: should be configureable
c.setMaxAge((int) TimeUnit.SECONDS.convert(10, TimeUnit.HOURS));
c.setHttpOnly(true);
// set http only flag only xsrf protection is disabled,
// because we have to extract the xsrf key with javascript in the wui
c.setHttpOnly(!configuration.isEnabledXsrfProtection());
response.addCookie(c);
state = stateFactory.createState(subject);
}