Posts

Showing posts from April, 2025

Thymeleaf + Spring Security integration basics

  Thymeleaf + Spring Security integration basics Written by José Miguel Samper <jmiguelsamper AT users.sourceforge.net> Have you switched to Thymeleaf but your login and error pages are still using JSP? In this article we will see how to configure your Spring application to use Thymeleaf for login and error pages. All the code seen here comes from a working application. You can view or download the source code from  its GitHub repo . Note  that the Thymeleaf integration packages for Spring Security support both Spring MVC and Spring WebFlux applications since Spring Security 5, but this article will focus on a Spring MVC configuration. Prerequisites We assume you are familiar with Thymeleaf and Spring Security, and you have a working application using these technologies. If you don’t know Spring Security, you could be interested on reading the  Spring Security Documentation . Login pages With Spring Security you could specify any URL to act as a login page, jus...

inside login page : how to redirect another page & allow to authentication ??

   <a sec:authorize="hasAnyAuthority('ROLE_USER')" th:href="@{/index}"> <p class="viewAccount" >  View Account   </p></a> ---------------------------------------------------------------------------------------------------------------------- <div sec:authorize="isAuthenticated()" id="id02" class="modal">  ....................................... </div>