I have a pretty normal spring security setup (using spring boot) where all the form login is using a ajax based approach (no redirect, etc), and this is working fine for form login.
For basic authentication I want to now also properly handle failed login attempts, and there seems to be some issues here: I can't rely on ControllerAdvice
to catch the exceptions anymore which is fine, I tried a custom BasicAuthenticationEntryPoint
to do some changes... but all I could do from there was to change the actual exception being thrown.. it was still not being caught by my controller advice.
So what I'm wondering, I understand that spring security works outside of the spring mvc/advice world, so how can I catch and change the default message that is being sent to the user? (for basic auth, for form/session, this is already working fine..)