Additional Fields in spring security
https://stackoverflow.com/questions/45546327/get-current-users-extra-information-by-thymeleaf-sec-tag-working-with-spring-se
I'm trying to make a project where you can view your additional fields or information like first name, last name etc in the webpage. Using <p><span sec:authentication="principal.firstname"></span></p> didn't help either. It said that user object has no such field.
I already created custom spring security user but now it doesn't take any passwords and doesn't allow login. username and password i entered are correct.
The above link i posted is the solution to my question but i still can't get it to work.
This is not for login purpose. Only for displaying information from the database (firstname lastname email etc)
Stack Overflow
Get current user's extra information by thymeleaf sec tag working w...
I'm using thymeleaf-extras-springsecurity4 with spring security on my project. The problem is I cannot get user's extra fields (which means user information on database except username, password, e...
6 Replies
⌛
This post has been reserved for your question.
Hey @All Might! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
this is the file structure of my project.

UserEntity is linkedto users table in database and implements UserDetails.
MyUserEntity extends User (the default user class in spring security)
UserServiceImpl implements UserService, UserDetailsService
The above picture is of the loadUserByUserName method overriden in the UserServiceImpl class.

Someone please help
Post Closed
This post has been closed by <@743072402702860358> for the following reason:
User left the server