Announcement Announcement Module
Collapse
No announcement yet.
different logon error pages ? Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • different logon error pages ?

    i have this authenticationProcessingFilter config:

    <bean id="authenticationProcessingFilter"
    class="net.sf.acegisecurity.ui.webapp.Authenticati onProcessingFilter">
    <property name="filterProcessesUrl">
    <value>/j_acegi_security_check</value>
    </property>
    <property name="authenticationFailureUrl">
    <value>/logon.do?failed=true</value>
    </property>
    <property name="alwaysUseDefaultTargetUrl">
    <value>true</value>
    </property>
    <property name="defaultTargetUrl">
    <value>/user_logon.do</value>
    </property>
    <property name="authenticationManager">
    <ref bean="authenticationManager" />
    </property>
    </bean>

    but i want to show different authenticationFailureUrl depending if user has given wrong credentials or he's disabled, how can i do this ? thanks
    tom.

  • #2
    hi,

    I think you can use the exceptionMappings Properties to map Authentication Exception classes to different URLs.

    Here is waht I found in acegi's code :
    Code:
    String failureUrl = exceptionMappings.getProperty&#40;failed.getClass&#40;&#41;.getName&#40;&#41;,authenticationFailureUrl&#41;;
    I guess all exception must be subclasses of net.sf.acegisecurity.AuthenticationException
    and it lets you those choices :

    AccountExpiredException,
    AuthenticationCredentialsNotFoundException, AuthenticationServiceException,
    BadCredentialsException,
    ConcurrentLoginException,
    CredentialsExpiredException,
    DisabledException,
    InsufficientAuthenticationException,
    LockedException,
    NonceExpiredException,
    ProviderNotFoundException,
    ProxyUntrustedException[/url]

    Comment


    • #3
      Originally posted by paskos
      I think you can use the exceptionMappings Properties to map Authentication Exception classes to different URLs
      This is correct. See AbstractProcessingFilter.exceptionMappings.

      Comment

      Working...
      X