对于 Spring Security 3.1,我有以下映射:
<security:http create-session="ifRequired" auto-config="false" disable-url-rewriting="true" entry-point-ref="authenticationProcessingFilterEntryPoint">
<security:intercept-url pattern="/publicAccess" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<security:logout logout-url="/logout" invalidate-session="true" delete-cookies="true" logout-success-url="/thanks" />
<security:session-management invalid-session-url="/login" session-authentication-error-url="/accessdenied">
<security:concurrency-control max-sessions="1" expired-url="/login?session=expired" />
</security:session-management>
</security:http>
情况是,当我有一段时间没有进行活动或重新启动服务器时,我会被定向到/login
映射。这是正确的,因为invalid-session-url="/login"
. 但它也将我重定向到/login
公共 URL 访问,例如/publicAccess
.
我希望公共 URL 直接打开,即使没有会话或会话无效。我怎样才能做到这一点?