Spring Boot + Spring Security with JPA authentication and MySQL from scratch - Java Brains
HTML-код
- Опубликовано: 2 июн 2024
- Let’s setup a brand new Spring Boot project from scratch with Spring Security that works with database authentication using JPA and connects to a MySQL database. I’ll walk you step-by-step through how to get Spring Security to connect to the MySQL instance using JPA and authenticate users against the user information stored in the database.
Code: github.com/koushikkothagal/sp...
Java Brains website: javabrains.io
#JavaBrains #BrainBytes #HowTo #SpringSecurity #Spring #SpringBoot #Java #Tutorial
Fantastic tutorial, probably the clearest tutorial I've ever watched on a pretty complicated subject. Thank you very much!
wow, these are the best tutorials on Spring Security I have ever found on the Internet. Please keep up the good job :)
Great Job Koushik!!! I like your teaching style and JavaBrains has been my main source of learning SpringBoot and java related stuff lately!!
Highly important guys.. at @01:14
be aware, the role field must be save with "ROLE_" prefix in the DB, (dont know the reason). I wasted alot of time because I entered the authorization role mapping value which is without the "ROLE_" prefix.
thank for the tutorial sir, BIG LIKE!
@Haim you are a life-saver. Spent like 1 hour to find out what was wrong.
BIG THANKS MY MAN!
The hasRole and hasAnyRole methods used for authorizing requests accept parameters starting with "ROLE_". If you look at the java description for these methods, the parameters that are passed will be automatically appended with ROLE_ in the beginning. So definitely your database needs to have data starting with ROLE_ corresponding to role field or wherever you hard-code the authority value. This is my understanding.
Sir, you have made Spring Security so easy to understand. Thank you so much for your efforts😀
Your way of explaining complicated concepts in a simple manner is outstanding! Thank you so much!
This is what is required on RUclips. Kudos sir
Bring full stack courses also. I bet 1 million is not far away then.🙌
I've been struggling with Spring Security for days. Your tutorial made me able to install an authentication system on my app in two hours. THANKS!
I saw the whole spring security basic videos, everything till now was explained well. anyone can easily understand these spring security topics. Thank you for your time and effect
Great start to the weekend.. God bless.. Please cover JWT, OAuth and SAML
You are doing a great service by sharing all these...no praise will ever be enough..👍👍👍
I've watched almost every single video I could find on this subject and this was the clearest and most helpful and actually worked.
Thank you for your help!
I am big fun of your teaching. I don't even want to go for other resources unless I don't find in Java Brains.
I really appreciate your contribution to my life. You are such important to me."live long and God bless you."
Thank you once again, Kaushik for your time and teaching!
You are doing fabulous work Sir...( Y) Hats off to you for giving so much content to the community for free.
Thank you so much! You explain so clearly, much better than all the paid courses online! 😄
Thanks sir, these are the best tutorials on Spring Security I have seen
on the Internet
Thank you so much, its always pleasant to watch your videos, crystal clear, in details and precise to point. Thank you so much for your tutorial.
thank you very much for putting this together. Your explanations are very clear, concise and to the point!
Thanks, this is the clearest from scratch video i found so far..so difficult to explain yet you made it look easy
Clear and simple, managed to implement my own JPA authorization provider thanks to this video. Great Job !
Thank you for uploading such video's.
Really helps a lot in Interviews.
Clearest tutorial with minimum time. Easy to understand. Thank you for wonderful lectures sir.
I have watched a ton of similar videos, but your videos are best by far!
I've been looking for such tutorial. Great video. Thank you!
This was amazing. So well planned and executed and explained wonderfully. You helped me grasp this which I was struggling with based on online text based tutorials that I had found. I will definitely be sending anyone I know trying to learn this as well here!
By Far the Best Explanation of Spring Data JPA with Spring Security...got many concept cleared out of this Tutorial
really good series of tutorials. Great Job! Since spring 6 some things have slightly changed, but you explain the core principles very well. Thanks!
Really AWESOME!! One of the best videos I watched.
This security series is absolutely amazing !! All aspects for each type covered.. 😀👍
Thanks for coming back !!
Epic! Thank you!
Please talk about integration with JWT
yes, eager to watch that integration with JWT,
Yess JWT 🙄🙄🙄🙄🙄
You can find well explained implementations of spring security with JWT in Laurentiu Spilca's spring security playlist:
ruclips.net/video/zA3uxv8RMF0/видео.html
There is pure gold information that really helped me to understand the basics of security for monolith applications and microservices applications.
Hope it will help you! :)
This is one of the best tutorial i have seen in my entire life :D Thank you so much.
Thank you so much! This unblocked me on a problem I was having with my Repository.
The best video for Security. easy to understand and all codes works fine.
Plz Mr make more videos for spring.
The best tutorial i've seen on youtube !! Thanks man !
Nice One Koushik, keep the good work up. With addition to all the information, would like to add, spring by default adds "ROLE_" to whatever the role we are trying to check for the user. Thats why Kaushik has inserted ROLE_USER in the roles column of the user table. Now why we are trying to access different urls, spring check the role using the class ExpressionUrlAuthorizationConfigurer which get called from the overriden method configured having HttpSecurity as parameter. Check the implementation for the method hasRole in the method chaining.
SIR the whole day I've been trying to get this to work... then 10 minutes in this video and it works now. I really thank you a lot!!!
By far the best tutorials on spring security. Thanks a lot
Best video on spring security !! Thanks Kaushik :)
Fantastic tutorial. Well explained and easy to follow along.
Excellent, Thank you Kaushik, May God bless you!
Finished the tutorial! great job and explanation
This is pure awesomeness thankyou very much. Amazing!!!!
Very good tutorial, nice and clear explanations. Thanx a LOT!!
A very informative video on spring security. Thanks a lot. Cheers
Indeed, very well explained! I loved it! Subscribed + Shared!
Great Video. God bless you. Regards from Mexico!
Sir, hatsoff to you.. you made learning spring security enjoyable for me.. being dyslexic I hated spring security..
I never knew . . . Spring Boot Security is this easy . . . thanks to you brother!
Sir, Thanks for you effort to provide us great quality content. I really like your video style. :)
Thanks for your hard effort to make the things done. Awesome
You made it look so easy. Thank you.
really I'm so lucky to find your video that helped me well to understand and learn with simple method the authentication with spring security, really I appreciate your qualified explanation.
big thanks from bottom of my heart ♥
your explanation is so good i wanna cry
Best I've ever seen on youtube .. thks man 😀👍
Yes Correct, read query many times for authentication/authorization, we might consider using LDAP. LDAP has fast read query.
Well, authentication happens only once per session. Also, JPA could be supported by a caching mechanism so that an entity is not looked up more than once.
very good video bout spring security, usage of lamda expression also very nice
this is exactly i was looking for! thanks!
Thank you so much for these videos. They are very helpful ❤❤❤
This is good stuff ! Now my weekend is productive as I learned something new from this ! Long live KK !
Spring Security + JWT Authentication would be superb!
Tjank you so much brother... It was the best spring security tutorial i've ever watched so far...💜
Thanks a lot Prof, you're my best teacher
Great tutorial Sir. Hats Off.
wow , amazing explanation, waiting your video on spring boot with keycloak
Hello , thank you so much for your work ! We ARE waiting for LDAP lessons please :) !
Did anyone try , this project no longer works ? I cloned it and it doesn't work. Says forbidden (403).
Amazing tutorial, thank you for creating this video
Great job Sir. This is what required.. thank you v much.
Great tutorial! Thank you!
Art of coding ,simple and quick
Great tutorial. very clear!
Great effort, great explanation.. Thank you...!
Awesome explanation man,
great tutorial..and happy Onam🙂
thank you so much for the amazing tutorial
Perfect tutorial, thanks so much
very good and useful stuff, Please make some series about reactive programming with spring.
Perfect teaching skills.
Incredibly helpful!
Hello, first of all, great tutorial.
Just needed help with a small doubt. Can you show how did you make the active column in the table empty(valueless) and still not displaying null in the CLI? Thanks.
Early morning .. good start
Great job ! Thank you Sir !
very good tutorial Dear MAN!
It's helped me so much. Thanks.
this man is the greatest of all time!!!
Thanks a lot for this excellent content.
Love the video! thank you!
Please🙏 upload LDAP supported Spring security ... Eager to watch
ruclips.net/video/-wDUChgvYgU/видео.html
more and more and more and more spring please!!!!! thanks a lot
Thank You so much Koushik
Such a good video. Very Nice .
Very nicely explained.
Can you make a tutorial on Spring security + oauth2
Thank you very much sir
It worked very well
very good explained!
Thank you so much Sir !!!
if @Autowired UserDetailsServices in SecurityCnfiguration is showing error it is due to multiple implementations of that interface spring is confused which one to choose.
solutiion :add @Primary annotation above MyUserDataService class that will give preference to your implementation
Or use @Qualifier("myUserDetailsService")
@Autowired
UserDetailsService userDetailsService;
Hey , Thak you for this great video. Could you please start a segment on Spring batch as well.
Sir, you deserve a noble.