Forcing user to change expired password
I know there have been several threads about how to force a user to change an expired password, but all of them require you to override a lot of base Acegi classes because the AbstractUserDetailsAuthenticationProvider.authenti cate() method throws CredentialsExpiredException before the user is authenticated.
http://forum.springframework.org/sho...hange+password
http://forum.springframework.org/sho...hange+password
http://forum.springframework.org/sho...hange+password
http://forum.springframework.org/sho...re dException
It seems like the only way to let a user user sign in and then force them to change their password is to:
1. Override AbstractDaoAuthenticationProvider.authenticate and comment out:
Code:
if (!user.isCredentialsNonExpired()) {
throw new CredentialsExpiredException(messages.getMessage("AbstractUserDetailsAuthenticationProvider.credentialsExpired", "User credentials have expired"));
}
2. Create a new filter and add it to the end of the filter proxy chain and redirect the user to a changePassword page if userDetails.isCredentialsExpired() == false.
Has anyone implemented this functionality without overriding the authenticate() method?
Thanks