title: Spring boot actuator: Health endpoint not showing details when other actuator's endpoints are secured
body: <p><strong>Goal</strong>: secure all actuator endpoints, apart from info and health, but for health show the details when user is authenticated.</p>
  
  <p>My pom has only <code>spring-boot-starter-web</code>, <code>spring-boot-starter-security</code> and <code>spring-boot-starter-web</code> (Spring boot version: 2.1.6.RELEASE) and the whole config is</p>
  
  <pre><code>@Configuration
  public class ActuatorSecurity extends WebSecurityConfigurerAdapter {
  
    @Override
    protected void configure(HttpSecurity http) throws Exception {
      http.requestMatcher(EndpointRequest.toAnyEndpoint().excluding("info", "health"))
          .authorizeRequests()
          .anyRequest().authenticated()
          .and()
          .httpBasic();
    }
  }
  </code></pre>
  
  <p>and <code>application.yml</code></p>
  
  <pre><code>management:
    endpoints:
      web:
        exposure:
          include: "*"
    endpoint:
      health:
        show-details: "when-authorized"
  </code></pre>
  
  <p>This secures all end points and gives unauthenticated access to info and health. But when health is accessed with credentials it does not return the details. It looks like the <code>management.endpoint.health.show-details="when-authorized"</code> is ignored in this case.</p>
  
  <p>Anyone has an idea how to fix this?</p>