How can I intercept authentication failures when using @EnableZuulProxy + @EnableOAuth2Sso annotations?
I have an authorization server that authenticates the users against a Microsoft Active Directory server. As I could tell, in Spring Cloud the processes goes like this:
- The user tries to access an Angular client through a Zuul proxy server
- The Zuul server checks for the authorization against an authorization server
- The authorization server, in turn, validates the user credentials against a Microsoft Active Directory server and, if necessary, a login page is shown to the user
- The user types in the username and password
- Eventualy, the user's password is expired, and the Microsoft AD answers to the autorization server denying the authentication with a "data 733" code in the error message
- The authorization server sends the authentication error to Zuul server which, in turn, asks for the login page again with a query parameter (/login?error)
What I want to do is change the query parameter in step 6, to something like /login?error_expired, so I can show a message to the user, telling him that he must update his password before going on.
Thanks in advance for any help.