0

Spring Security 中是否有任何简单的方法可以锁定@Controller仅接受来自同一(本地)主机的请求?

我在看这篇文章: Securing servlet URL without using username password authentication

但是,我想知道这是否是实际的最佳实践与其他一些安全措施。

4

1 回答 1

3

您可以hasIpAddress在过滤器安全拦截器中使用表达式。

<http use-expressions="true">
    <intercept-url pattern="/**" access="hasIpAddress('127.0.0.1/32')"/>
    ...
</http>
于 2013-11-05T18:54:31.257 回答