I am new to Spring Security. I have a Spring Boot application with two different types of entities. Customers and employees. In Employees I have normal employees, admins and super users. Since I am using JPA, each entity has its own repository
. How to model my UserDetailsService
with loadUserByUsername
since this is a common method to validate against many repositories. Is there anything that I am missing to model around my entities?
Additional Info:
In my design, I have two entities. Customer
and Employee
. Employee
will have roles like NORMAL
, ADMIN
and SUPER_USER
. Customer is a different entity.
Will there be two UserDetailsService
and two AuthenticationProvider each pointing to its own table (Customer and Employee)?