For anyone that might have the same problem I did: I was getting a 403 Unauthorized error in Postman when trying any request. I've noticed that what was being extracted from the jwt token was the username, but the way I was trying to find the user was by email. I had to create a 'find by username' method in the userRepository and then use that method in the ApplicationConfiguration's 'userDetailsService' method. I don't have my PC with me at the moment, sorry for the lack of details! EDIT: Forgot to give props to the OP, thank you SWErikCodes for this great video! It helped me lots!
Is this the new Spring Security? Literally every tutorial on yt is depreciated 😭
Great video. You should create more such tutorials and course series on springboot and java development topics.
I love you, you freking saved me from a mental breakdown. <3
Thank you, straightfoward to the point!! Greetings from Brazil.
Not seeing where to find all that information in .env with supabase... Idk if they updated it or something but I get to project settings > database > then it says connection string has moved but it gives like three options: direct connection, transaction pooler, and session pooler
I will put you on my daily pray, for start using vs code, where a Ctrl + P can start a project and copilot do its brilliant job 🙏🏽 Hahah nice video, surely deserves more likes and subscribers on your channel 😉
It seems to work but the expiration code and verification are not saved in the database and i cant understand why?
Could you create a tutorial or provide an explanation on how to deploy this API on a hosting service like Railway? Amazing video, really usefull!
I was learning from this video and things were ok. And when you started coding JwtService class, I totally lost and can't make any sense of the things. May be this is because I don't know how things work and which classes to call and which functions to override in order to establish security for our application. My concern and wish is that I want to learn that thing which you know to write this whole JwtService class. Because, it is only usable for a person who already have similar level of knowledge as you already have. Please share that from where should I start and what should I learn in order to understand this whole thing and that can make me capable of writing the security classes for my applications. Note: I know the basics and understand the workings of the Spring boot so that's not a problem. But I have no idea how to plan the whole security of the application and how to implement it. I've no idea of the provided classes and how to use them together to come up with JwtService type of classes. Please help, I'd be really appreciate and grateful to you.
Bro, Your "/users/me " and "/users" API are not working. Both the APIs are not generating any response. But the status code for both the APIs is 200😭😭😭
Thanks. Since there is login functionality, may you also show logout functionality.
Very well and comprehensively explained!
1:31:35 According to the controller, it should return the current user, but it doesn't return anything.
Very thanks, much wow :D Would recomend to go more into postman as you progress and show what does what. Like create first controler and service where you can see like all users and mby change password, then after security implemented show that you can now change only your own password. mby even more inner steps. When i did my project, thats kinda how i progresed. created rest api app, and then decided to implement jwt. This video is kinda long session and BOOM now it works. If you decide to go for it, please also implement email reset password. But still I appreciate this a lot, thank you
yoooo bro you're absolutely goated
Waow Creating the google app password was a hustle for some fun reason xD
I always wonder how you guys are able to build such a complex service..any suggestions ?
It's the old way of introducing JWT and isn't the best tbh. Spring Security features built in Oauth2 support. You can achieve same result with a few lines of code in configuration file. It also includes bunch of other features like different types of tokens, use of PKCE, refresh tokens and so on. I would suggest to start with understanding of OAuth 2.1. Because JWT by itself doesn't bring security to your application. JWT is just a type of token which is used for authorization.
@etc_fin__b_68_shashank_dor31