Update spring-security-cognito module under spring-security-modules to remove usage of deprecated WebSecurityConfigurerAdapter
package com.baeldung.cognito;
+import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.web.SecurityFilterChain;
@Configuration
-public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
+public class SecurityConfiguration {
- @Override
- protected void configure(HttpSecurity http) throws Exception {
+ @Bean
+ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.csrf()
.and()
.authorizeRequests(authz -> authz.mvcMatchers("/")
@@ -19,5 +20,6 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
.and()
.logout()
.logoutSuccessUrl("/");
+ return http.build();
}
}
\ No newline at end of file
