JAVA-14887 Update spring-security-cognito module under spring-security-modules to remove usage of deprecated WebSecurityConfigurerAdapter (#12903)
This commit is contained in:
parent
bca5ffe971
commit
aa0692bbe5
@ -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();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user