Easy JWT Authentication & Authorization with Spring Security | Step-by-Step Guide

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 239

  • @LearnWithIfte
    @LearnWithIfte  Před 6 měsíci +5

    When you are sending a request without a token or with the invalid token you will get a 403 status code. But this should be 401. So I make a video demonstrating how to fix it. you can check it from here:
    czcams.com/video/ucx6wo6dp98/video.html

  • @geybriyel2416
    @geybriyel2416 Před 5 měsíci +4

    Thank you so much! This is very helpful. I've been struggling a lot with implementing JWT-based security on my api during the last quarter of 2023. Almost all tutorials and guides were already outdated and contained a lot of deprecated methods, and reading the documentations were a pain in the ass too. I got stuck with my personal project cz of it. Until now! You saved a lot of beginners, Iftekhar. Thank you!!!

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci +1

      Thank you for watching. I am glad to know that it was helpful for you.

    • @elforeyyy
      @elforeyyy Před měsícem

      hello brother may you please assist me in my application used springboot security problem is after a successful login it's calling the login page again not redirecting to the specified endpoint. How can I share my classes with you

  • @irule10338
    @irule10338 Před 6 měsíci +8

    THANK YOU! Best video because you used up-to-date methods and not many deprecated ones like other videos

  • @shadow.youtube
    @shadow.youtube Před 6 měsíci +9

    Literally I watched lots of videos, didn't understand that much because JWT implementation java a little bit complex and finally got your video sir, this is really amazing for those(like me) who want to understand the architecture behind the implementation and the procedure of implementation. Really appreciate your valuable time and this amazing explanation. Thank a lot sir.

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci +1

      I'm glad my video could help you understand the complex topic of JWT implementation in Java! It's always great to hear that my explanations are helpful to viewers like you. Thank you for watching and taking the time to leave such a positive comment!

    • @Dulan_M_Herath
      @Dulan_M_Herath Před 6 měsíci

      same here, watched tons of videos but this one is the best of the best. everything is explained. short and sweet

  • @namelesssnerd
    @namelesssnerd Před 27 dny +1

    My only response is wow😲❤❤
    I have watched so many videos related to spring security but not like this. Finally found one. ❤❤❤❤ Huge respect.

    • @la-dev
      @la-dev Před 21 dnem

      Can you please share or list the videos you've watched already? As, I've also watching a bunch of videos to gather concepts and solidify things.

  • @caiovitor5197
    @caiovitor5197 Před 4 měsíci

    My man, you're a life saver, I was building a auth-server microservice for my college class and spring security wouldn't work. Threw that all way and followed your tips and guides, now it's running
    and the authentication is the sweetest thing. Thank you so much for your help!!!!

  • @eneser401
    @eneser401 Před 5 měsíci

    This tutorial is awesome, i didn't code for 2 years, now i'am back at it, it was very difficult, but this video was everything i needed, thank you so much.

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      Thank you for watching. I am glad to know that it was helpful for you.

  • @MortyfiedRick
    @MortyfiedRick Před měsícem

    You don't have a clue how much this video has helped me!

  • @HemantKumar-xl5dv
    @HemantKumar-xl5dv Před 3 měsíci

    Sir, I understood the concepts well because of your teachings.

  • @briangicharu2899
    @briangicharu2899 Před měsícem

    Very informative. I traversed so many spring boot auth videos and this one is the best

    • @la-dev
      @la-dev Před 22 dny

      I saw this same comment of yours on another video as well. Why you doing so?

  • @saravogelin
    @saravogelin Před 5 měsíci

    I really thank you for this tutorial. After searching for a long time this is the first one I found that is no using deprecated mothods for JWT version 12.

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      Thank you for watching. I am glad to know that it was helpful for you.

  • @user13443fg
    @user13443fg Před 5 měsíci +1

    Thankyou, it really worked for me! learned something new 👍

  • @manoharanrajendiran568
    @manoharanrajendiran568 Před 3 měsíci

    ❤You are making complex to very easy with your professional explanations. 🙌 ❤

  • @rouclecasonganyi3084
    @rouclecasonganyi3084 Před 6 měsíci +1

    I had a hard time finding a tutorial that uses version 12.x.x
    This one solved my problems
    Thanks so much

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      Thank you for watching. I am glad to know that it was helpful for you.

  • @naumtinga
    @naumtinga Před 3 měsíci

    Thank you for the updated and detailed tutorial on this subject

  • @TheStarboyVlog
    @TheStarboyVlog Před 6 měsíci

    I'm impressed🎉, Just for a suggestion when you write something can you please explain it's purpose so we can also understand it more clearly and it will be helpful for future audiences. ❤

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Thank you. I'll definitely consider explaining the code and its purpose in my future videos.

  • @user-re1eu1rp7h
    @user-re1eu1rp7h Před 7 měsíci +1

    it's a good one. clean explanation. It would be great if you could include refresh token as well.

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      Thank you for your comment! I'm glad you found the explanation helpful. I'll definitely keep your suggestion in mind for future videos.

  • @swannhs
    @swannhs Před 6 měsíci

    Please consider a tutorial spring boot with keycloak. Your explanation is really great ❤

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Thank you for the suggestion! I'll definitely consider making a tutorial on Spring Boot with Keycloak.

  • @saravanankaliyamoorthy49
    @saravanankaliyamoorthy49 Před 5 měsíci

    This really helped me a lot. Thanks for such a tutorial

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      Thank you for watching. I am glad to know that it was helpful for you.

  • @UsamaKhan-ct4bc
    @UsamaKhan-ct4bc Před 6 měsíci

    Best video so far on Spring Boot security.Respect!

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Thank you for the kind words, glad you enjoyed the video!

  • @user-vs8px9dl4i
    @user-vs8px9dl4i Před 6 měsíci

    Love the way you teach simple and perfect keep doing it

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Thank you so much for your kind words! I'm glad you find my teaching style helpful.

  • @zarroukkoussay6455
    @zarroukkoussay6455 Před 6 měsíci

    Great video!! It really helped me, I found difficulties since a long time in security but thanks for help

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Thank you so much! I'm glad the video was helpful for you in overcoming your security difficulties. Keep up the good work!

  • @andialdryan8470
    @andialdryan8470 Před 6 měsíci

    Perfect video sir, this very help full for me. Thank you for make this video!

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      Thank you for watching. I am glad to know that it was helpful for you.

  • @goutamnamdev1304
    @goutamnamdev1304 Před 6 měsíci

    Thank u sir for amazing explanation all concept is Crystal clear 🙌 so Thank you❤❤

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      I'm glad the explanation was helpful! Thank you for your kind words.

  • @pritambala4471
    @pritambala4471 Před 5 měsíci

    Love your content. Sir please post a video in a week🧡🧡

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      Thank you for yout support. I will try my best to do this.

  • @ASIAZH
    @ASIAZH Před 4 měsíci

    very easy to understand. thank you!!

  • @PatrickPulfer
    @PatrickPulfer Před 4 měsíci

    Thank you @LearnWithIfte!!!! Really helpful for my studies.

  • @SekharBabuBodipudi
    @SekharBabuBodipudi Před 6 měsíci

    Keep Going, You are going a long way. All the best

  • @user-ez7rx5di9v
    @user-ez7rx5di9v Před měsícem

    vaiya,spring boot micro services with real time projects er ekta complete playlist er jonno onurodh roilo in english please...love u....

  • @amodahegde2386
    @amodahegde2386 Před 3 měsíci

    Such a good video and very clear explanation!

  • @rahulpatil6871
    @rahulpatil6871 Před 6 měsíci

    best explanation and its new methods uimplemented in this video .can you make any end to end project with all validations for learning purpose can you please make it. It will help to lots of students .

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      Thank you for watching. I am glad to know that it was helpful for you.

  • @robertbiro1538
    @robertbiro1538 Před 3 měsíci

    Thanks! It was perfect, ! It really helped me!

  • @iRozdobudko
    @iRozdobudko Před 5 měsíci

    Great job! You have helped me a lot!

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      Thank you for watching. I am glad to know that it was helpful for you.

  • @russellandrady
    @russellandrady Před 3 měsíci

    Tutorial was good sir. Everything worked. But I would be happier if those configurations and other security implementations explained a bit better. I have to find them separately.

    • @LearnWithIfte
      @LearnWithIfte  Před 3 měsíci

      Thanks for watching. I will try to add explanation in my future tutorials.

  • @kutlinho
    @kutlinho Před 5 měsíci

    That was very useful. Thank you.

  • @MahadiHasan-qb9zw
    @MahadiHasan-qb9zw Před 3 měsíci

    Its really an amazing detailed video. Will you please enhance it by securing multiple microservices with this JWT authentication ?

  • @_DheebigaR
    @_DheebigaR Před 3 dny

    sir can you please do the same in spring mvc project(Using thymeleaf) for frontend

  • @bhargavmamidi7716
    @bhargavmamidi7716 Před 4 měsíci

    Sir could you please add the refresh token as well to this lecture?? That would be really helpful.. thank you.

  • @ruzibayevich1693
    @ruzibayevich1693 Před 6 měsíci +1

    bro great job, thank you so much

  • @paulb5317
    @paulb5317 Před 2 měsíci

    Shouldn't we access the endpoints(/demo, /admin_only) with the token generated by the login operation instead of register ? We suppose that we want the token to be different at every new login. Thank you.

  • @sonnees
    @sonnees Před 6 měsíci +1

    47:03 | 'Reactive' not use "new WebAuthticationDetailsSource", because ServerHttpRequest. pls!

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Please check the source code from github. You will find it in the description.

  • @inhhoang1542
    @inhhoang1542 Před 4 měsíci

    thanks for your video its very helpful

  • @beratmertgokkaya9495
    @beratmertgokkaya9495 Před měsícem

    Can you please tell me the color theme you used for this video? Also thank you for this lesson sir, helped me a lot.

  • @billv1425
    @billv1425 Před 2 měsíci

    I am getting a 401 error. I appreciate the video defining 403 vs 401, but could you do a video that fixes the 401 errors?

  • @l0gical998
    @l0gical998 Před 6 měsíci

    Love this! Keep going brother!

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Thank you so much for the support! Glad you enjoyed the video!

  • @la-dev
    @la-dev Před 21 dnem

    I'm so confused about the Spring security as every next person is talking about the up to date tutorial. That means after every six months the security changes? If that's so, how a given application in spring works if things are going deprecated so fast.

  • @akadeadahot7067
    @akadeadahot7067 Před 4 měsíci

    hey buddy its like a harry potter stick just wow .... because i have been doing this on today from early morning and stucked at debugging the code why some request permited but still not working and after seeing this tutorial with a source code i just have to change appplication.properties file nothing else and code runs fine.
    Many thanks for sharing video with us along with latest spring security filter chain implementation without any deprecated warning code. 🙂

    • @LearnWithIfte
      @LearnWithIfte  Před 4 měsíci

      Wow. Thank you for watching. I am glad to know that it was helpful for you.

  • @Se7_7
    @Se7_7 Před měsícem

    nice tutorial, but please what could be the course of error 403

  • @user-et7vb4ju6v
    @user-et7vb4ju6v Před 5 měsíci +1

    Здесь не хватает русского комментария.
    Спасибо.
    Сейчас тяжело найти актуальную JWT.

  • @user-tr9eb3kr6j
    @user-tr9eb3kr6j Před 5 měsíci

    It would be interesting to see how to host a spring project)

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci +1

      Thank you for your suggestion! I'll definitely consider making a video on hosting spring boot. Stay tuned for future content!

  • @MeuMundoTech
    @MeuMundoTech Před 3 měsíci

    Thanks from Brazil 🎉

  • @meryemOuyouss2002
    @meryemOuyouss2002 Před 3 měsíci

    Thank you sir ,but I have a question when I do register I found thé 401 code but i dont know why???

    • @meryemOuyouss2002
      @meryemOuyouss2002 Před 3 měsíci

      It's my fault, thank you so much for this video, now it's working very well

  • @aliksargsyan2782
    @aliksargsyan2782 Před 2 měsíci

    What kind of font family do you use on your intellij ?

  • @jeevaathecoder
    @jeevaathecoder Před 7 měsíci

    Great work sir, if possible make videos on chat applaication suing web socket

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      Thanks for the heads up! I'll definitely make a tutorial on this. Keep an eye on my channel for more updates!

  • @user-re1eu1rp7h
    @user-re1eu1rp7h Před 7 měsíci

    celan explanation. It would be great if you could include refresh token as well.

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      Thank you for your comment! I'm glad you found the explanation helpful. I'll definitely keep your suggestion in mind for future videos.

  • @diyorshodmonov969
    @diyorshodmonov969 Před měsícem

    Do Dear Iftekhar have a developer community group that asks for things they don't understand in any sociel network tg, instagramm or any other?

  • @HabiburRahman-dm5yt
    @HabiburRahman-dm5yt Před 3 měsíci

    thanks a lot.
    Jajakallah khairan

  • @erfannavab9805
    @erfannavab9805 Před 7 měsíci

    Great explanation. Thanks

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci +1

      Thank you so much for your kind words! I'm glad I could provide a clear explanation for you.

  • @Sebastian-zs8cp
    @Sebastian-zs8cp Před 2 měsíci

    Why don't you separate the responsibility from User Model and make a UserSecurity class and then implement UserDetails? 17:29

    • @LearnWithIfte
      @LearnWithIfte  Před 2 měsíci

      Its just one way to implement it. If you want to make a seperate UserSecurity class, go for it. Both techniques are right

  • @sreeganesh5219
    @sreeganesh5219 Před 2 měsíci

    Why we are not using @Autowired instead of constructor injection

    • @LearnWithIfte
      @LearnWithIfte  Před 2 měsíci

      You can check this video to understand it: czcams.com/video/fUsKNjGO4Is/video.htmlsi=eMrMs8vECrNY90eT

  • @uiyasser
    @uiyasser Před 4 měsíci +1

    brother, thank you for the video. i did everything as you did from what i understand. using postman, login/registration works. but when i log in and generate a jwt token and use that token to login in i get 401 error. i also get 401 error on every page other than the login/register pages. ive been looking at the source code trying to find a difference but i cant.

    • @LearnWithIfte
      @LearnWithIfte  Před 4 měsíci

      Please double-check the return value of *isValid* method in *JwtService class.* There is a _ "!"_ symbol, you have may missed.

    • @uiyasser
      @uiyasser Před 4 měsíci

      @@LearnWithIfte i have the "!" symbol, its in "!isTokenExpired" im not sure what else it could be

    • @LearnWithIfte
      @LearnWithIfte  Před 4 měsíci

      Please share your code. learnwithiftekhar@gmail.com

    • @uiyasser
      @uiyasser Před 4 měsíci

      @@LearnWithIfte i just sent the email, the subject is "github source code of jwt". thank you brother this means a lot

  • @CarlosGarcia-ll8zc
    @CarlosGarcia-ll8zc Před 6 měsíci +1

    Amazing video!!!🤙

  • @WoodPig
    @WoodPig Před 4 měsíci

    Your video has been incredibly beneficial to me, and I want to express my sincere gratitude.
    At around 58:30, wouldn't it be better to use the HTTP status code 201 Created for the /register endpoint?

  • @muhammedkerek9615
    @muhammedkerek9615 Před 3 měsíci

    Hello , thank you for the explanation when i register the token is generated , but when i try to login it's forbidden
    and in the database , the password is not hashed it's written as it is
    do you know why this might be happenning ?

    • @LearnWithIfte
      @LearnWithIfte  Před 3 měsíci

      Hey, thanks for watching. Unfortunately I don't have any idea why this is happening. Please check my code on github.

  • @subhashisbhowmik7
    @subhashisbhowmik7 Před 2 měsíci

    Thanks a lot dada
    springSecurity by default puts UserDetails isAccountNonExpired, isAccNonLocked, isCredentialsNonExpired as true

  • @atomichub5049
    @atomichub5049 Před 4 měsíci

    hello sir , I implemented jwt using your way for my USER entity class but ! there is one more class i.e VISITOR to that entity I also want to generate and validate token , how can i do so . let me remind you both these classes are two different entity classes and have different tables. hope you understand what i mean and I dont use roles and permission

  • @AmitThatera
    @AmitThatera Před 2 měsíci

    Please make a video on Oauth2 resource server with jwt

  • @MiguelContreras-qn2zg
    @MiguelContreras-qn2zg Před 2 měsíci

    Im having issues with cors not allowing my requests that are coming from my react front end, Im trying to send the POST login request we allowed and cors is blocking me saying "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource." do you know what could be causing this issue?

    • @LearnWithIfte
      @LearnWithIfte  Před 2 měsíci

      Hi, you can check this www.baeldung.com/spring-cors

    • @LearnWithIfte
      @LearnWithIfte  Před 2 měsíci

      this is another excellent resource: spring.io/guides/gs/rest-service-cors

  • @mika-if5wh
    @mika-if5wh Před 4 měsíci

    hello, i am able to log in and register but when i use the token to login i receive this error ".HttpMessageNotReadableException: Required request body is missing" and i am unable to log in. any ideas?

  • @leovelcamiloneto3608
    @leovelcamiloneto3608 Před 6 měsíci

    Simple and clean... 👍👍👍

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Thank you for your comment! I'm glad you appreciate the simplicity and cleanliness of the video. It's always great to hear positive feedback from viewers like you.

  • @anjakovacevic2996
    @anjakovacevic2996 Před 5 měsíci

    Hello, could you make a video on how to connect this with Angular app on front?

    • @LearnWithIfte
      @LearnWithIfte  Před 4 měsíci +1

      Thank you for your suggestion! I'll definitely consider making a on that. Stay tuned for future content!

  • @dinhhuy9714
    @dinhhuy9714 Před 5 měsíci

    hey, ur video has helped me a lot, but i got an eror 'ERROR: column "role" is of type roleenum but expression is of type character varying
    Hint: You will need to rewrite or cast the expression.' when i tried to insert user into database, pls help, i already altered the column role in database to enum. Tks a lot

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      Can you please share your code? You can share your github link. learnwithiftekhar@gmail.com

  • @krylok989
    @krylok989 Před 6 měsíci

    Amazing, good english, good explain

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Thank you so much for the kind words, I really appreciate it!

  • @Rajnish089
    @Rajnish089 Před 6 měsíci

    Beautifuly explained

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Thank you so much! I'm glad you found the explanation helpful.

  • @ikac11
    @ikac11 Před 4 měsíci

    thank you so much!!!!!

  • @kriperek31
    @kriperek31 Před 5 měsíci

    Great video, great job

  • @mausamrayamajhi
    @mausamrayamajhi Před 2 měsíci

    Can we get new video for writing test cases for this project?

  •  Před 6 měsíci

    Very helpfull video! Could you please tell me what Theme you use for IntelliJ? I really like the colors of your editor :)

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      I'm glad you found the video helpful! The theme I use for IntelliJ is called Material Theme UI, it's one of my favorites too!

  • @user-ez7rx5di9v
    @user-ez7rx5di9v Před měsícem

    vaiya ,please make a video on bkash ,nagad payment gateway with spring boot please...

  • @user-nj5to9yz6p
    @user-nj5to9yz6p Před 6 měsíci +1

    Thanks for the great video! I completely copied your project, a new user registers, a token is issued, but when I try to authorize the user on /demo or amine I get 403, by the way, the same in your previous example, the /login page opens, and on /user and /admin I get 403. Tell me what could be the problem? I’m creating a new project, the dependencies are the same, I copy your code completely, I don’t add anything, but I get 403. Thank you in advance!!!!

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Can you please share your code?

    • @user-nj5to9yz6p
      @user-nj5to9yz6p Před 6 měsíci

      Oh, I added the code from your repository and it worked! Thank you! Now I’m thinking about how to combine this with thymeleaf)))@@LearnWithIfte

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      With thymeleaf you do not need this jwt token. You can check this video czcams.com/video/jPmkcFjbQCM/video.htmlsi=u-KrMMBnNBmdu2KD

  • @ramazanmashanlo3432
    @ramazanmashanlo3432 Před 7 měsíci

    Thanks for video, and what about cors? If we will call this api from frontend.

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      Thanks a lot for watching my video. I will write a blog on this and will share with you here. Hopefully, it will be helpful for you.

  • @arunsara2183
    @arunsara2183 Před 7 měsíci

    Great Explanation. I also got problem in using @PreAutorize like how can we use it in latest versions of spring

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      Thanks for your comment! I'm glad you found the explanation helpful. To use @PreAuthorize in the latest versions of Spring, you can simply annotate your method or class with @PreAuthorize and provide the necessary permissions or roles as arguments. Make sure you have the necessary dependencies added to your project as well. Let me know if you have any specific questions!

    • @arunsara2183
      @arunsara2183 Před 7 měsíci

      @@LearnWithIfte yeah but that's the problem i was facing while using @PreAuthorize I got 403 but while setting up role authorization in config file it works fine.

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      @@arunsara2183 can you please share your code via github?

  • @Selvin_raja
    @Selvin_raja Před 4 měsíci

    Thalaiva your great 💥💥

  • @berkegurel6836
    @berkegurel6836 Před 5 měsíci

    Great tutorial however after ı wrtie the config class ı get 403 for my any POST request include login and register to (yes i disabled csrf)

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      Please check if you are sending request with proper request body. Request is case sensitive. You can check the code in my GitHub. Link is in the description.

    • @berkegurel6836
      @berkegurel6836 Před 5 měsíci

      @@LearnWithIfte I found my issue(my 168 bits key does not enough for jwt. I found it when i debugging @EnableWebSecurity(debug = true)) thanks

  • @whiteboard_Life
    @whiteboard_Life Před 3 měsíci

    why do we need to save JWT token into database?

    • @LearnWithIfte
      @LearnWithIfte  Před 3 měsíci

      Please check this video. Here I have explained the reason. czcams.com/video/OpSU0VgfkL4/video.html

  • @romanmanzhula9034
    @romanmanzhula9034 Před 6 měsíci

    Thank you for good video.
    If somebody see in terminal - "org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL .....",
    just add
    jpa:
    generate-ddl: true

  • @prashupandey1304
    @prashupandey1304 Před 4 měsíci

    Sir my auth header is coming null how to debug it

  • @sameerkurkure231
    @sameerkurkure231 Před 10 dny

    I am using java 1.8 , it is not working after your 6 mins video as well

    • @LearnWithIfte
      @LearnWithIfte  Před 10 dny

      The minimum required Java version for this is 17.

  • @diyorshodmonov969
    @diyorshodmonov969 Před měsícem

    Hello, greetings from Uzbekistan
    Thank you very much, it was a very useful video, you explained it clearly, but I can't use it, it returns 401

  • @rafaelalfonsocorredorgambi1893

    Hello friend, I need help with the code, it allows me to register and login but when I access the endpoint it gives me a 200, however it does not return anything, but when the token is correct, it may be that it doesn't matter at all.

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Please share your code. You can send me your GitHub link via email. You can find my email in my channel

  • @abhishek_67
    @abhishek_67 Před 7 měsíci

    In company also security services build like this or any difference is there?

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      It depends on the requirement. In this video, I have shown the fundamental thing. In the real world companies may require an extra level of security. If you can understand the fundamental level, then you will be able to do the advanced levels of work. But you need to study a lot.

  • @enescagrbayraktutan6329
    @enescagrbayraktutan6329 Před 7 měsíci +1

    Excellent explanation

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci +1

      Thank you for your kind words! I'm thrilled that my explanation resonated with you.

    • @enescagrbayraktutan6329
      @enescagrbayraktutan6329 Před 7 měsíci

      @@LearnWithIfte I would loved to see fullstack guide with react to fully cover spring security, like you did in Auth0. Keep up the good work man!

  • @ndjouenkeudikaabelrudy9994
    @ndjouenkeudikaabelrudy9994 Před 5 měsíci

    Hello, what if I want to add more than the username in the JWT payload ?

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      You need to some tweak. First inside jwt service class you need to create a method to generate other property. below is an example of the method:
      Map getMyClaimsMap() {
      Map extraClaims = new HashMap();
      extraClaims.put("hello", "world");
      return extraClaims;
      }
      then you need to update generateToken method as follows:
      public String generateToken(User user) {
      Map claims = getMyClaimsMap(); //get extra properties
      String token = Jwts
      .builder()
      .subject(user.getUsername())
      .issuedAt(new Date(System.currentTimeMillis()))
      .expiration(new Date(System.currentTimeMillis() + 24*60*60*1000 ))
      .claims(claims) // set extra properties in token payload
      .signWith(getSigninKey())
      .compact();
      return token;
      }
      Hopefully It will help.

  • @makamemawe1072
    @makamemawe1072 Před 5 měsíci

    Thank you allah bless you

  • @eyadhantoly5796
    @eyadhantoly5796 Před 5 měsíci +1

    1:05:21
    Status: 403 Forbidden
    I did every thing right, why may this happen ?

    • @madhunt378
      @madhunt378 Před 5 měsíci

      same to me

    • @LearnWithIfte
      @LearnWithIfte  Před 5 měsíci

      please share your code via github. you can send mail to learnwithiftekhar@gmail.com

    • @tanushachekkapalli5251
      @tanushachekkapalli5251 Před 4 měsíci

      Same to me

    • @LearnWithIfte
      @LearnWithIfte  Před 4 měsíci

      @@tanushachekkapalli5251 please check the isValid method in the JwtService.java class. many people make mistakes while writing return statements of this method. You can follow the source code from the github

    • @enderutlu791
      @enderutlu791 Před 4 měsíci

      Guys i solved my problem. It was on JwtAuthenticationFilter. In the line "if(authHeader == null || !authHeader.startsWith("Bearer "))" i forgot the "!" before the "authHeader.startsWith" function. This causes you to be able to login and register but not use any other endpoint.

  • @zayedh8089
    @zayedh8089 Před 7 měsíci

    greate work ,could you do a curd of anything with role (admin and user )with spring angular and token i have some issues in that

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      Sure. I will make a tutorial on that soon.

    • @Kamilek96
      @Kamilek96 Před 7 měsíci

      @@LearnWithIfte Refresh tokens and external auth providers would be awesome too! :) Great tutorial

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci +1

      Thank you for your feedback! I'm glad you found the tutorial helpful. I'll definitely consider covering refresh tokens and external auth providers in future videos.

  • @sujitkumar2196
    @sujitkumar2196 Před 3 měsíci

    Awesome but the way you implemented is not correct,
    1.First user registre then server will send a success response your registration is success now you can login.
    2.Then user will login will crendetial now server will send a access token.

  • @manish_55
    @manish_55 Před 6 měsíci +1

    @LearnWithlftekhar why do you use personal preference as application.yml please use application. property because a guy who is new in programming can confused

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      Thank you for your input! I appreciate your concern.

  • @InternationalNewsbd
    @InternationalNewsbd Před 7 měsíci

    clean explanation

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      Thank you for watching! I'm glad you found the explanation helpful.

  • @user-ss9sn6zr5t
    @user-ss9sn6zr5t Před 7 měsíci

    Thank you for your work! I have a question. When you are accessing "/demo" without a token, you get a 403 error. But shouldn't it be a 401 in this case? A 403 means that you are authorized but do not have access, while a 401 means that your token is invalid/empty. How can this issue be solved?

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      Thank you so much for your support and for bringing up this question! It's great to see that you're paying attention to the details. You're right, there seems to be a mismatch in the error codes. I'll look into it and work on finding a solution. Your feedback is truly appreciated!

    • @LearnWithIfte
      @LearnWithIfte  Před 7 měsíci

      Hi,
      I have figured out the solution. We need to add a CustomAccessDeniedHandler to provide 403 error for appropriate cases and also need to add an exception handler in the SecurityFilterChaing method to handle both 401 and 403 status. I have pushed the update to the git. you can check it from github.com/hello-iftekhar/springJwt

    • @LearnWithIfte
      @LearnWithIfte  Před 6 měsíci

      I have made a video fixing this issue. You can check it from here:
      czcams.com/video/ucx6wo6dp98/video.html