【发布时间】:2019-10-28 23:28:44
【问题描述】:
我只想允许来自 localhost 的特定 URL 模式的请求。到目前为止我试过这个:
<sec:intercept-url pattern="/blabla/**" access="hasIpAddress('127.0.0.1')" />
但这不起作用,我在日志输出中得到以下语句:
Access is denied (user is anonymous); redirecting to authentication entry point
所以我的问题是,我如何只允许来自本地主机的匿名用户访问?
【问题讨论】:
-
尝试添加IP为
<sec:intercept-url pattern="/blabla/**" access="hasIpAddress('127.0.0.1:portnumber')" />的端口号
标签: java spring spring-security