zoukankan      html  css  js  c++  java
  • ResourceServerConfig过滤器优先级

    @Configuration
    @EnableResourceServer
    public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
        private final JsonToUrlEncodedAuthenticationFilter jsonFilter;
        private final LogFilter logFilter;
        private final HLandraySsoFilter hLandraySsoFilter;
    
        @Autowired
        public ResourceServerConfig(JsonToUrlEncodedAuthenticationFilter jsonFilter, LogFilter logFilter, HLandraySsoFilter hLandraySsoFilter) {
            this.jsonFilter = jsonFilter;
            this.logFilter = logFilter;
            this.hLandraySsoFilter = hLandraySsoFilter;
        }
    
        @Override
        public void configure(HttpSecurity http) throws Exception {
            http.requestMatchers().antMatchers("/api/**", "/token/**", "/sso/**",
                    "/hSsoCallback**", "/hOldSsoCallback**", "/hOldSsoRedirect**")
                    .and() //允许上面这些接口访问
                    .authorizeRequests().antMatchers("/api/aes/**").permitAll().and()  //"/api/aes/**"的接口请求不需要auth校验
                    .authorizeRequests()
                    .antMatchers("/api/**").authenticated(); //"/api/**"需要auth校验
    //
    -2147483648

    http.addFilterBefore(logFilter, ChannelProcessingFilter.class);
    //未配置@Order ,默认为
    ChannelProcessingFilter.class的Order减1
    http.addFilterBefore(new ClientInfoFilter(), ChannelProcessingFilter.class); 
    //
    0x80000000(16进制)=2147483648(十进制)
    http.addFilterBefore(jsonFilter, ChannelProcessingFilter.class); 
    http.addFilterBefore(
    new SimpleCorsFilter(), ChannelProcessingFilter.class);
    http.addFilterBefore(hLandraySsoFilter, ChannelProcessingFilter.
    class); } }
  • 相关阅读:
    MongoDB 数组操作
    XPath 详解,总结
    关于python文件操作
    python-时间模块
    MongoDB使用小结:一些常用操作分享
    python操作MongoDB
    Python中的random模块
    网络基本概念
    .net微信开发
    winform listview用法
  • 原文地址:https://www.cnblogs.com/zaierzai/p/14331192.html
Copyright © 2011-2022 走看看