Spring security custom AuthenticationException message

前端 未结 4 805
太阳男子
太阳男子 2021-01-01 00:43

Hi i needed to add a new exception in Spring security login form, everything work perfectly except that i want to have my own error message (until now it display the \"wrong

4条回答
  •  悲&欢浪女
    2021-01-01 01:21

    In your messages.properties (or whatever you named it), add a line like:

    AbstractUserDetailsAuthenticationProvider.badCredentials=The credentials you supplied are invalid.
    

    You don't need a CustomAuthenticationException.

提交回复
热议问题