I am using the Spring Security plugin and the Spring Security REST plugin for a Grails application and trying to implement a password change policy. On the front-end, our application is catching the 401 error when you're not logged in, but the case where your password has expired gives exactly the same HTTP response. I'm looking to see if there's a way to change it.
I can catch the AbstractAuthenticationFailureEvent and figure out if it was due to an AuthenticationFailureCredentialsExpired event, but I don't know how to get that event to send anything meaningful out of the API that indicates that this wasn't just a failed password login.
As an aside, I can expire passwords and enforce that policy, so that's not the issue. The primary issue is how a consumer of this API can differentiate between a failed username/password challenge and a "you need to change your password" scenario.