permitAll()仍然需要
Authentication对象存在
SecurityContext。
对于非oauth用户,可以通过启用匿名访问来实现:
@Overridepublic void configure(HttpSecurity http) throws Exception { http//some configuration .and() .anonymous() //allow anonymous access .and() .authorizeRequests().antMatchers("/views/**").permitAll()//other security settings匿名访问将
AnonymousAuthenticationFilter在过滤器链中添加其他过滤器:
AnonymousAuthenticationToken在没有
Authentication对象的情况下填充为身份验证信息
SecurityContext



