diff --git a/examples/ehcache/src/main/java/com/giffing/bucket4j/spring/boot/starter/examples/ehcache/config/security/SecurityConfig.java b/examples/ehcache/src/main/java/com/giffing/bucket4j/spring/boot/starter/examples/ehcache/config/security/SecurityConfig.java index 1f282b1d..56e76226 100644 --- a/examples/ehcache/src/main/java/com/giffing/bucket4j/spring/boot/starter/examples/ehcache/config/security/SecurityConfig.java +++ b/examples/ehcache/src/main/java/com/giffing/bucket4j/spring/boot/starter/examples/ehcache/config/security/SecurityConfig.java @@ -14,14 +14,17 @@ public class SecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { - http.authorizeHttpRequests().requestMatchers("/unsecure").permitAll(); - http.authorizeHttpRequests().requestMatchers("/login").permitAll(); - http.authorizeHttpRequests().requestMatchers("/secure").hasAnyRole("ADMIN", "USER"); + http.authorizeHttpRequests(auth -> { + auth.requestMatchers("/unsecure").permitAll(); + auth.requestMatchers("/actuator/*").permitAll(); + auth.requestMatchers("/login").permitAll(); + auth.requestMatchers("/secure").hasAnyRole("ADMIN", "USER"); + }); return http.build(); } @Bean - public UserDetailsService inMemoryUser() throws Exception { + public UserDetailsService inMemoryUser() { UserDetails user = User.builder() .username("admin") .password("123")