It's very very good , God Blast You ! it the first time I understand the concept of spring security whit you ,your explain and you flow the steeps by steeps Thanks Sir !
Done thanks Todo Rewatch and take notes Implementing UserDetailsService and UserDetails UserDetails implementation class just takes our user JPA entity and uses it to return values from the UserDetails methods
getAuthorities() should be written in a different way, you can use collect in place of modifiying the list in a lambda expression. Yes everytime we hear that it was just for explaining something and not in a real world, but when can we learn the best practice if not when learning? beside that your playlist is very well explained.
hi . i really like your videos .but why you have such a directory in most of the spring boot vids .. db , controller , ect .. can you please name them more seperatly because thats much clearer for begginers .. me and my class mates watch your videos and we learn alot but when it came to the directory... the one we use in university is much easier : service,controller,dao,entities,repository,...ect keep up the good work & thank you ❤👌
How would I go about retrieving the current logged in user by id? Pass a getId into the userDetails or the loadbyusername method? SO in the controller I have User user = (User)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); model.addAttribute("username", user); Then retrieve in thymeleaf with something like Name
In the database suppose I have multiple users with same username but different password. Then how I can get the correct user by the username and password. Here you are getting the user by its username only. But I need to fetch the user by its username and password both in the userdetails. How can I do this?
that is plain stupid. but if you are still using that approach you are going to get all users with the same username and you are going to get that one distinct user which request password and password hash match.