Spring Security中如何在不使用xml的情况下将拦截器与URL匹配?

时间:2018-09-02 23:29:31

标签: spring spring-security

我试图了解Spring Security的授权如何工作。我发现可以通过扩展$groups = auth()->user()->userable->groups()->withCount('students')->pluck('students_count'); $count = $groups->sum(); 来定义自定义过滤器链。但是拦截器到底在哪里与URL匹配?例如,如果我有类似的东西

WebSecurityConfigurerAdapter

在哪里可以通过编程方式确定protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers(""/signup", "/about").permitAll() .antMatchers("/admin/**").hasRole("ADMIN") .antMatchers("/user/**").hasRole("USER") .anyRequest().authenticated(); 的拦截器应为/user/(扩展了CustomInterceptor)?我显然不想在xml文件中执行此操作,而是试图了解其以编程方式工作的方式。

0 个答案:

没有答案
相关问题