Spring security 如何设置才能避免拦截到静态资源

问题:继承FilterSecurityInterceptor自定义Spring security拦截器,但是每次都拦截了css等静态资源,应该如何设置?

@Override
protected void configure(HttpSecurity http) throws Exception{
    http
              .authorizeRequests()
              .anyRequest().authenticated()
              .and()
              // 登录地址,成功跳转地址,登陆失败地址
              .formLogin().loginPage("/login")
              .defaultSuccessUrl("/",true)
              .failureUrl("/login?error")
              // 授予所有用户以上地址的访问权限
              .permitAll();

     // 设置可以iframe访问
    http.headers().frameOptions().sameOrigin();    
}         
 

posted on 2018-08-01 20:20  zzzhouheng  阅读(1613)  评论(0编辑  收藏  举报

导航