Support credentialsExpiredUrl as per request made in http://forum.springframework.org/viewtopic.php?t=3862.

This commit is contained in:
Ben Alex 2005-03-07 12:23:48 +00:00
parent 74d66aa2f1
commit 051a34f859
1 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import net.sf.acegisecurity.AuthenticationException;
import net.sf.acegisecurity.AuthenticationManager;
import net.sf.acegisecurity.AuthenticationServiceException;
import net.sf.acegisecurity.BadCredentialsException;
import net.sf.acegisecurity.CredentialsExpiredException;
import net.sf.acegisecurity.DisabledException;
import net.sf.acegisecurity.LockedException;
import net.sf.acegisecurity.context.ContextHolder;
@ -144,6 +145,7 @@ public abstract class AbstractProcessingFilter implements Filter,
* the authentication service
*/
private String authenticationServiceFailureUrl;
private String credentialsExpiredFailureUrl;
/**
* Where to redirect the browser to if authentication is successful but
@ -490,6 +492,11 @@ public abstract class AbstractProcessingFilter implements Filter,
failureUrl = authenticationProxyUntrustedFailureUrl;
}
if (failed instanceof CredentialsExpiredException
&& (credentialsExpiredFailureUrl != null)) {
failureUrl = credentialsExpiredFailureUrl;
}
if (logger.isDebugEnabled()) {
logger.debug("Authentication request failed: " + failed.toString());
}