How do I use UserDetailsService properly? Where do I define it exactly?
I was going through spring security's docs and found this
while I know this was just an example, how do I properly define userDetailsService and where?
6 Replies
⌛
This post has been reserved for your question.
Hey @Milk Packet! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
It's functional interface and has one abstarct method:
UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;
. You need to implement this interface in any class where you define how a user is retrieved. Mostly from from a database:
Then to use this class in your spring security:
Thank you very much!
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
that helped
Post Closed
This post has been closed by <@579190367186845708>.