I am learning about Spring Security. I found that Spring Security provided me with an Interface UserDetails and this implement org.springframework.security.core.userdetails.User. Can I extend this implement as an entity in my program? Thanks.
I am learning about Spring Security. I found that Spring Security provided me with an Interface UserDetails and this implement org.springframework.security.core.userdetails.User. Can I extend this implement as an entity in my program? Thanks.
yes you can but Creating your Own entity with implementing interface UserDetail will give you more Flexibility then extending User Class. because if you just extend out User Entity you are blocking the other multiple inheritance in future.but implementing UserDetail Interface can Facilitate you multiple inheritance with our own customization in your entity class here is the link :- SPRING: Add custom user details to spring security user