我们已经看到了许多与 Spring Boot 1.5+ 版本的 Health Actuator 端点相关的问题。在经历了其中的一些之后,我们仍然不知所措。
我们的目标是:
HttpSecurity)我们尝试过:
WebSecurityConfigurerAdapter并配置WebSecurity对象以忽略/health端点的安全性,然后/health根据将多个 URL 路由到 Spring Boot Actuator 的健康端点,将单独的端点映射到端点,以希望启用安全路径。security.oauth2.resource.filter-order=3按照https://github.com/spring-projects/spring-boot/issues/5072中的建议进行。这将放在OAuth2AuthenticationProcessingFilterActuator 的 Mvc 端点之前,并允许处理包含预验证Authorization: Bearer ...标头(例如 JWT 授权)的请求。但是,它规定所有请求都包含授权——否则,FilterSecurityInterceptor触发器Secure object: FilterInvocation: URL: /health; Attributes: [#oauth2.throwOnError(authenticated)]和AccessDeniedException/health对其他所有内容使用基本身份验证和 OAuth2 是行不通的(请参阅Spring boot oauth2 management …
spring-security jwt spring-boot spring-security-oauth2 spring-boot-actuator