Spring Boot + Spring Security with JPA authentication and MySQL from scratch - Java Brains

  Рет қаралды 558,711

Java Brains

Java Brains

Күн бұрын

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

Пікірлер: 457
@sarthakgupta290
@sarthakgupta290 Жыл бұрын
Your way of explaining complicated concepts in a simple manner is outstanding! Thank you so much!
@Sausty
@Sausty 4 жыл бұрын
Fantastic tutorial, probably the clearest tutorial I've ever watched on a pretty complicated subject. Thank you very much!
@haimmichalashvili8251
@haimmichalashvili8251 3 жыл бұрын
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!
@hemantjain8777
@hemantjain8777 3 жыл бұрын
@Haim you are a life-saver. Spent like 1 hour to find out what was wrong.
@alessandrosantana9606
@alessandrosantana9606 Жыл бұрын
BIG THANKS MY MAN!
@swathikota
@swathikota Жыл бұрын
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.
@brhaneweldeslase1289
@brhaneweldeslase1289 4 жыл бұрын
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."
@Sebriniel
@Sebriniel 3 жыл бұрын
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!
@HanilKathuria
@HanilKathuria 4 жыл бұрын
Sir, you have made Spring Security so easy to understand. Thank you so much for your efforts😀
@damianw345
@damianw345 4 жыл бұрын
wow, these are the best tutorials on Spring Security I have ever found on the Internet. Please keep up the good job :)
@manojkanna222
@manojkanna222 2 жыл бұрын
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
@kuljeetkumar4657
@kuljeetkumar4657 4 жыл бұрын
This is what is required on KZfaq. Kudos sir Bring full stack courses also. I bet 1 million is not far away then.🙌
@tsegaighebremedhin5536
@tsegaighebremedhin5536 4 жыл бұрын
Great Job Koushik!!! I like your teaching style and JavaBrains has been my main source of learning SpringBoot and java related stuff lately!!
@bibekdas3592
@bibekdas3592 4 жыл бұрын
You are doing a great service by sharing all these...no praise will ever be enough..👍👍👍
@TomosLeggett
@TomosLeggett Жыл бұрын
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!
@Mohamed-uf5jh
@Mohamed-uf5jh 4 жыл бұрын
Thanks sir, these are the best tutorials on Spring Security I have seen on the Internet
@mohitpatidar8880
@mohitpatidar8880 3 жыл бұрын
You are doing fabulous work Sir...( Y) Hats off to you for giving so much content to the community for free.
@divtosz
@divtosz 4 жыл бұрын
Thank you so much! You explain so clearly, much better than all the paid courses online! 😄
@bendego2800
@bendego2800 3 жыл бұрын
Thanks for coming back !!
@RDSRao
@RDSRao 4 жыл бұрын
Thank you once again, Kaushik for your time and teaching!
@sheelstera
@sheelstera 4 жыл бұрын
Great start to the weekend.. God bless.. Please cover JWT, OAuth and SAML
@deeptiadmile9986
@deeptiadmile9986 4 жыл бұрын
This security series is absolutely amazing !! All aspects for each type covered.. 😀👍
@Torayasu
@Torayasu 2 жыл бұрын
Clear and simple, managed to implement my own JPA authorization provider thanks to this video. Great Job !
@igorgvozdic2769
@igorgvozdic2769 4 жыл бұрын
I have watched a ton of similar videos, but your videos are best by far!
@liferayasif9382
@liferayasif9382 4 жыл бұрын
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.
@orhanyarar7552
@orhanyarar7552 4 жыл бұрын
thank you very much for putting this together. Your explanations are very clear, concise and to the point!
@AnantaAkash.Podder
@AnantaAkash.Podder 7 ай бұрын
By Far the Best Explanation of Spring Data JPA with Spring Security...got many concept cleared out of this Tutorial
@thornton
@thornton 4 жыл бұрын
Thank you so much! This unblocked me on a problem I was having with my Repository.
@DrunkenEngineer
@DrunkenEngineer 4 жыл бұрын
Thank you for uploading such video's. Really helps a lot in Interviews.
@johngalarza-calderon4801
@johngalarza-calderon4801 3 жыл бұрын
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!
@vurihur4533
@vurihur4533 2 жыл бұрын
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!!!
@abhisheksengupta4159
@abhisheksengupta4159 4 жыл бұрын
Best video on spring security !! Thanks Kaushik :)
@shivaakrish
@shivaakrish 2 жыл бұрын
This is one of the best tutorial i have seen in my entire life :D Thank you so much.
@akhilsamineni4628
@akhilsamineni4628 4 жыл бұрын
Really AWESOME!! One of the best videos I watched.
@monishad7040
@monishad7040 4 ай бұрын
Clearest tutorial with minimum time. Easy to understand. Thank you for wonderful lectures sir.
@francogb
@francogb 4 жыл бұрын
Epic! Thank you! Please talk about integration with JWT
@SushilKumarBhaskar
@SushilKumarBhaskar 4 жыл бұрын
yes, eager to watch that integration with JWT,
@sujithg5873
@sujithg5873 4 жыл бұрын
Yess JWT 🙄🙄🙄🙄🙄
@reluscarlat7140
@reluscarlat7140 4 жыл бұрын
You can find well explained implementations of spring security with JWT in Laurentiu Spilca's spring security playlist: kzfaq.info/get/bejne/sKdjqNunnbixdmQ.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! :)
@midhunma8875
@midhunma8875 2 ай бұрын
Thanks, this is the clearest from scratch video i found so far..so difficult to explain yet you made it look easy
@GreatAnubis
@GreatAnubis Жыл бұрын
I've been looking for such tutorial. Great video. Thank you!
@abukasozi295
@abukasozi295 4 жыл бұрын
This is pure awesomeness thankyou very much. Amazing!!!!
@yazidelhachimi1628
@yazidelhachimi1628 2 жыл бұрын
The best tutorial i've seen on youtube !! Thanks man !
@dhananitejendra3151
@dhananitejendra3151 8 ай бұрын
By far the best tutorials on spring security. Thanks a lot
@drawlzlolwlz5953
@drawlzlolwlz5953 3 жыл бұрын
Finished the tutorial! great job and explanation
@mlprasad79
@mlprasad79 4 жыл бұрын
This is good stuff ! Now my weekend is productive as I learned something new from this ! Long live KK !
@ivanetinajero
@ivanetinajero 4 жыл бұрын
Great Video. God bless you. Regards from Mexico!
@Runa_Nura
@Runa_Nura 4 жыл бұрын
The best video for Security. easy to understand and all codes works fine. Plz Mr make more videos for spring.
@dinunclv
@dinunclv 5 ай бұрын
really good series of tutorials. Great Job! Since spring 6 some things have slightly changed, but you explain the core principles very well. Thanks!
@AdrianVrabie
@AdrianVrabie 4 жыл бұрын
Indeed, very well explained! I loved it! Subscribed + Shared!
@SrivatsaLakshmi
@SrivatsaLakshmi 3 жыл бұрын
Fantastic tutorial. Well explained and easy to follow along.
@selvakumarm8948
@selvakumarm8948 4 жыл бұрын
Sir, Thanks for you effort to provide us great quality content. I really like your video style. :)
@AshenafiMaru-ul3rg
@AshenafiMaru-ul3rg Жыл бұрын
I never knew . . . Spring Boot Security is this easy . . . thanks to you brother!
@priyankjoshi3018
@priyankjoshi3018 3 жыл бұрын
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.
@rupeshsharma2453
@rupeshsharma2453 3 жыл бұрын
A very informative video on spring security. Thanks a lot. Cheers
@dimimurik3970
@dimimurik3970 3 жыл бұрын
Very good tutorial, nice and clear explanations. Thanx a LOT!!
@firozgg7524
@firozgg7524 4 жыл бұрын
Tjank you so much brother... It was the best spring security tutorial i've ever watched so far...💜
@backtoGodhead0
@backtoGodhead0 3 жыл бұрын
Excellent, Thank you Kaushik, May God bless you!
@samedsakhri5117
@samedsakhri5117 4 жыл бұрын
Best I've ever seen on youtube .. thks man 😀👍
@ankitank1990
@ankitank1990 3 жыл бұрын
Thanks for your hard effort to make the things done. Awesome
@ilyesdjerroud7003
@ilyesdjerroud7003 4 жыл бұрын
Hello , thank you so much for your work ! We ARE waiting for LDAP lessons please :) !
@nitiKT
@nitiKT Жыл бұрын
Sir, hatsoff to you.. you made learning spring security enjoyable for me.. being dyslexic I hated spring security..
@muditshukla
@muditshukla 4 жыл бұрын
Great tutorial Sir. Hats Off.
@vasileiosstamos5940
@vasileiosstamos5940 4 жыл бұрын
Spring Security + JWT Authentication would be superb!
@Chanakya0000
@Chanakya0000 2 жыл бұрын
You made it look so easy. Thank you.
@francescodigiuseppe73
@francescodigiuseppe73 4 жыл бұрын
Thanks a lot Prof, you're my best teacher
@arungore6578
@arungore6578 4 жыл бұрын
Early morning .. good start
@ChathushkaPeiris
@ChathushkaPeiris 2 жыл бұрын
this is exactly i was looking for! thanks!
@nithinvarghese7765
@nithinvarghese7765 4 жыл бұрын
great tutorial..and happy Onam🙂
@anaghavarhade7375
@anaghavarhade7375 4 жыл бұрын
Thank you so much for these videos. They are very helpful ❤❤❤
@ArvindYadav-cn4md
@ArvindYadav-cn4md 4 жыл бұрын
Great job Sir. This is what required.. thank you v much.
@beginner-techies6793
@beginner-techies6793 4 жыл бұрын
wow , amazing explanation, waiting your video on spring boot with keycloak
@ashokmandadi
@ashokmandadi 4 жыл бұрын
very good video bout spring security, usage of lamda expression also very nice
@sugoi5240
@sugoi5240 7 ай бұрын
your explanation is so good i wanna cry
@SushilKumarBhaskar
@SushilKumarBhaskar 4 жыл бұрын
Yes Correct, read query many times for authentication/authorization, we might consider using LDAP. LDAP has fast read query.
@Java.Brains
@Java.Brains 4 жыл бұрын
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.
@buckg2129
@buckg2129 4 жыл бұрын
Incredibly helpful!
@goonerritz93
@goonerritz93 3 жыл бұрын
Great tutorial! Thank you!
@user-rh7fg5gn4b
@user-rh7fg5gn4b 4 жыл бұрын
very good tutorial Dear MAN!
@priscillavannyamelia8736
@priscillavannyamelia8736 Жыл бұрын
Amazing tutorial, thank you for creating this video
@codegeek8256
@codegeek8256 4 жыл бұрын
Thank You so much Koushik
@himanshusinghcoolboy
@himanshusinghcoolboy 4 жыл бұрын
very good and useful stuff, Please make some series about reactive programming with spring.
@macmuffin1865
@macmuffin1865 3 жыл бұрын
Great tutorial. very clear!
@awadijohan
@awadijohan 3 ай бұрын
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 ♥
@ayzaz_m6289
@ayzaz_m6289 4 жыл бұрын
Thank you so much Sir !!!
@nageshmath9376
@nageshmath9376 4 жыл бұрын
Art of coding ,simple and quick
@sandeepmreddy2788
@sandeepmreddy2788 3 жыл бұрын
Great effort, great explanation.. Thank you...!
@ayaagourram7363
@ayaagourram7363 3 жыл бұрын
Great job ! Thank you Sir !
@prageethjayasinghe709
@prageethjayasinghe709 3 жыл бұрын
Perfect teaching skills.
@deepakkakkar7698
@deepakkakkar7698 4 ай бұрын
Awesome explanation man,
@hyperborean72
@hyperborean72 2 жыл бұрын
thank you so much for the amazing tutorial
@daniellaerachannel
@daniellaerachannel 4 жыл бұрын
more and more and more and more spring please!!!!! thanks a lot
@jeeperscreepers7
@jeeperscreepers7 3 жыл бұрын
Love the video! thank you!
@KalizVids
@KalizVids 2 жыл бұрын
Perfect tutorial, thanks so much
@krishnakishore3258
@krishnakishore3258 4 жыл бұрын
Thanks a lot for this excellent content.
@badripaudel77
@badripaudel77 3 жыл бұрын
Did anyone try , this project no longer works ? I cloned it and it doesn't work. Says forbidden (403).
@1swine144
@1swine144 4 жыл бұрын
great tutorial, thanks
@krishmetalhead
@krishmetalhead 4 жыл бұрын
Such a good video. Very Nice .
@umaveerarajulapati3722
@umaveerarajulapati3722 4 жыл бұрын
Nice Explanation 👌👌
@FranklinXPe
@FranklinXPe 4 жыл бұрын
Congratulations #JavaBrains. It's the best tutorial I've read about Spring Security + JPA. It's almost complete. Thanks you very much! Pd: I think you should endcoder your password with other tecnique, because it inserts plain-text password.
@Java.Brains
@Java.Brains 4 жыл бұрын
Yes, I do mention that use no-op encoding for simplicity. check out the password encoding tutorial on my channel to learn about password encoding!
@arashaadd
@arashaadd 2 жыл бұрын
this man is the greatest of all time!!!
@thilinad.gunasekara7281
@thilinad.gunasekara7281 3 жыл бұрын
It's helped me so much. Thanks.
@tedodjukic4789
@tedodjukic4789 3 жыл бұрын
very good explained!
@jfaber1026
@jfaber1026 4 жыл бұрын
It's importante to note that you must add the prefix ROLE_ in MyUserDetails class otherwise it could return a 403 when trying to log in.
@srigunakrishnamoorthy1670
@srigunakrishnamoorthy1670 4 жыл бұрын
Thanks for this.. i have been facing this issue.. But , how can we get rid of this explicitly.
@mritunjayyadav3788
@mritunjayyadav3788 4 жыл бұрын
one word for you ( Legend ! )
@simawdf
@simawdf 4 жыл бұрын
Thanks a ton sir!
@souvikdasgupta8960
@souvikdasgupta8960 4 жыл бұрын
Very nicely explained. Can you make a tutorial on Spring security + oauth2
Spring Boot + Spring Security + LDAP from scratch - Java Brains
18:16
4 Spring Boot Mistakes to AVOID in 2024
15:18
Java Brains
Рет қаралды 56 М.
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 35 МЛН
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Poly Holy Yow
Рет қаралды 7 МЛН
One moment can change your life ✨🔄
00:32
A4
Рет қаралды 35 МЛН
What is OAuth really all about - OAuth tutorial - Java Brains
10:56
10 Spring and Spring Boot Common Mistakes You Need To STOP
15:49
Amigoscode
Рет қаралды 144 М.
JWT Authentication Spring Boot With Database | Spring Security Full Course Series  | Video #9
1:18:37
Spring Boot + Spring Security + JWT from scratch - Java Brains
39:29
Spring Tips: Spring Modulith
37:39
SpringDeveloper
Рет қаралды 19 М.
What is JWT? JSON Web Tokens Explained (Java Brains)
14:53
Java Brains
Рет қаралды 1 МЛН
How to integrate Java Spring Boot application with Okta using OIDC?
36:10
Security in Action 101
Рет қаралды 6 М.