Spring webSecurity.ignoring() doesn't ignore custom filter

前端 未结 6 1481
轻奢々
轻奢々 2020-12-06 05:39

I have a set a custom authentication filter in my Spring 4 MVC + Security + Boot project. The filter does it\'s job well and now I want to disable the security for some URI

6条回答
  •  攒了一身酷
    2020-12-06 06:38

    remove @Component on class EAccessAuthenticationFilter,and like this:

    @Override
    protected void configure(HttpSecurity http) throws Exception {
       http.authorizeRequests()
                 .anyRequest().authenticated()
              .and()
                 .addFilterBefore(new EAccessAuthenticationFilter(), BasicAuthenticationFilter.class);
    }
    

    https://github.com/spring-projects/spring-security/issues/3958

提交回复
热议问题