Bro i don't know who are you.. you are God's gift. I am search for a job.. once I got it..I will give super thanks to you
@Javatechie Жыл бұрын
Thanks buddy 😊 . Keep learning
@dipakkale272311 ай бұрын
Did you got job ?
@Thiru-zt5lw11 ай бұрын
@dipakkale2723 yes..already enrolled in his courses..
@IAmUsingAndroid7 ай бұрын
Did you get the job.
@saradaprasadmohapatra43655 ай бұрын
He is Basant Hota
@KyryloBulyk Жыл бұрын
Спасибо!
@pranaypaul63616 ай бұрын
haven't found anything simpler on JWT Authentication & Authorization than this video! Kudos. You're so so important for the community! Keep making such videos please.
@GokulCodeFactory Жыл бұрын
What a man you are ? It's not only tutorial for security .It's the night mare for me to achieve security in spring application.Hats off keep the learning spell always on.Thanks a lot!🌟
@Javatechie Жыл бұрын
Thank you so much Gokul . Glad to hear that 😊 . Keep learning
@SupriyaMondal3 Жыл бұрын
".It's the night mare for me to achieve security in spring application." ,, ...... really ?
@Javatechie Жыл бұрын
@Supriya are you facing any issue?
@marnasirisha6065 Жыл бұрын
One thing I can say..........the best channel I have ever seen....thank u so much sir
@ashokkumary11Ай бұрын
Basanth, All your courses are simple, straight forward, easy to understand for all levels. Kudos to your efforts.💯
@rakeshchavan78395 ай бұрын
Crystal clear explanation and implementation. No need to watch any other video after this. Thank you.
@Javatechie5 ай бұрын
Thanks buddy keep learning 👍
@nagamanibuditi75773 күн бұрын
I never thought i would be able to understand JWT until i found this video. you really Blessing to us
@karthikshankar5618 Жыл бұрын
I have been binge watching many videos on JWT authentication and luckily found this video, you are simply amazing with the way of delivering things sir, thanks a lot and more power to you to roll out such amazing videos in the future
@Javatechie Жыл бұрын
Thank you so much Karthik for appreciating it . I am glad to hear that people are getting benefitted with my content
@sandeepprabhakula7714 Жыл бұрын
Hats off to you sir You literally made Spring Security Easy. I've gone through many lengthy videos but nothing worked your spring security videos made me learn within 2hrs including jwt and basic auth.
@SundararajanEaswaranАй бұрын
Your communication is OK kind. But your content, efforts, presentation are really awesome. Keep up your good work sir
@shubhitembhare7769 Жыл бұрын
Simply amazing Sir. I was struggling for authorization configuration in springboot 3.2.0. You have covered it well.
@shigangzhang5662 Жыл бұрын
Thanks for the video. I did learn a lot from it. A few points: 1. the authentication manager is not recommended although it works, you should come up with your own authentication manager. 2. there is a new nimbus package in the latest Spring security which should be used for encoder and decoder. 3. that filter is not necessary as I understand. You simply provide the encoder and decoder, spring security will automatically take care of the security check for all the configured paths.
@Javatechie Жыл бұрын
Thank you for your suggestion buddy. I will definitely take a look into these changes
@RN-jo8zt Жыл бұрын
you mean bcryptpasswordencoder?
@kethakaranasinghe941 Жыл бұрын
Sir, thank a lot for your contribution. I have searched so many methods to implement JWT on my project running on Spring 3.1.5 but couldn't find a proper solution. We need more videos on new releases like this. Thanks a lot!!!🤩
@rajyahoob5 ай бұрын
Starting to learn Spring Boot security now, Thanks for your effort as always.
@adapamail Жыл бұрын
Great tutorial those who are moving spring security 6. Awesome! job.
@DileepV-on7wk5 ай бұрын
Really Your Tech Gem .. Hands of your clear explanation .. LOVE IT :)
@aadiraj6126 Жыл бұрын
Sir, plz provide flow diagrams of each classes before you code. And also include entire flow with all classes as summary at the end and if possible at very begining. You know the flow, so you find it super easy naming classes, but its tough for any beginners as classes names are big and similar. My hostel juniors gave me this feedback when I shared them ur lecture.
@Javatechie Жыл бұрын
Thanks Raj for your suggestion. Noted this and will work on it
@samsonmayeem8409 Жыл бұрын
Nevertheless, it's a big-time first-class tutorial regardless.
@deeplife9654 Жыл бұрын
Yes. This is the only thing this tutorial is missing.
@galizischebahn2648 Жыл бұрын
incredible! didn't expect to find usage ready solution here, but you nailed it. thanks!
@henninb Жыл бұрын
I appreciate the detailed description of this video. Thanks for sharing.
@inhtruongvu7618 Жыл бұрын
🎯 Key Takeaways for quick navigation: 00:00 📹 This video tutorial covers implementing a refresh token mechanism in a Spring Boot application with JSON Web Tokens (JWT). 03:18 🛡️ Refresh tokens enhance the security of JWT authentication by allowing users to obtain new access tokens without re-entering credentials. 05:45 💼 The tutorial demonstrates how to configure and use Spring Security 6 for managing JWT-based authentication and authorization in a Spring Boot project. 08:20 🤖 You'll learn about the importance of token expiration times, token stores, and token revocation for effective JWT authentication. 12:10 🔐 Implementing a refresh token mechanism is crucial for maintaining secure and seamless user sessions in Spring Boot applications. Made with HARPA AI
@SUMITPal-bl2jm Жыл бұрын
Yr explanation is just amazing👍👍
@rishisrivastava5461 Жыл бұрын
Watching your complete series because of the migration project, Thanks a lot again
@johnvick8861 Жыл бұрын
Really helped me for my internship
@ahmadazeem77856 ай бұрын
Just amazing as always. May God bless you.
@Mohamad-q2p8v11 ай бұрын
I have learned everything I needed to learn, thanks a lot man
@Mahmudulhasan-ts5hm Жыл бұрын
thanks, great video. I have followed lots of youtube videos only this code working properly. thanks again.
@naidu12341 Жыл бұрын
No words Mind Blowing session
@kiryls1207 Жыл бұрын
this happens the first time for me, i just needed a walkthrough in spring3 + jwt and spring security. and well, you provided it 22 minutes ago. +sub
@kshitijbansal3672 Жыл бұрын
Suppose I have a spring boot application which is having multiple instances running (lets say 3 instances are running), and I have a scheduler which is suppose generating a report after every 1 hour, so now my scheduler will start generating the same report for every instance of my application (so it will generate 3 report in total) and which is a wrong thing, so how can we handle such scenario. How to make our scheduler generate only 1 report even if 3 instances are running. Today an interviewer asked this question to me and I was clueless about it. Pls help.
@kiryls1207 Жыл бұрын
@@kshitijbansal3672 holy ffffu. it's more like: - how many hours did you mess with spring framework, tinkering here and there? - yes
@kshitijbansal3672 Жыл бұрын
@@kiryls1207 if you know the solution, you can, don't ask unnecessary questions
@kiryls1207 Жыл бұрын
@@kshitijbansal3672 i saw guides and tutorials about spring concurrency and threading. i don't know the solution, i just started with spring
@Javatechie Жыл бұрын
In that scenario you need to configure your scheduler related properties in only one instance For example let's say you have instance 1 ,2 and 3 You want to run your scheduler only in instance 1 in that case create all properties of scheduler like cron expression, time zone etc only in instance 1 configuration When i say instance 1 configuration i mean just find a place where you can load required properties
@ApurvTripathi-mc3iy Жыл бұрын
Amazing video, you made so easy, understood every part
@rangasudeep1198 Жыл бұрын
Thanks basant for the detailed video about jwt
@navaugustt Жыл бұрын
Another nice explanation video ❤
@subhashreesahoo5760 Жыл бұрын
Oh wow , thank you so much sir .. i was thinking to request you for this spring security jwt and just found it now . Great ,will cover this in this weekend,thank you 😊
@kshitijbansal3672 Жыл бұрын
Suppose I have a spring boot application which is having multiple instances running (lets say 3 instances are running), and I have a scheduler which is suppose generating a report after every 1 hour, so now my scheduler will start generating the same report for every instance of my application (so it will generate 3 report in total) and which is a wrong thing, so how can we handle such scenario. How to make our scheduler generate only 1 report even if 3 instances are running. Today an interviewer asked this question to me and I was clueless about it. Pls help.
@Adeel-Verse.. Жыл бұрын
Thankyou so much for this I have got a task to build jwt auth This will be very helpful for me
@justAnotherJavaGuy Жыл бұрын
Amazing video with covering all the aspect of JWT in latest version of spring boot. Thank you for the in detailed walkthrough. Please make one video on internals of spring boot security internals with new classes in involved latest version
@Javatechie Жыл бұрын
Glad it was helpful! Yes it's in my queue soon i will do that
@mohamedsubaird Жыл бұрын
Thanks for choosing this topic. And make a Oauth 2 verification video in spring boot 3
@hkk4782 Жыл бұрын
as per my understanding we should not hit db again for jwt token validation and we should recreate token with given header and payload and compare it with resent token, however i understand we can not verify roles with that, so there is some gap in this and i am not sure yet how that will be done.
@Javatechie Жыл бұрын
We do validate roles with annotation @PreAuthorize
@hkk4782 Жыл бұрын
JWT (JSON Web Tokens) are designed to be self-contained, containing all the necessary information within the token itself. Once a user is authenticated and a JWT is issued, the server can verify the token's integrity and extract relevant information without needing to contact the user database for every request. I see in our example we fetched data from user details db again which may not be right way to use jwt as the purpose of using jwt is to avoid hitting db/cache for every login request, please clarify@@Javatechie
@PkSam0711 ай бұрын
@@JavatechieYes, I too didn't understood couple of things- 1. Y u r generating token through a rest end point via @requestBody param? I think It sud b generated via filter u created. If(extractedToken= null) then create json token and should be set in context..or? 2. In ur filter, u r using userDetailService.loadUserByUserName(username) ..this username is same u extracted from ur token? Then, obviously both will be validated? Instead u should match user from token with the logged on user?
@dn.n234 ай бұрын
Nice explanation.......❤
@sonukumar-of4pq2 ай бұрын
Sir G- i believe you are saving the life of more than 95% programmer who is getting through your sessions. Because i am damm sure, eventually the search for a good content could have end up to one and only your session.. Thanks Man..
@Javatechie2 ай бұрын
Thank you so much sonu for your word. Keep learning that's what my gift 🎁 buddy
@victormotorin237 Жыл бұрын
Hi I have a question, at 34:13 while checking for null and bearer, why we are giving space after Bearer?
@Javatechie Жыл бұрын
In postman while selecting auth header by default it will add one additional space
@victormotorin237 Жыл бұрын
@@Javatechie but if we give just the bearer.. without any space will it not work or there would be multiple result for tha string?
@Javatechie Жыл бұрын
No it won't work . To do quick testing just add a break point in filter class and check the value
@victormotorin237 Жыл бұрын
@@Javatechie ok thanx 😊, very informative video though 👍🏼
@kamleshpatil1959 Жыл бұрын
Your explanation is really good, thanks for making tutorial
@kishordige9721 Жыл бұрын
Present when needed. Thank you!
@funcoding1797 Жыл бұрын
Thanks , your tutorial clips are the best.
@Javatechie Жыл бұрын
Thank you buddy 😊
@aneksingh4496 Жыл бұрын
Nice ...keep posting some complex spring boot projects...
@karthickn956 Жыл бұрын
Great explanation sir thanks lot
@javarider7760 Жыл бұрын
This is very right way explain.
@ChamaraBandara-t9b Жыл бұрын
Excellent! Love it
@parmarkamlesh6493 Жыл бұрын
Nicely covered both authentication and authorization.
@manojpatil2457 Жыл бұрын
27:20 How does AuthenticationManager knows it needs to lookup 'userinfo' table to verify username ?
@thomasanthony.t9523 ай бұрын
bro just nailed it
@hackstreet78111 ай бұрын
Wanted to add one point: if we are generating token only when user register or login then in validation process, we can skip fetching user details from db because if the token is modified then it will be invalid token when we match it using our secret. So, If the token is valid then we can save it to our security context always.This is my understanding. Please add to it if something is incorrect or I am missing something.
@yogeshpatil-vx2pi Жыл бұрын
Thats a great stuff as always :) . .. One request to you ..can you create one video on Spring Security OAuth Authorization Server using spring boot 3.0 .. Thanks again.. keep up good work :)
@Javatechie Жыл бұрын
Okay sure noted
@SADDAMHUSSAIN-wy5kf Жыл бұрын
Perfect Example for Spring Securrity ! Sir can you please guide how @PostMapping("/authenticate") end point is working internally? How it reading user from DataBase! although we are not using any repository in this end point. How AuthenticationMangar finds the correct user name from database?
@Javatechie Жыл бұрын
It will be dead easy to understand if you can debug then nothing complex buddy. I would strongly suggest you to refer to the video below to understand the internal flow kzbin.info/www/bejne/Z3a1h2BsmN9lrs0
@SADDAMHUSSAIN-wy5kf Жыл бұрын
@@Javatechiewow luckely I was already wathcing it ! Thank you so much for your respone ! Thank you again for making things very simpliers
@ganny93052 ай бұрын
Really helpful thanks.
@lxdzii7 ай бұрын
amazing tutorial!
@harllemalves1590 Жыл бұрын
Great video, thanks for all the explanation!
@medAmineRg Жыл бұрын
thank you man, that was very helpful
@gunarajesh1 Жыл бұрын
Worth watching your videos
@SuperYkf Жыл бұрын
This is so well explained! Thank you!
@benjiealcontin7867 Жыл бұрын
Thank you sir, more videos , I'm beginner :)
@v4vang394 Жыл бұрын
i from vietnam, thanks your video
@MegaGustavosc Жыл бұрын
I implemented this JWT Authentication and Authorization, and when I call the endpoints via Postman everything works perfectly. The problem is that I'm trying to write unit tests for my controllers using JUnit 5, but all endpoints always throw 403 Forbidden. Even when I use the @WithMockUser annotation, the same problem continues. Does anyone know what the problem could be? Did someone who implemented this JWT Authentication and Authorization manage to do the unit tests for the controllers?
@treefrog9392 Жыл бұрын
At 17:45, how did you define the key string with the class label SECRET? I cannot find documentation on this and I have no idea how you did it. It happened very fast.
@Javatechie Жыл бұрын
Option+cmd+c
@aribasiebel7 ай бұрын
Love the popping sounds
@ashishyadav4510 Жыл бұрын
Greate explanation sir! as always 🙏🙏.
@karthikgaddam831Ай бұрын
Thanks , love it
@haidertest18094 ай бұрын
Thank you for this, is there a chance of you making a full stack tutorial with Java and React in future. It will be really helpful.
@Javatechie4 ай бұрын
Yes I will
@SandeepPrajapati-xu9ru Жыл бұрын
such great tutorial, explained in simple way, help be crash course through it and build a new micro service implementing spring JWT authentication, thank you so much
@Javatechie Жыл бұрын
Thanks buddy, What are you looking for here it is kzbin.info/www/bejne/g4jZn6CvgbeIn80
@alfahidi7018 Жыл бұрын
One thing I realized, in your extractAllClaims method, the jtw parser throws exceptions that are not caught. For example, if the token is expired it throws a ExpiredJWTException! So you checks for istokenexpired is moot.
@ThrottleJourneys11 ай бұрын
Love you bro ! Thanks alottttt
@ayushgupta-pj5sq Жыл бұрын
you passed claims map empty (During token generation), what is the use of that i did n't get that point? can you please elaborate that little more.
@supratimdatta78487 ай бұрын
Very good content. Thank you very much!
@abdulsattarshaikh9758 Жыл бұрын
Nice tutorial sir
@nanduchopade2910 Жыл бұрын
Best Tutorial ever bro thank you somuch
@sumantaghosh4239 Жыл бұрын
Thanks Buddy, can you make a video integrating jwt on api gateway
@Javatechie Жыл бұрын
Please check this kzbin.info/www/bejne/p4CnoHenasSbd68
@supratimnayek2776 Жыл бұрын
Amazing. Thank you so much
@sujatharam Жыл бұрын
A really nice explanation . Very helpful
@punamroy66396 ай бұрын
Thank you sir for this video. It is really very helpful.
@HarishKumar-vz4if Жыл бұрын
Can you please do this using Reactive approach, it will help us.
@JuanEstebanNarvaez-e6y Жыл бұрын
Thank you so much master, te amo
@roshanpatro5777 Жыл бұрын
Again an amazing tutorial. I can't thank you enough. ❤
@all-in-Recipes9 ай бұрын
Well explained 🙂
@manjosh199011 ай бұрын
Excellent video. I also wanted to know how to implement logout. Can you show a sample with the same example?
@tanmaybhadra3314 Жыл бұрын
Hi , I have a small request. Might be funny for some. Can you please create a small video on roadmap. Like roadmap for spring security, roadmap for spring boot or core. So that everyone can have a idea what to start first and what not. Thank you
@Javatechie Жыл бұрын
No it's not at all funny Budd y don't worry. spring boot road map i will prepare one video where i will cover all modules. Most probably this weekend or next okay
@hoddybhaba6704 Жыл бұрын
in JWT validation, we are not validating the password right ? First time user put their credentials, the System validates and if user is authenticated,JWT is issued to him, then the subsequent request user sends in the JWT in the request and the server just validates the username in the JWT is matching with the username in the userdetails corresponding to that user in the system and also the expiry date in the JWT is validated and if both the scenarios passes, the user is provided with the resource that he has requested.
@Javatechie Жыл бұрын
Yes correct
@ismailforeveryone6889 Жыл бұрын
very informative , please we need a demo for spring boot 3 & spring cloud keycloak
@Javatechie Жыл бұрын
Okay i will plan for it
@ismailforeveryone6889 Жыл бұрын
@@Javatechie thank you so much
@kalaiselvankesavel2971 Жыл бұрын
❤Great demo
@sabyasachirajkumar27049 ай бұрын
Hi Basant, It’s a nice content but my question is in our project how do we generate secret key and where do we store and how to access it.Plz let me know.Thanks
@Javatechie9 ай бұрын
Usually your application must be integrated with the UI right? So from the UI when the user login for the first time the backend will generate the token and send it back to the ui then going forward ui will attach that token to the session or cookies
@sabyasachirajkumar27049 ай бұрын
@@Javatechie yeah that’s ohk but query is how do we generate secret key not token and where do we store and how to access it.I am not asking about the jwt token .Plz let me know.Thanks
@ajisegirisunday2885 Жыл бұрын
Well done Basant but I have a question.. Let's say i have multiple instances of my app.. How do I configure the authentication manager with Redis.. Thanks
@Javatechie Жыл бұрын
You need to configure it in API gateway not in each microservice
@ajisegirisunday2885 Жыл бұрын
@@Javatechie yes I understand but I am talking of monolith applications but scaling to multiple instances.. How do I go about that
@aditimohan7892 Жыл бұрын
thank you for your helpful videos. please do a video on Oauth2 for springboot 3
@Javatechie Жыл бұрын
Okay sure we will do that
@SawanKumar-yg1em Жыл бұрын
Thank you so much sir.
@marinemanga9875 Жыл бұрын
Can you do a tutorial on using JWT authentication and Angular for the front end? I don't know if it's possible for you to do it, but I'm at roadblocks in trying to figure this out
@racot7145 Жыл бұрын
Have a question about roles. I saw some video where they didn't user preauthorize annotation. But used enum role. What is the best approuch ?
@Javatechie Жыл бұрын
Without @PreAuthorize not sure . Will check and update
@a_new_rag Жыл бұрын
@Javatechie : I like your videos, you are doing a great job. I just have one doubt here, we are extracting username from JWT token, then from that username we are fetching UserDetails, then we are matching username from JWT token with user name from UserDetails, but they both will always be same, isn't it?
@Javatechie Жыл бұрын
No we are fetching the username and then validating it in DB whether the user exists or not
@arunvijay2279 Жыл бұрын
@@Javatechie but we are fetching username from db, so no need to validate again right ?
@Javatechie Жыл бұрын
Buddy you are asking while token generation or aurhenticate endpoint? Where is your confusion
@pip3936 Жыл бұрын
Hello sir, thank you for your tutorial. I have a request. Can you do tutorial on how to handle AuthExceptions or JWTExceptions or any other exceptions inside filters, so they will be sent to user in json format.
@Javatechie Жыл бұрын
The approach is simple just add Controller advice class and map your exception
@TalhaRizwan-jg2li6 ай бұрын
in this flow can we add authentication using goolge etc.?
@Javatechie6 ай бұрын
Yes absolutely we can
@dharmveersharma207 Жыл бұрын
Hats Off sir!
@natureloverJ Жыл бұрын
Highly appreciated
@jasiek393 Жыл бұрын
Hi, what if token is invalid ? For example if the token expired there will be an exception in the filter that can't be handled using controlleradvice, the response will be Internal Server Error but should be e.g 403. What is the best way to deal with it ?
@Javatechie Жыл бұрын
You need to either logout or force the user to refresh the token
@kiryls1207 Жыл бұрын
that's an interesting question. also, i didn't quite get why in the method 'validateToken()' he uses just the username and not also the password. maybe he left this to figure it out on ourselves?
@jasiek393 Жыл бұрын
@@kiryls1207 It's because we store username/email in JWT claims. I think it won't be good to store password in JWT payload
@jasiek393 Жыл бұрын
@@Javatechie I think I figured it out in a better way. If somebody needs it I can provide link to my github
@kiryls1207 Жыл бұрын
@@jasiek393 so, the first time you login you provide username and pass, the application will authorize you with Basic, generate and send you back a jwt token. from this moment till a logout call or token expiration you just throw the token to the backend and you'll be authorized am i getting it right?