开发者

spring security 2.0.6 AuthenticationProcessingFilter authenticationFailureUrl not working

开发者 https://www.devze.com 2023-01-29 10:16 出处:网络
I solved my issue here. I had forgotten about the following: <beans:bean id=\"authenticationProcessingFilterEntryPoint\" class=\"org.springframework.security.ui.webapp.AuthenticationProcessingFil

I solved my issue here.

I had forgotten about the following:

<beans:bean id="authenticationProcessingFilterEntryPoint" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
    <beans:property name="loginFormUrl" value="/index.jsp" />
    <beans:property name="forceHttps" value="false" />
</beans:bean>

As you can see from above I do have /index.jsp and that is where it is trying to go.

The other issue is the following line

  <concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="true"/>

So this tells me to throw and exception.

So in the end - everything appears to be working as expected.


Original Post:

As the subject states I have the following configuration:

<beans:bean id="authenticationProcessingFilter" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilter">
    <custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
    <beans:property name="defaultTargetUrl" value="/admin/adminLandin开发者_运维知识库g.html"/>
    <beans:property name="authenticationManager" ref="authenticationManager" />
    <beans:property name="authenticationFailureUrl" value="/login.jsp?login_error=1"/>
    <beans:property name="allowSessionCreation" value="true" />
    <beans:property name="targetUrlResolver" ref="roleBasedTargetUrlResolver" />
</beans:bean>

My expectation is that when a authentication fails or has expired that it would make use of the setting for authenticationFailureURL. But what I get is the following error in my log:

The requested resource (/ecotrak/index.jsp) is not available.

I do not understand why it is looking for index.jsp when I have given /login.jsp?login_error=1 as the value.

Any direction it this?

0

精彩评论

暂无评论...
验证码 换一张
取 消