1
我需要启用基本身份验证到http://localhost:8080/hystrix.stream。如何对Hystrix.stream启用Spring Boot Security基本身份验证?
我添加了Spring Security它保护除hystrix.stream以外的所有其他端点。
是否可以通过Spring Boot Security基本身份验证来保护hystrix.stream。
我需要启用基本身份验证到http://localhost:8080/hystrix.stream。如何对Hystrix.stream启用Spring Boot Security基本身份验证?
我添加了Spring Security它保护除hystrix.stream以外的所有其他端点。
是否可以通过Spring Boot Security基本身份验证来保护hystrix.stream。
首先,您需要启用安全为您管理的端点:
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {
http
.antMatcher("/**")
.authorizeRequests()
.antMatchers("/hystrix.stream")
.authenticated(); // or whatever you like in here
// rest of your security config
}
}
:
management.security.enabled = true
接下来,就像你对任何其他端点你可以配置访问hystrix.stream