I would like to use Spring Actuator Framework in my Spring Boot 2.0 application. The framework itself works as expected, thus I am able to reach e.g. my /actuator/health
endpoint. There I´m presented a login dialogue. I´d like to get rid of it and tried the following:
@Configuration
@EnableWebFluxSecurity
public class SecurityConfiguration {
@Bean
public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {
return http
.authorizeExchange()
.matchers(EndpointRequest.to("prometheus")).permitAll()
.matchers(EndpointRequest.toAnyEndpoint()).authenticated()
.anyExchange().permitAll()
.and()
.formLogin()
.and()
.httpBasic()
.and()
.build();
}
However, during application startup I get the following error:
Failed to instantiate [org.springframework.security.web.server.SecurityWebFilterChain]: Factory method 'securityWebFilterChain' threw exception; nested exception is java.lang.IllegalArgumentException: authenticationManager cannot be null
Of course I tried to search for it, but I always only get pages describing different scenarios or security configuration with Spring Boot 1.x framework. Can anybody help me here?