2
我有一个Spring Boot应用程序,提供安全的Restful Web服务。它的工作原理以及与它自己的WebSecurityConfigurerAdapter
级以下HttpSecurity
配置:为授权和非授权的宁静服务配置Spring安全
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
http.authorizeRequests()
.antMatchers("/secure/**").hasRole(ROLE_XXX)
.anyRequest().authenticated().and().httpBasic();
}
此配置强制所有的web服务,以/secure
下授权。 现在我想添加另一个webservice,比如/public/test
,这可以在没有任何验证的情况下调用。有什么建议么 ?