How do you display Spring Security Login error messages using custom login thymeleaf page and controller?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How do you display Spring Security Login error messages using custom login thymeleaf page and controller?

ShinobiSlayer
Hi,

How do you display Spring Security Login error messages using thymeleaf please?

Example If you let Spring security supply the login page and you have a failed login you get the following messages

Your login attempt was not successful, try again.

Reason: Bad credentials

Login with Username and Password

How are these spring security error messages displayed using thymeleaf and a customer login controller and thymeleaf login page?

Thanks
 
Reply | Threaded
Open this post in threaded view
|

Re: How do you display Spring Security Login error messages using custom login thymeleaf page and controller?

ShinobiSlayer
Thank you for being so helpful
Reply | Threaded
Open this post in threaded view
|

Re: How do you display Spring Security Login error messages using custom login thymeleaf page and controller?

Zemi
Administrator
Hello,

Are you using the Spring Security Dialect?
  https://github.com/thymeleaf/thymeleaf-extras-springsecurity

You can also take a look at this article and its companion sample application
  http://www.thymeleaf.org/doc/articles/springsecurity.html

Regards,
  Zemi