【发布时间】:2020-06-05 17:48:44
【问题描述】:
我有这个过滤器:
@Override
protected void configure(HttpSecurity http) throws Exception {
http.requestMatchers(new RequestHeaderRequestMatcher("Caller", "Rem"));
// add here a seconde filter condition for basic Auth
}
在标题过滤器之后,我想在相同的配置中使用下面的标识符 inMemory 创建另一个过滤器:
@Autowired
public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication()
.passwordEncoder(NoOpPasswordEncoder.getInstance())
.withUser("myAccount").password("MyPassword").roles("USER");
}
非常感谢。
【问题讨论】:
标签: java spring-boot spring-security basic-authentication request-headers