我正在尝试对某些URL进行匿名访问,这是代码:
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/","/boutique**","/proprietaires**","/produits**").permitAll()
.and().authorizeRequests().anyRequest().fullyAuthenticated().and().httpBasic().and().csrf().disable();
}
但是它仍然会显示“ 401”错误。
有人可以告诉我我所缺少的吗?
答案 0 :(得分:0)
它必须:antMatchers("/","/boutique/**","/proprietaires/**","/produits/**"
。您错过了/