https://stackoverflow.com/questions/35079930/consul-health-check-pass-by-spring-security-filter

 

By default consul from spring-cloud-starter-consul-discovery use /actuator/health to check health.
When spring-security is used, should provide & permit that path.

Steps:

  • Permit /actuator/health in spring-security, then consul could perform the health check.

    e.g

    httpSecurity.csrf().disable() 
        .authorizeRequests().antMatchers("/hello", "/authenticate", "/actuator/health")
        .permitAll().
    
  • Add actuator dependency, if not yet.

  • Expose endpoints

    e.g

    management:
      endpoints:
        web:
          exposure:
            include: "*"
    

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-24
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
猜你喜欢
  • 2022-12-23
  • 2021-07-11
  • 2021-08-12
  • 2022-02-17
  • 2021-10-28
  • 2021-12-24
相关资源
相似解决方案