Тёмный

[Spring Boot Security] #19 Database Authentication - Implement User Details Service 

Dan Geabunea (Romanian Coder)
Подписаться 19 тыс.
Просмотров 33 тыс.
50% 1

Опубликовано:

 

15 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 17   
@Lukas-di1cw
@Lukas-di1cw 3 года назад
You are doing a great job with those short video snippets! Very helpful! Thanks! :))
@websimo1000
@websimo1000 5 лет назад
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 !
@mostinho7
@mostinho7 4 года назад
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
@momedalhouma14
@momedalhouma14 5 лет назад
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.
@DanielBRLima
@DanielBRLima 5 лет назад
Another excellent video! Awesome!
@mabt-tech
@mabt-tech 5 лет назад
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 ❤👌
@AlexSenichek
@AlexSenichek 4 года назад
Nice one. Thank you.
@grantmurphy7965
@grantmurphy7965 5 лет назад
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
@avinashkafle
@avinashkafle 5 лет назад
Why not use @Autowire instead ? while creating User dependency ? EDIT: Is there a way to use @Autowire for parameterize constructor?
@RomanianCoder
@RomanianCoder 5 лет назад
You could use @autowired. But it is not best practice. Better to declare dependencies inbthe conatructor.
@zaaap0
@zaaap0 4 года назад
Autowire constructor and add object as parameter
@mohanbera2044
@mohanbera2044 4 года назад
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?
@dillynlakey6420
@dillynlakey6420 2 года назад
usually you cant make an account with an existing username
@pemifo260
@pemifo260 Месяц назад
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.
@AndriusLau
@AndriusLau 3 года назад
Can User(Entity) directly implement UserDetails?
@GidzPaul
@GidzPaul 3 года назад
Not advised to mix database models and the domain models.
@zaaap0
@zaaap0 4 года назад
this. in decorator methods is obsolete
Далее
New Race ? 🪽| Doge Gaming
00:12
Просмотров 1,5 млн
Hibernate & JPA Tutorial - Crash Course
24:27
Просмотров 100 тыс.
How Spring Security Authentication works - Java Brains
19:36