Spring security Spring Security permitall在发送授权标头时拒绝访问

Spring security Spring Security permitall在发送授权标头时拒绝访问,spring-security,Spring Security,我的安全配置如下: http.authorizeRequests().antMatchers("/authenticate").fullyAuthenticated().anyRequest().permitAll().and().httpBasic(); 它可以工作,除了/authenticate之外的所有端点都不安全。但是,当客户端向任何不安全的端点发送授权头时,Spring Security将返回401 curl -s -u asdf:asdf http://127.0.0.1:2200

我的安全配置如下:

http.authorizeRequests().antMatchers("/authenticate").fullyAuthenticated().anyRequest().permitAll().and().httpBasic();
它可以工作,除了
/authenticate
之外的所有端点都不安全。但是,当客户端向任何不安全的端点发送
授权
头时,Spring Security将返回
401

curl -s -u asdf:asdf http://127.0.0.1:22000/info
{"timestamp":1511348485989,"status":401,"error":"Unauthorized","message":"Bad credentials","path":"/info"}
如果发送了不安全端点上的
授权
,我必须如何配置安全性以忽略它


提前感谢

AFAIK这是不可能的。基本身份验证筛选器不知道该URl允许匿名用户使用,因此无法处理此情况。它只是尝试使用请求中提供的用户名和密码对用户进行身份验证