spring security http antMatcher with multiple paths

后端 未结 2 823
半阙折子戏
半阙折子戏 2020-12-29 22:45

I have the following spring security java config rule (with version 3.2.4) which works:

http.antMatcher(\"/lti1p/**\")
    .addFilterBefore(ltioAuthProviderP         


        
相关标签:
2条回答
  • 2020-12-29 22:51

    Try the following approach:

    http 
      .requestMatchers()
           .antMatchers("/lti1p/**","/lti2p/**")
           .and()
      .addFilterBefore(ltioAuthProviderProcessingFilter, UsernamePasswordAuthenticationFilter.class)
      .authorizeRequests().anyRequest().hasRole("LTI")
      .and().csrf().disable();
    
    0 讨论(0)
  • 2020-12-29 23:07

    Try:

    .antMatchers("/lti1p/**").hasRole("LTI")
    .antMatchers("/lti2p/**").hasRole("LTI")
    
    0 讨论(0)
提交回复
热议问题