[JAVA-31203] Upgraded spring-cloud-config to spring boot 3 (#15861)
This commit is contained in:
+8
-7
@@ -2,6 +2,7 @@ package com.baeldung.spring.cloud.config.server;
|
||||
|
||||
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,13 +11,13 @@ public class SecurityConfiguration {
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http.csrf()
|
||||
.ignoringAntMatchers("/encrypt/**")
|
||||
.ignoringAntMatchers("/decrypt/**");
|
||||
http.authorizeRequests((requests) -> requests.anyRequest()
|
||||
.authenticated());
|
||||
http.formLogin();
|
||||
http.httpBasic();
|
||||
http.csrf(csrf -> csrf.ignoringRequestMatchers(
|
||||
"/encrypt/**", "/decrypt/**"
|
||||
))
|
||||
.authorizeRequests(authz -> authz.anyRequest().authenticated())
|
||||
.formLogin(Customizer.withDefaults())
|
||||
.httpBasic(Customizer.withDefaults());
|
||||
|
||||
return http.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user