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