When I authenticate using j_acegi_security_check and enter a user name that
doesn't exist, it seems like the

UsernameNotFoundException must be getting caught and the
authenticationFailureUrl page is brought up.

That's great.

 

But when I switch users using  j_acegi_switch_user and an invalid user name
is entered, the UsernameNotFoundException

Isn't being caught.  And the switchUserProcessingFilter doesn't have a
setter to define an authenticationFailureUrl.

 

Is there some configuration that I can easily make to redirect to an error
page?
Or do I need to extend from SwitchUserProcessingFilter to achieve this
behavior.

----------------------------------------------------------------------------
-----------------

 

        <bean id="filterChainProxy"
class="org.acegisecurity.util.FilterChainProxy">

            <property name="filterInvocationDefinitionSource">

                <value>

                    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON

                    PATTERN_TYPE_APACHE_ANT

 
/**=httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessin
gFilter,securityContextHolderAwareRequestFilter,rememberMeProcessingFilter,a
nonymousProcessingFilter,switchUserProcessingFilter,exceptionTranslationFilt
er,filterInvocationInterceptor

                </value>

            </property>

       </bean>

 

       <bean id="authenticationProcessingFilter"
class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">

          <property name="authenticationManager"
ref="authenticationManager"/>

          <property name="authenticationFailureUrl"
value="../demo/Login.do?errorId=1"/>

          <property name="defaultTargetUrl" value="/"/>

          <property name="filterProcessesUrl"
value="/j_acegi_security_check"/>

          <property name="rememberMeServices" ref="rememberMeServices"/>

       </bean>

 

      <bean id="switchUserProcessingFilter"
class="org.acegisecurity.ui.switchuser.SwitchUserProcessingFilter">

         <property name="userDetailsService" ref="userDetailsService" />

         <property
name="switchUserUrl"><value>/j_acegi_switch_user</value></property>

         <property
name="exitUserUrl"><value>/j_acegi_exit_user</value></property>

         <property
name="targetUrl"><value>/secure/authenticateduser.do</value></property>

      </bean>

 

 

Thanks

 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer

Reply via email to