EP12 - Spring boot and security with Jwt Authentication, access and refresh tokens | Backend mastery

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ธ.ค. 2024

ความคิดเห็น • 118

  • @SubodhKumarThakur-te9zf
    @SubodhKumarThakur-te9zf 6 หลายเดือนก่อน +1

    just an suggestion from my side anyone which is very new to inttelij idea please ensure you have lombok plugin installed as you will see errors whenever you use .builder method. Steps to install simply go to file->settings->plugins->search lombok and install it. i was struggling with this.

    • @SinghDevHub
      @SinghDevHub  6 หลายเดือนก่อน

      Thanks for this bro 💯

  • @sambhavmishra5423
    @sambhavmishra5423 10 หลายเดือนก่อน +4

    Itna zyada kuch seekhne ko mila, aisa kuch hai hi nhi YT par. Thank you

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +1

      🙏🙏🙏🙏🙏

  • @noob_gaming903
    @noob_gaming903 5 หลายเดือนก่อน +1

    I have been facing alot of issues while learning spring security but then I came to these playlist and love it. You deserve more subscribers, more views and more likes. Thanks a lot. Btw I connected to you linkedIn too.

    • @SinghDevHub
      @SinghDevHub  5 หลายเดือนก่อน

      Thanks man 🫡

    • @umang_29
      @umang_29 4 หลายเดือนก่อน

      @noob_gaming903 bro i need some help.. if u hv completed this project can u help me with some steps

  • @shantahiremath7313
    @shantahiremath7313 3 หลายเดือนก่อน

    Thank you for the detailed explanation with project 👌

  • @sonalisaha5398
    @sonalisaha5398 10 หลายเดือนก่อน +5

    Please sir bring some more productive and full covered concept long video(realtime project ) like this ....
    Would be very helpful for us ...
    So that we don't have to go to another channel for getting that concept

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +1

      This video is a real deal bro. Put so much efforts. It is covering up a lot of stuff

  • @gimeChaitanyaNadagouda
    @gimeChaitanyaNadagouda 10 หลายเดือนก่อน

    Thats is some great stuff u have taught us , do continue this series so that we will be get full idea on remaining concepts great efforts 💯💯

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน

      Yo Bro 2 videos coming soon 🚀

  • @garvitsingh2593
    @garvitsingh2593 10 หลายเดือนก่อน +1

    maza aa gya this is going to be one of the high rated playlist in future crisp and clear ...one question comment on relevence of spring boot in backend please

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +1

      Spring boot is used by almost every startup/mnc operating at the large scale (scale of million+ users)

  • @bhavikaaggarwal7613
    @bhavikaaggarwal7613 8 หลายเดือนก่อน

    This video is really awesome. Thankyou.

    • @SinghDevHub
      @SinghDevHub  8 หลายเดือนก่อน

      Nice that you found it helpful

  • @varun3286
    @varun3286 8 หลายเดือนก่อน

    love your content!! keep it up

    • @SinghDevHub
      @SinghDevHub  8 หลายเดือนก่อน

      Thanks buddy 🫸👈

  • @mahaveerjanagouda77
    @mahaveerjanagouda77 10 วันที่ผ่านมา +1

    why are we making set and storing the User and Role instead we can use the SQL when we need to access that data right?

    • @mahaveerjanagouda77
      @mahaveerjanagouda77 10 วันที่ผ่านมา

      and also, that set only contain one user related data at any given time right?

    • @SinghDevHub
      @SinghDevHub  10 วันที่ผ่านมา

      Search more about it bro you will know why we need to store the roles and refresh tokens

    • @mahaveerjanagouda77
      @mahaveerjanagouda77 9 วันที่ผ่านมา

      @@SinghDevHub okay thank you i will

  • @trex4815
    @trex4815 10 หลายเดือนก่อน

    Great video sir 👍

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน

      Dekh liya poora?

  • @shivamjadon2257
    @shivamjadon2257 10 หลายเดือนก่อน +1

    top-level content

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน

      🙏🙏🙏🙏🙏

  • @ss-xh3hf
    @ss-xh3hf 10 หลายเดือนก่อน

    Another great one

  • @gurshansingh2598
    @gurshansingh2598 10 หลายเดือนก่อน

    Great video ❤

  • @mohammadaamir4370
    @mohammadaamir4370 10 หลายเดือนก่อน

    Those interfaces who has only one abstract and may be multiple static and default methods are called Functional Interface. In Java 8 Functional programming came into the picture.

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน

      Yep 👍😊

  • @lakshmanankanthi7158
    @lakshmanankanthi7158 หลายเดือนก่อน

    Hi Lovepreet,
    Thanks for the tutorial. If I remember correctly, JWT avoids db calls as it is self sufficient. I get that we need user details to process requests, so we're making db call through UserDetailsService in the JWT filter. But with sessions too, we can validate session and get user details in a single call
    So there's not much improvement here right?

    • @SinghDevHub
      @SinghDevHub  หลายเดือนก่อน

      I think so yes. Have to revisit as i wrote it long back. But yes possible

  • @mohindersingh3176
    @mohindersingh3176 10 หลายเดือนก่อน

    Very good👍👍❤❤

  • @heykalyan
    @heykalyan 9 หลายเดือนก่อน +1

    why we storing them in repository? the entire point of jwt is to be stateless correct,🤔it defeats the purpose of storing refresh tokens in db, or you just doing it for demo purpose

    • @SinghDevHub
      @SinghDevHub  9 หลายเดือนก่อน

      Refresh tokens are stateful tokens that needs to be stored because they generally has large ttl like > few days. While JWT are generally of ttl in minutes. You can refer to our Auth service tokenisation video

  • @AnuragMishra-ws4zc
    @AnuragMishra-ws4zc 2 หลายเดือนก่อน +1

    can we use spring security framework for doing the same

    • @SinghDevHub
      @SinghDevHub  2 หลายเดือนก่อน

      Yep yep, if it allows this functionality go for it

  • @KaliLinux-t8f
    @KaliLinux-t8f 10 หลายเดือนก่อน

    next video jldi se upload krye bhai😊😊

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน

      Krte hain bro. Kafka Crash course hai next video. Because kafka and rabbimq use hoga aage project me so usko use krna pehle uski video aayegi

    • @KaliLinux-t8f
      @KaliLinux-t8f 10 หลายเดือนก่อน

      @@SinghDevHub wiase kb karnege aap bro

  • @sameersawant8714
    @sameersawant8714 10 หลายเดือนก่อน

    Waiting for new upload 🔥

  • @rajapandey773
    @rajapandey773 7 หลายเดือนก่อน +1

    Bhaiya, resuming this project, wasn't able to continue it because of exams, just a question everything working till the table creation in mySQL 1:37:14
    But I never done debugging before also intellij UI giving me a headache , so I am not able to follow the postman thing, so my question is can I move to next video? Ep05 without doing that postman and debugging?
    thanks

    • @SinghDevHub
      @SinghDevHub  7 หลายเดือนก่อน +1

      Goto next video, but this is one of the component and if you are not able to code and make it work the app login and signup will not work. Headache toh aayega bro and aate rhega, for me while implementing I do debug for days that in the video gets completed in 15mins

    • @rajapandey773
      @rajapandey773 7 หลายเดือนก่อน

      @@SinghDevHubokay bhaiya, also, if you get time can you post some short videos/ shorts to explain how we do such things? that would be really helpful?

  • @secondthread-uc9bd
    @secondthread-uc9bd 3 หลายเดือนก่อน

    sir what plugin are you using to view those documentations in comments when you control+click anything , its pretty neat

    • @SinghDevHub
      @SinghDevHub  3 หลายเดือนก่อน

      No plugin bro

    • @secondthread-uc9bd
      @secondthread-uc9bd 3 หลายเดือนก่อน

      ​@@SinghDevHub yes issue fixed on restart my bad , but sometimes it dosent work for some reason , kinda weird , ty

  • @anshumangogoi148
    @anshumangogoi148 10 หลายเดือนก่อน

    Great content, something to feel confident upon. Sir when will this project end if you can give an approximate timing,it would be great

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +1

      June july 2024. But along the way bhut kuch milega seekhne ko

    • @anshumangogoi148
      @anshumangogoi148 10 หลายเดือนก่อน

      @@SinghDevHub That's great sir. Yes Sir, all in for new learnings🔥

  • @shubhamtiwari3095
    @shubhamtiwari3095 3 หลายเดือนก่อน

    Bro I did't use Mysql in VM, i used it on local machine only, will it cause any problem in future while implementing kafka, docker on local machine only?

    • @SinghDevHub
      @SinghDevHub  3 หลายเดือนก่อน

      In future we will also use local machine. So no worries bro

  • @b.chinrhea
    @b.chinrhea 3 หลายเดือนก่อน

    when I am trying to signup in local , it is still giving 401 unauthorized access error on postman

    • @SinghDevHub
      @SinghDevHub  3 หลายเดือนก่อน

      Bro it is answered already in some comment similar to this. Pls refer

  • @b.chinrhea
    @b.chinrhea 3 หลายเดือนก่อน

    when I am trying to establish a ssh connection from my windows machine to ubuntu VM using ( ssh username@ip-addr) , its constantly showing connection timed out and ping command also does shows request timed out . I tried everything from windows firewall configuration to changing port number but it is still not working . what should I do?

    • @SinghDevHub
      @SinghDevHub  3 หลายเดือนก่อน

      Bro we will not use Linux VPS going on

    • @b.chinrhea
      @b.chinrhea 3 หลายเดือนก่อน

      @@SinghDevHub Sorry , I didnt quiet understand you , can you elaborate

    • @SinghDevHub
      @SinghDevHub  3 หลายเดือนก่อน

      @@b.chinrhea You can use local system of yours in furhter video we will not use Virtualmachine

  • @krishna.r.p8488
    @krishna.r.p8488 8 หลายเดือนก่อน

    great content , keep making
    can I use Maven instead of gradle and follow this playlist

    • @SinghDevHub
      @SinghDevHub  8 หลายเดือนก่อน

      Yes yes both are same most of the times so no worries

  • @b.chinrhea
    @b.chinrhea 3 หลายเดือนก่อน

    when trying to signup , it is giving 401 unauthorized access error on Postman , how will i be able to generate token if it is not able to signup only.

    • @SinghDevHub
      @SinghDevHub  3 หลายเดือนก่อน

      This is something we will solve in further videos. But solution is remove ComponentScan annotation from main application class as it is causing problems while creating beans after compiling the code

  • @abhishekc3556
    @abhishekc3556 10 หลายเดือนก่อน

    🔥🔥

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน

      🙏🙏🙏🙏🙏

  • @rajapandey773
    @rajapandey773 8 หลายเดือนก่อน +1

    Bro in previous video, you said to download the Ubuntu server, not desktop so I am using that. Will there be any problem.????

    • @SinghDevHub
      @SinghDevHub  8 หลายเดือนก่อน +1

      Yeah yeah you can use that. In my machine it was giving a bit of overhead thats why we switched to linux on aws later and then on local. Keep going with your machine vm only

    • @rajapandey773
      @rajapandey773 8 หลายเดือนก่อน +1

      @@SinghDevHub Bhaiya at 1:38:24 i have added the breakpoints and started the code, but they are not turning green like in your case, but in console its showing that service is started at he port. Also I send the request from postman as well but there its saying 401 Unauthorized. Mysql is running I am also getting the tables in authservice database.
      Previously I added a doc link in the comment to show you the screen shots, but my comment got deleted

    • @SinghDevHub
      @SinghDevHub  8 หลายเดือนก่อน

      @@rajapandey773 you can raise an issue on github with screen shot attached right.

    • @rajapandey773
      @rajapandey773 7 หลายเดือนก่อน

      @@SinghDevHub did bhaiya, please check when you get time. thanks.

  • @sandeepchowdary5121
    @sandeepchowdary5121 10 หลายเดือนก่อน

    when using the jjwt library to extract claims as mentioned in the video it is showing deprecation message. how to resolve this?

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน

      By using their updated method. I didn't research around it what is the new method. You can

  • @Hamzaalive
    @Hamzaalive 9 หลายเดือนก่อน

    humne TokenController ke upr @controller or Authcontoller ke upr @RestController kyu use kia hai?
    TokenController ke upr bhi @controller ni hona chahiye?

    • @SinghDevHub
      @SinghDevHub  9 หลายเดือนก่อน

      Both works bro. kuch bhi use krlo

  • @Hamzaalive
    @Hamzaalive 9 หลายเดือนก่อน

    Bhai kya mai maven use kr skta hu with eclipse? gradle ke bjai?

    • @SinghDevHub
      @SinghDevHub  9 หลายเดือนก่อน +1

      Yes yes no issues.

  • @dhrubajyotigiri02
    @dhrubajyotigiri02 9 หลายเดือนก่อน

    Bhai aap ne SecurityConfig part me copy paste krke, uske bad explain kiya each component.
    Mujhe lgta hai ki agar code krte hue explain krte, usme kuch gltiya hota, usko resolve krte hue sikhte to or bhi achhe se samajh aata.
    Just a request for upcoming videos.

    • @dhrubajyotigiri02
      @dhrubajyotigiri02 9 หลายเดือนก่อน

      By the way, aapka content extreme level ka hai. Itna deep concepts samjhate ho ki yehi se sikhke big complex system banaya ja sakta hai.
      Thanks bro ❤

    • @SinghDevHub
      @SinghDevHub  9 หลายเดือนก่อน +1

      Noted bro. Bhai video bhut long horhi thi and camera overheat ho chuka tha isliye config copy paste kra. By the way ye sab maine hi code kra hai so copy pasted from mycode only which I tested before the video 🙏🙏

  • @varun3286
    @varun3286 8 หลายเดือนก่อน

    I'm not able to signup, every time i try to signup using postman request i get "Exception in User Service".....please help

    • @SinghDevHub
      @SinghDevHub  8 หลายเดือนก่อน

      Bro what is the exception. Read the error, is mysql working fine with your service if yes turn on the spring debug in application properties and see the error coming and to debug more put debug points and see where it is failing

    • @varun3286
      @varun3286 8 หลายเดือนก่อน

      @SinghDevHub yes mysql is connected successfully, I have used docker instead of VMware but I think token generate nhi ho rha thik se ya usse related koi problem h

    • @SinghDevHub
      @SinghDevHub  8 หลายเดือนก่อน

      @@varun3286 Put debug points bro and see hokya rha hai,

    • @varun3286
      @varun3286 8 หลายเดือนก่อน

      @@SinghDevHub okay sir

  • @DeepakGupta-pz4fx
    @DeepakGupta-pz4fx 10 หลายเดือนก่อน

    Spring boot microservice ka complete video bna do

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +1

      Course is not gonna come bro. We focus on learning while building some real stuff

  • @tarunkavipurapu6127
    @tarunkavipurapu6127 9 หลายเดือนก่อน

    Bro kya refreshToken generate karne keliye JWT ko use nahi karrahe ho kya is it just a random id

    • @SinghDevHub
      @SinghDevHub  9 หลายเดือนก่อน

      Jwt create krte hain jab refresh token expire nahi hua. Which means login page nahi dikhaya jayega. But agr dono expire hogye hain toh login page dikhaya jayega and dono generate kre jayenge. Generation toh always random unique UUID se hi hogi na bro

    • @tarunkavipurapu6127
      @tarunkavipurapu6127 9 หลายเดือนก่อน

      @@SinghDevHub so just a final clarification
      We have access token and refreshtoken with us and access token is a jwt token and refreshtoken is a random uuid
      If my above understanding is correct
      Can refreshtoken be also made a jwt because I have seen people do this in node js because in doing so the logic of creating expiration date for refresh token is handled by jwtservice
      And also I am doing this in mongodb for a seperate project so should I create a seperate table for refresh token or let it be string in user model

    • @SinghDevHub
      @SinghDevHub  9 หลายเดือนก่อน

      @@tarunkavipurapu6127 whole idea about storing refresh token is to validate it even after few days. as JWT will be stored on the client side and stateless for the server, and it needs to be passed over request always. Whenever our container/task will go down it will not have the context of JWT but will have refresh token persisted in the DB

    • @tarunkavipurapu6127
      @tarunkavipurapu6127 9 หลายเดือนก่อน

      @@SinghDevHub so refresh token is random uuid and acesstoken is jwt I was confused because in node we mostly make both of them as jwt hence it is not needed to store expiration date for refresh token as that logic is handled by jwt.
      Also I am following authentication with mongodb as db should I make refreshtoken as separate table or make it a property of existing user table
      Thank you for taking your time and replying

    • @tarunkavipurapu6127
      @tarunkavipurapu6127 9 หลายเดือนก่อน

      @@SinghDevHub thanks a lot for taking your time and replying man can you just give me hint on how to model database in mongodb to store the tokens and user info

  • @DIZITALHELPER
    @DIZITALHELPER 10 หลายเดือนก่อน

    Html valu change kaise kare but debugger is lock

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน

      Hain??

    • @DIZITALHELPER
      @DIZITALHELPER 10 หลายเดือนก่อน

      @@SinghDevHub bta do ji

    • @SinghDevHubShorts
      @SinghDevHubShorts 10 หลายเดือนก่อน

      ​@@DIZITALHELPER pooch kya rhe ho. Elaborate kro

  • @tejprakashupadhyay3321
    @tejprakashupadhyay3321 8 หลายเดือนก่อน

    Bruh UI design kr kronge kya?

    • @SinghDevHub
      @SinghDevHub  8 หลายเดือนก่อน +1

      Yes bhai try krenge don't worry.

  • @rajapandey773
    @rajapandey773 8 หลายเดือนก่อน +1

    Bhaiya, 18:00
    in CustomUserDetails
    while importing:
    import org.springframework.security.core.GrantedAuthority;
    import org.springframework.security.core.authority.SimpleGrantedAuthority;
    import org.springframework.security.core.userdetails.UserDetails;
    I am getting Cannot resolve symbol 'core'
    also, except getPassword and getUsername
    all other @Overrides
    saying--->Method does not override method from its superclass
    I tried to solve the error but it is not resolving please help

    • @SinghDevHub
      @SinghDevHub  8 หลายเดือนก่อน +1

      include lombok implementation, test implementation and compile implementation in build gradle. And try to run ./gradlew clean build

    • @rajapandey773
      @rajapandey773 8 หลายเดือนก่อน

      @@SinghDevHub Thank You so much it worked...took me some time but it worked
      while running ./gradlew clean build it gave errors indicating that the getGreeting() method cannot be found in the App class.
      Quite weird, but anyways I just defined it in App class and ran the build command again and it worked!

  • @Asingh42
    @Asingh42 10 หลายเดือนก่อน

    Bhai mera ek doubt tha mai
    Agar ham virtual threads ke sath @Async use kare to kya perfomance gain milega?
    I was trying something with virtual threads I am not sure if Should use them for a project
    Kindly help

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +1

      Virtual threads are indeed good but I haven't explored them in detail yet. They effect on scale when your service is running on high rps but for personal projects i dont think it will impact anything.
      You can use virtual threads and use clock timing to check the time it is taking to execute a request with virtual threads and without it. make 50-100 requests per second from Jmeter or Postman and then notice the average time. You'll know how much is the performace gain

  • @ayushkathariya
    @ayushkathariya 10 หลายเดือนก่อน

    Bhai kya mei spring framework aur spring boot intellij community version me sikh sakta hu ? I am beginner please reply

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +1

      Yes... IntelliJ community is more than enough

  • @nikhil4yourhelp670
    @nikhil4yourhelp670 6 หลายเดือนก่อน

    401 unauthorized error aa rha hai

    • @SinghDevHub
      @SinghDevHub  6 หลายเดือนก่อน +1

      Bro ye aage jaake solve krdiya hai, problem is just remove krdo @componentScan from the main application. It took days of mine to debug this little shitty mistake. reason is there in our latest video named "making our services production ready"

    • @nikhil4yourhelp670
      @nikhil4yourhelp670 6 หลายเดือนก่อน

      It also takes me 3 to 4 days . I searched here and there after I got frustrated and I think I should comment on this video

  • @DeepakGupta-pz4fx
    @DeepakGupta-pz4fx 10 หลายเดือนก่อน

    Can you create backend node js course please???

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +2

      Focusing on the Backend core using Java as of now.....

  • @DeepakGupta-pz4fx
    @DeepakGupta-pz4fx 10 หลายเดือนก่อน

    Complete ho gya kya project ??

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +5

      Auth service is completed. And we'll integrate rabbitmq in the next video with auth service

  • @mohammadaamir4370
    @mohammadaamir4370 10 หลายเดือนก่อน

    Bro Code git pe dalo na ki drive pe Thanks.

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +1

      Bhai Git pe meri SSH key add nahi ho rhi. Drive se lelo

  • @ias5462
    @ias5462 10 หลายเดือนก่อน +1

    Bhaiya u are going too fast and do not paste it, do it by coding slowly explaining the stuffs. As some of us being fresher don't have that deep knowledge. There's no issue being the vdo too long as dedicated ones will see entirely. But i want that our base is super strong so that it will help long run

    • @SinghDevHub
      @SinghDevHub  10 หลายเดือนก่อน +6

      Bhai basic cheezen paste krenge toh hi project complete hoga. Ek ek line code krunga toh 3 hrs ki video bnegi. And put efforts from your side too bhai. Ek ek line explain whi krta hoon jo advanced hai. If else explain nahi krskge