0
我有一個基本身份驗證已存在的spring引導REST服務。我有Hystrix集成到短路外部服務和儀表板來監控相同。但是,如何爲管理員用戶保護Hystrix儀表板?Spring Boot - 如何爲管理員用戶保護Hystrix之類的儀表板
謝謝, 阿倫。
我有一個基本身份驗證已存在的spring引導REST服務。我有Hystrix集成到短路外部服務和儀表板來監控相同。但是,如何爲管理員用戶保護Hystrix儀表板?Spring Boot - 如何爲管理員用戶保護Hystrix之類的儀表板
謝謝, 阿倫。
配置Spring Security以強制執行/hystrix
端點的基本身份驗證。例如:
@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(final HttpSecurity http) throws Exception {
http.httpBasic()
.and()
.authorizeRequests()
.antMatchers("/hystrix")
.authenticated();
}
}
我已經加入。當我提供證書時,它與url localhost:8080/hystrix一起工作。但是,一旦我輸入「/hystrix.stream」並點擊「監視器」,它也會進行身份驗證。基本上,它會在儀表板屏幕上進行所有請求(AJAX調用)的驗證,以便無法提供信用。我的服務是STATELESS。 –
這隻驗證「/ hystrix」。如果您像這樣配置安全性,則Stream端點不需要身份驗證。 –
它不適用於以下安全配置。 。而()。sessionManagement()。sessionCreationPolicy(SessionCreationPolicy.STATELESS) –