Mar*_*rcF 12 spring spring-security
我有以下spring安全配置代码段:
http
.authorizeRequests()
.antMatchers("/tokens").hasIpAddress("10.0.0.0/16")
....
Run Code Online (Sandbox Code Playgroud)
这有效,但我还想从127.0.0.1授予对"/ tokens"的访问权限.我希望下面的内容可行,但它不会:
http
.authorizeRequests()
.antMatchers("/tokens").hasIpAddress("10.0.0.0/16").hasIpAddress("127.0.0.1/32")
....
Run Code Online (Sandbox Code Playgroud)
Mil*_*nka 24
http
.authorizeRequests()
.antMatchers("/tokens").access(
"hasIpAddress('10.0.0.0/16') or hasIpAddress('127.0.0.1/32')")
....
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10476 次 |
| 最近记录: |