【问题标题】:Spring security url-interceptorSpring 安全 url 拦截器
【发布时间】:2014-11-27 23:16:09
【问题描述】:

我有以下代码:

<intercept-url pattern="/authenticated/**/" access="isAuthenticated()" />
<intercept-url pattern="/authenticated/files/**" access="none" />

我希望 Spring Security 保护除 authenticated/files 之外的所有源自 /authenticated 的链接。这种类型的保护可能吗?

【问题讨论】:

    标签: spring jsp spring-security


    【解决方案1】:

    将更具体的条件上移:

    <http use-expressions="true">
        <intercept-url pattern="/authenticated/files/**" access="permitAll" />
        <intercept-url pattern="/authenticated/**" access="isAuthenticated()" />
        ...
    </http>
    

    【讨论】:

      猜你喜欢
      • 2014-07-18
      • 2013-05-06
      • 2020-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-09
      • 1970-01-01
      • 2017-09-13
      相关资源
      最近更新 更多