Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在SpringWebSecurity中使用通配符前面的url授权请求_Spring_Authentication_Spring Security_Restful Authentication - Fatal编程技术网

在SpringWebSecurity中使用通配符前面的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

我有一个表单的rest端点

{pathvariable}/foo/

我想允许访问此url:

httpSecurity
     .authorizeRequests()
        // Allow following urls to be called without authentification
        .antMatchers("**/foo").permitAll()
我在上面尝试的方法不起作用。有人能帮忙吗?

我自己找到的:


.antMatchers(“/{pathvariable:[0-9A-Za-z]+}/comment”)

可能的重复项您可以在自己的答案中的链接中看到,如果您使用的是绝对路径而不是相对路径,它应该可以工作。