在SpringWebSecurity中使用通配符前面的url授权请求
我有一个表单的rest端点 {pathvariable}/foo/ 我想允许访问此url:在SpringWebSecurity中使用通配符前面的url授权请求,spring,authentication,spring-security,restful-authentication,Spring,Authentication,Spring Security,Restful Authentication,我有一个表单的rest端点 {pathvariable}/foo/ 我想允许访问此url: httpSecurity .authorizeRequests() // Allow following urls to be called without authentification .antMatchers("**/foo").permitAll() 我在上面尝试的方法不起作用。有人能帮忙吗?我自己找到的: .antMatchers(“/{pathva
httpSecurity
.authorizeRequests()
// Allow following urls to be called without authentification
.antMatchers("**/foo").permitAll()
我在上面尝试的方法不起作用。有人能帮忙吗?我自己找到的:
.antMatchers(“/{pathvariable:[0-9A-Za-z]+}/comment”)可能的重复项您可以在自己的答案中的链接中看到,如果您使用的是绝对路径而不是相对路径,它应该可以工作。