Support credentialsExpiredUrl as per request made in http://forum.springframework.org/viewtopic.php?t=3862.
This commit is contained in:
parent
74d66aa2f1
commit
051a34f859
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue