在spring web security

时间:2017-06-08 12:03:08

标签: spring authentication spring-security restful-authentication

我有一个表格的休息端点

{pathvariable} /富/

我希望允许访问此网址:

httpSecurity
     .authorizeRequests()
        // Allow following urls to be called without authentification
        .antMatchers("**/foo").permitAll()

我上面尝试的是不行的。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

自己发现:http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/util/AntPathMatcher.html

.antMatchers(" / {pathvariable:[0-9A-ZA-Z] +} /注释&#34)