I’m sorry to questioning this maybe there was the same question already, I’m already browse the internet to had this answer. But I can found answer that satisfied me enough and the question is not about what I’am asking. So I’am asking to you all here.
I had used spring boot about 1-2 years, but all that was about developing CRUD and business logic. I’m never configured some security with JWT, so I thought I wanted to learn about this. And I found pretty much stuff in the internet, but some cases show me that User entity class implement the User Details from Spring Security. So are this was the recommended way to do this? and I want to know the best practice how to implement User Details from Spring Security?
Is this recommended or not?
@Entity
@Table("name" = "users")
//some lombok annotation
public class Users implements UserDetails {
//some attribute
}
or I can configure it separately?
Users Entity Class
@Entity
@Table("name" = "users")
//some lombok annotation
public class Users {
//some attribute
}
UserDetailsServiceImpl class
//some spring boot annotation
//some lombok annotation
public class UserDetailsServiceImpl implements UserDetails {
//some implemented methods
}
So what is the best practice and the recommended way?
It’s my pleasure to know the answer.