I’m curious is there any way to allow access to /actuator/health without Okta authentication?
In my spring application, I set the following security filter chain but it seems not working:
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
DefaultRelyingPartyRegistrationResolver relyingPartyRegistrationResolver = new DefaultRelyingPartyRegistrationResolver(
this.relyingPartyRegistrationRepository);
Saml2MetadataFilter filter = new Saml2MetadataFilter(relyingPartyRegistrationResolver,
new OpenSamlMetadataResolver());
http.addFilterBefore(filter, Saml2WebSsoAuthenticationFilter.class);
http.authorizeHttpRequests(authorize -> authorize
.requestMatchers("/actuator/health").permitAll()
.anyRequest().authenticated())
.saml2Login(saml2 -> saml2.loginPage("/saml2/authenticate/okta").defaultSuccessUrl("/")
.failureUrl("/"))
.saml2Logout(withDefaults());
return http.build();
}
I want to deploy this microservice to AWS ECS, using ALB, but the health check fails. Does anyone have a similar issue, or is it something I missed during configuration?