Spring Security列表允许的URI或检查是否允许uri

时间:2019-06-10 04:28:55

标签: java spring-boot spring-security

假设我的WebSecurityConfigurerAdapter中有以下内容

protected void configure(HttpSecurity http) throws Exception {
        http
                .httpBasic().and().authorizeRequests()
                .antMatchers("/login", "/templates/forgotpassword", "/user/forgot-password",
                        "/user/reset-password", "/reset-password/**").permitAll()
                .anyRequest().authenticated()
                .and()
                .csrf()
                .disable();
}

我该怎么办?

  1. 列出已允许的URI。即/login/templates/forgotpassword/user/forgot-password
  2. 或者如果我有一个uri说/login,我该如何检查它是否被允许

0 个答案:

没有答案