JAVA-14887 Update spring-security-cognito module under spring-security-modules to remove usage of deprecated WebSecurityConfigurerAdapter (#12903)

This commit is contained in:
anuragkumawat
2022-10-29 14:12:11 +05:30
committed by GitHub
parent b57861c33e
commit 6a67caace3

View File

@@ -1,14 +1,15 @@
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();
}
}