This is a continuation of this issue .
I have a custom AuthenticationProvider that extends AbstractUserDetailsAuthenticationProvider. At addAuthenticationChecks, I do some of my own authentication work, and part of this process is to display some messages to the user on the login screen. Currently, for testing, I have created a UserNotActivatedException:
class UserNotActivatedException extends AuthenticationException { public UserNotActivatedException(String message, Throwable t) { super(message, t) } public UserNotActivatedException(String message) { super(message) } public UserNotActivatedException(String message, Object extraInformation) { super(message, extraInformation) } }
And in addAuthenticationChecks I just drop it for testing. Now I need to know what I need to do so that my own error message appears on the login screen. In the spring-security-core default configuration, we can override the following:
errors.login.disabled = "Sorry, your account is disabled." errors.login.expired = "Sorry, your account has expired." errors.login.passwordExpired = "Sorry, your password has expired." errors.login.locked = "Sorry, your account is locked." errors.login.fail = "Sorry, we were not able to find a user with that username and password."
But I do not see how to add my own additional messages.
Gregg source share