I am new(ish) to Spring, but have been working with Java for a number of years.
My current project is working with an existing Spring application, and I want to add a few enhancements. One of the things I am working on is adding additional data to the UserDetails.
I have created a new class that extends org.springframework.security.core.userdetails.User by adding additional field. Next, I added a few lines of code to our AuthenticationProvider class, that extends AbstractUserDetailsAuthenticationProvider, so my custom UserDetails object is returned. All seems to run correctly. My problem is understanding how to access this data later in the program - is it actually stored anywhere and is it easy to access?
The problem I am trying to solve is to store some user-specific data that I only want to populate when they login, but keep it for the session.