gpt4 book ai didi

spring-security - Spring 安全: how to exclude certain resources?

转载 作者:行者123 更新时间:2023-12-03 07:21:43 25 4
gpt4 key购买 nike

我有以下定义...

    <bean id="fsi" class="org.springframework.security.intercept.web.FilterSecurityInterceptor">
<property name="authenticationManager" ref="authenticationManager"/>
<property name="accessDecisionManager" ref="httpRequestAccessDecisionManager"/>
<property name="objectDefinitionSource">
<sec:filter-invocation-definition-source >
<sec:intercept-url pattern="/secure/css/**" access="ROLE_TIER0"/>
<sec:intercept-url pattern="/secure/images/**" access="ROLE_TIER0"/>
<sec:intercept-url pattern="/**" access="ROLE_TIER0"/>
</sec:filter-invocation-definition-source>
</property>
</bean>

我想要此网址上的资源...

“/非安全/**”

对所有调用开放,即没有安全保障。

我尝试添加...

<sec:intercept-url pattern="/nonsecure/**" access="permitAll" />

但这会导致 Websphere 抛出有关

的错误
Unsupported configuration attributes: [permitAll] 

谁能告诉我如何从安全性中排除此网址?

最佳答案

在 spring security 3.1.x 中,不推荐使用filters="none"。相反,您使用多个 <http>像这样的标签:

<http pattern="/nonsecure/**" security="none"/>

http://static.springsource.org/spring-security/site/docs/3.1.x/reference/springsecurity-single.html#ns-form-and-basic

关于spring-security - Spring 安全: how to exclude certain resources?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3394657/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com