JAVA-29288 Upgrade spring-security-cognito (#15839)
Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
parent
10f477e635
commit
4a229ecfe5
@ -11,7 +11,8 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>spring-security-modules</artifactId>
|
||||
<artifactId>parent-boot-3</artifactId>
|
||||
<relativePath>../../parent-boot-3</relativePath>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
@ -30,7 +31,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf.extras</groupId>
|
||||
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
|
||||
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
|
||||
</dependency>
|
||||
<!-- oauth2 -->
|
||||
<dependency>
|
||||
|
@ -2,6 +2,7 @@ package com.baeldung.cognito;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.Customizer;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
|
||||
@ -10,16 +11,13 @@ public class SecurityConfiguration {
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http.csrf()
|
||||
.and()
|
||||
.authorizeRequests(authz -> authz.mvcMatchers("/")
|
||||
http.csrf(Customizer.withDefaults())
|
||||
.authorizeHttpRequests(authz -> authz.requestMatchers("/")
|
||||
.permitAll()
|
||||
.anyRequest()
|
||||
.authenticated())
|
||||
.oauth2Login()
|
||||
.and()
|
||||
.logout()
|
||||
.logoutSuccessUrl("/");
|
||||
.oauth2Login(Customizer.withDefaults())
|
||||
.logout(httpSecurityLogoutConfigurer -> httpSecurityLogoutConfigurer.logoutSuccessUrl("/"));
|
||||
return http.build();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user