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
JavaBot
JavaBot3w ago
This post has been reserved for your question.
Hey @All Might! Please use /close or the Close 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.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
All Might
All MightOP3w ago
this is the file structure of my project.
No description
All Might
All MightOP3w ago
UserEntity is linkedto users table in database and implements UserDetails. MyUserEntity extends User (the default user class in spring security)
All Might
All MightOP3w ago
UserServiceImpl implements UserService, UserDetailsService The above picture is of the loadUserByUserName method overriden in the UserServiceImpl class.
No description
All Might
All MightOP3w ago
Someone please help
JavaBot
JavaBot3w ago
Post Closed
This post has been closed by <@743072402702860358> for the following reason:
User left the server

Did you find this page helpful?