fix 2fa session
This commit is contained in:
parent
5f5d505892
commit
f11e2fde88
@ -95,9 +95,7 @@ public class SecurityConfig {
|
||||
.sessionManagement((anonymous) -> anonymous.sessionCreationPolicy(SessionCreationPolicy.ALWAYS)
|
||||
.sessionAuthenticationStrategy(new SessionFixationProtectionStrategy()))
|
||||
// disable deprectated xss protection, x-frame
|
||||
.headers((headers) -> headers.xssProtection((xssProtection) -> xssProtection.disable())
|
||||
.frameOptions((frameOptions) -> frameOptions.disable()
|
||||
.referrerPolicy((referrerPolicy) -> referrerPolicy.policy(ReferrerPolicy.UNSAFE_URL))))
|
||||
.headers((headers) -> headers.xssProtection((xssProtection) -> xssProtection.disable()))
|
||||
// form login
|
||||
.formLogin((formLogin) -> formLogin.loginPage(loginUrl).usernameParameter("username")
|
||||
.passwordParameter("password")
|
||||
@ -119,8 +117,13 @@ public class SecurityConfig {
|
||||
.exceptionHandling(
|
||||
(exceptionHandling) -> exceptionHandling.accessDeniedHandler(localAccessDeniedHandler)
|
||||
.authenticationEntryPoint(localAuthenticationEntryPoint()))
|
||||
// x-frame
|
||||
.headers((headers) -> headers.frameOptions((frameOptions) -> frameOptions.disable()
|
||||
.referrerPolicy((referrerPolicy) -> referrerPolicy.policy(ReferrerPolicy.UNSAFE_URL))))
|
||||
// crsf
|
||||
.csrf((csrf) -> csrf.disable());
|
||||
.csrf((csrf) -> csrf.disable())
|
||||
// TODO: update
|
||||
.securityContext((securityContext) -> securityContext.requireExplicitSave(false));
|
||||
|
||||
if (disableCors) {
|
||||
http.cors((cors) -> cors.disable());
|
||||
|
Loading…
Reference in New Issue
Block a user