
Originally Posted by
aburgel
What would be useful for me is if RememberMeProcessingFilter also extended AbstractProcessingFilter..... That way it could have the same behavior if the user's credentials are expired.
The trouble with this is AbstractProcessingFilter imposes some abstract methods that don't fit nicely in with the RememberMeProcessingFilter model. This is also the case with BASIC and Digest authentication processing filters.
The other issue is RememberMeServices don't usually through exceptions, such as CredentialsExpiredException. What I have done for you is add the folowing to TokenBasedRememberMeServices:
Code:
// Immediately reject if the user is not allowed to login
if (!userDetails.isAccountNonExpired()
|| !userDetails.isCredentialsNonExpired()
|| !userDetails.isEnabled()) {
cancelCookie(request, response,
"Cookie token[0] contained username '"
+ cookieTokens[0]
+ "' but account has expired, credentials have expired, or user is disabled");
return null;
}
Thus the expired credentials will cause the remembered token to be invalidated, and then the user will presumably attempt to login manually and be handled by the normal expired credentials process.