I have a Spring Boot application that uses Spring Security and Thymeleaf template. I am trying to display the logged-in user\'s first name and last name in a template when t
As @B378 said, When using Spring Security 4 and Thymeleaf 3: you have to use following.
Because spring security uses UserDetails internally. And UserDetails contains one function called getUsername().