You had me in the first 20 seconds , tutorial hell has brought me here i was almost loosing my mind on spring security
@user-zj6iz1rl8dАй бұрын
Spring is probebly the worst framework to learn their is so much bs
@44Ricko21 күн бұрын
@@user-zj6iz1rl8dif it wouldnt be used so much in the industry, i would never fucking touch it again.
@cydoentis Жыл бұрын
This video hit the nail on the head, I watched countless other videos from other people before I found this one, and the content was either outdated or poorly explained. I appreciate that you did everything from scratch and explained each step. Wish I found this video about 8 videos earlier, but I finally understand the whole implementation process for Jwt's. 11/10 will watch again.
@aboubakrghout818011 ай бұрын
if u get it can u help me ?
@vsaihruthikreddy71279 ай бұрын
All I could say this is an extraordinary tutorial. I tried all of the spring security tutorials but they did not cover the nitty gritty aspects of it like the jwt token creation and authorization but you just were superb. Thank you very much for uploading a gem ❤
@adarshpandey852611 ай бұрын
You just revived my passion for spring boot based backend development. Thank you so much. This is the best spring security crash course I've found on KZbin even better than the inspirations you mentioned in this video. The reason is, that you used less jargon and fancy Java. You showed basic Java skills to explain an already complex spring security concept which feels smooth. Most of the creators from the Java community tend to use a lot of fancy Java design patterns and advanced Java features which causes great difficulty for freshers to understand such complex concepts. Constructive Criticism: I have one small suggestion for you, the cutting of your voice is really not good. There are no pauses between your speech, leading to you sounding monotonous even when you're not. Also, it made me rewind many times since I never understood where one sentence ended and the other began. Love your content. keep going ♥
@maz1ogra Жыл бұрын
This video is a compilation of everything useful that is said in the other videos, discarding all the other useless things that are said, updating it to the latest versions of spring. Liked the video, keep it up.
@aman_deep21 Жыл бұрын
What a fantastic to the point video it is, Thank you so much Ethan for sharing valuable knowledge with all of us, my knowledge before and after watching this video has increased very much, looking forward to more of your videos. I had watched a bunch of videos on this topic, but your explanation made it much easy to follow and code along with you.
@mrowox Жыл бұрын
What I usually want to see in security videos is handling security for different type of roles. E.g a backend service for sellers and buyers, drivers and riders, students and teachers and so on
@jhonandersonperaltaochoa9833 Жыл бұрын
lo que tu quieres es manejo de roles
@anywho3934 Жыл бұрын
hey have you figured it out ? any other resources you found ? cause I have to implement it in project
@MyBinaryLife Жыл бұрын
this logic is implemented in the SecurityFilterChain bean in your security configuration class
@fetterollie54 Жыл бұрын
Great video and working around the deprecated methods wasn’t too bad and was a very good practice of working with documentation. Thanks for putting this all together. 👏🏼👏🏼👏🏼
@mathewfrancis4167 Жыл бұрын
how did you get the JwtAuthenticationConverter to work in the SecureityFilterChain ?
@fetterollie54 Жыл бұрын
@@mathewfrancis4167 I’ll check in a bit and get back to you
@mathewfrancis4167 Жыл бұрын
@@fetterollie54I'll be infinitely great-full when you will :)
@fetterollie54 Жыл бұрын
@@mathewfrancis4167 Not sure if you can put code blocks in here: @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{ http // disable cross site request forgery .csrf(csrf -> csrf.disable()) // any http requests are authorized .authorizeHttpRequests(auth -> { auth.requestMatchers("/auth/**").permitAll(); auth.requestMatchers("/admin/**").hasRole("ADMIN"); auth.requestMatchers("/user/**").hasAnyRole("ADMIN", "USER"); auth.anyRequest().authenticated(); }); http .oauth2ResourceServer((oauth2) -> oauth2.jwt(jwt -> jwt.jwtAuthenticationConverter(jwtAuthenticationConverter()))); http .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)); // build into security chain return http.build(); };
@fetterollie54 Жыл бұрын
Also I stepped away from the project a month ago and haven’t looked at it since. Hope this is what you are looking for…
@mohssinedardar410 Жыл бұрын
Thank you so much! I highly recommend this video to anyone who wants to learn about Spring Security. It is a comprehensive and informative resource :)
@sajithkumarganesan9823 Жыл бұрын
Fantastic Video, Thank you for putting all this together in one place and having it explained very clearly and at a steady pace. Great work!!!
@CarlosSousa-cq3jc6 ай бұрын
After thousands of videos on spring security, I finally found an excellent one
@tyjantefinn47912 ай бұрын
You are a true champion by not using Lombok Sir. Lol. When you did your first round of Encapsulation, I immediately implemented Lombok ;D
@aharoJ8 күн бұрын
Absolute gold of a video
@apurvasaha8871 Жыл бұрын
Finally found a video for working around the older deprecated methods. Thank you very much. Edit: Unable to generate the jwt token during login, and getting a 401 Unauthorized error response back. Might be an issue with the deprecated jwt() method in oauth2ResourceServer(oauth2ResourceServerConfigurer::jwt()). But even with the new code oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults())) which provides a default implementation of the oauth2ResourceServerConfigurer class its not working. If anyone has faced the same issue and solved it, Please let me know. Thank you.
@TheMrBatica Жыл бұрын
I had exact the same issue but I skipped the line 'daoProvider.setPasswordEncoder(passwordEncoder());' under SecurityConfiguration class -> AuthenticationManager ... i had only "daoProvider.setUserDetailsService(detailsService);" hope it helps.
@manmitapatnaik2513 Жыл бұрын
Yes please help in this. I am facing the same issue in intellij.
@manmitapatnaik2513 Жыл бұрын
@@TheMrBaticaBut here daoAuthenticationProvider.setUserDetailsService(detailsService) is used . So what did you exactly change
@TheMrBatica Жыл бұрын
I wrote what was my problem. I didn't have -> 'daoProvider.setPasswordEncoder(passwordEncoder());
@bochunator11738 ай бұрын
@@TheMrBatica Thanks, I had the same problem. Maybe someone has the same issue, so here I put proper code: @Bean public AuthenticationManager authManager(UserDetailsService detailsService) { DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider(); daoProvider.setUserDetailsService(detailsService); daoProvider.setPasswordEncoder(passwordEncoder()); return new ProviderManager(daoProvider); }
@pranavthakkar272010 ай бұрын
The Best explanation I have even seen for spring security and jwt authentication. Thanks alot.
@cod4basterd Жыл бұрын
Holy crap. Thank you so much; this is amazing. Top tier content. I learned so much from this compared to hours of Amigoscode or Dan Vega. Nothing against those guys, they just have so much content to get through and a lot of it is outdated. Thank you so much for putting this together. I got what I needed out of it and then some.
@superkobke Жыл бұрын
Well done. Had some troubles with dependencies but overall your video is quite amazing! Thank you so much!
@romanlobko1293 Жыл бұрын
Amazing video! Such a complex topic was explained in a relatively simple way, thank you!
@Justdiealready6Ай бұрын
this guy is a true legend fr
@koffeetalk Жыл бұрын
Wow, first time I get it right. Thank you! This channel should have much more followers. I had some issues using Lombok, but when I did all the constructors, getters, setters manually it's finally worked! I guess I need more experience with constructors first, then use lombok.
@unknownkoder Жыл бұрын
I have also had issues with Lombok and I know others sometimes do as well. That is why I chose not to use it in this video.
@ShermukhammadKarimov3 ай бұрын
thanks for this amazing masterclass
@SailBuddha11 ай бұрын
This was fantastic! I followed it, but changed JPA to jdbcTemplate, because the road to Hell is paved with too much abstraction. Doing it that way, everything made perfect sense. Thank you!
@sherlockholmes1605 Жыл бұрын
Liked the video! Here's an idea for future tutorials, can you create git branches for each chapter? this way we can go back and forth between different chapters to compare and contrast the changes.
@anurp417311 ай бұрын
Wow, you had me in the first 20 seconds. Got the problem absolutely spot on. thanks
@anurp417310 ай бұрын
I have done exactly as you have mentioned in the video upto configuring basic authentication, I keep getting 401 unauthorized exception despite supplying the username and password correctly
@alexbrun6863 Жыл бұрын
Absolute legend for making this
@andtif Жыл бұрын
GOAT
@pradeepk2864 Жыл бұрын
perfect video, everything will go smoothly without getting any blocker for me, thanks brother for such a nice video😍
@shauryatomer10586 ай бұрын
Thanks, for this great tutorial. Concise and blazingly fast.
@khacthinh23.06 Жыл бұрын
tôi mới học khá lúng túng với spring security nhưng xem hết video của bạn tôi đã hiểu hơn rất nhiều, cảm ơn video của bạn.
@kwamekyeimonies Жыл бұрын
Yeah, very true.about 80% of the videos sessions use deprecated modules
@daffarandika31484 ай бұрын
clear and concise, great video mate!
@ajaypt194711 ай бұрын
Spring Security is confusing but you did a great job. I found a lot of things in one place it helped me a lot. Thanks
@Mihai-mb4ew Жыл бұрын
Man, this video is top notch. It is exactly what was missing from youtube. Could you, please, share with us, how did you figure all this out? What materials did you use for documentation or how was your thought process? Or maybe is it just experience? I watched Dan Vegas' video about JWT and I was really wondering how to achieve role authorization. I wouldn't have figured it out by myself.
@DarkHid39 ай бұрын
Good video, I watched it to the end, kinda hard to understand the whole thing because I've just started learning this framework but with the time for sure I will comeback and watch it again!
@KieranMueller Жыл бұрын
fyi if you are struggling with deprecated methods, or other things (example: I was unable to run project due to an error with the security filter chain method, request matchers specifically. You can always just downgrade the version of Spring Boot in your POM.xml to use what was used in the video and everything will work.
@kennethisaac233 Жыл бұрын
Nice idea
@kheydbeats Жыл бұрын
It was indeed an absolute Behemoth of a video! Great tutorial, loved the pacing and the explanations. My subscribe and like is your good sir.
@professionalyoutubevideowa37 Жыл бұрын
Excellent tutorial. This is just what I needed to get started.
@maelina22225 ай бұрын
This is a really great tutorial. Thanks for this
@curiosabouttech Жыл бұрын
Thank you so much after searching alot i found this video that covered my ground up spring security and jwt thank you man.
@Justsomeguy492 Жыл бұрын
thanks for a clear video. its incredible how spring security team has no good documentation for spring security 6
@rashidcollins6337 Жыл бұрын
one of the best security tutorial, clear explanation, am now confidence about spring security. Thank you @Unknown Coder
@yogeshpatel2463 Жыл бұрын
my project is not running bro
@iuliszekely8397 Жыл бұрын
Can you help me with something? I got stuck at some point
@existence_zero1692 Жыл бұрын
This video is the best spring security video ❤
@malbunb11 ай бұрын
This is a greate tutorial. Thanks for that!
@kumar-mh6hy Жыл бұрын
great content video with proper explanation keep doing contents like this 😍, i was looking for this type content for many days, i just wasted a lot of time but this saved my time and can explain how to save roles in DB annd retrieve it from DB and also about OAuth 2.0
@maingawesley82129 ай бұрын
Trust me I haven't started this tutorial, I just read the description and I know Spring Security is bagged already😆😅
@amitgrover1992 Жыл бұрын
Thank for the detailed explanation, please suggest how to do authentication for an application using Thymeleaf and MVC controller.
@podcasts.clips.delivery Жыл бұрын
Brother, you are a lifesaver!
@harshpratapsinghshekhawat3034 Жыл бұрын
Much needed video on the upgraded ways of Spring Security, I'm glad that i was able to find it I have a request though, could you also post a video on formLogin using spring security
@dev-i2m9 ай бұрын
Absolutely amazing video, learned a lot from this, Thanks!!
@tylerljohnson Жыл бұрын
excellent tutorial, and thank you for the timestamps!
@Justin_Jay Жыл бұрын
Wow. Thank you for this. Brilliant
@salehemwanga54086 күн бұрын
Great Video!
@oshannanayakkara61879 ай бұрын
Bro this is golden
@t0khyo Жыл бұрын
Toturial hell got me here bro 🗿👍🏿
@duri4677 ай бұрын
mega tutorial man, THANKS !
@aashirsiddiqui177 Жыл бұрын
Thanks for the vid, the deprecated APIs were a pain in the ass!
@olliDeg Жыл бұрын
Great video, really helpful!
@codex879710 ай бұрын
Thank you so much bro, you are a life saver
@timonka1zer8228 ай бұрын
Thank you for your content!
@mr_bla_ Жыл бұрын
fantastic video thanks lot
@RotorVideos019 ай бұрын
Thank you for the video!
@삐따기-s7y7 ай бұрын
Wonderful! Thanks!
@kvittitoe Жыл бұрын
fantastic video
@randomforest_dev Жыл бұрын
thanks for this awesome tutorial! very helpful!
@simeonrubko1218 Жыл бұрын
Fantastic video...only problem I recieved was at 1:35:00 during login There is no PasswordEncoder mapped for the id "null" i don't know if I have done something wrong or need to update spring security....it doesnt work with admin as well
@unknownkoder Жыл бұрын
Double check the repository in the description, I believe you are missing the mapping for the password encoder in the SecurityConfig class.
@simeonrubko1218 Жыл бұрын
I double checked it and there was nothing missing..but when I copied all code from Config class it suddenly worked..thanks for the answer@@unknownkoder
@simeonrubko1218 Жыл бұрын
I have one more question though..now that we have functional webapp working through postman.. how can I set up this to work within webpage ? I mean now we have working hashing and tokens.. I created login and register form.html but don't know how to connect those parts together
@rohity294 Жыл бұрын
@@unknownkoder same error for me too.
@NishantBudia Жыл бұрын
I had the same problem, for me I had not set the password encoder in the AuthenticationManager Bean in security config @Bean public AuthenticationManager authManager(UserDetailsService detailsService){ DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider(); daoProvider.setUserDetailsService(detailsService); daoProvider.setPasswordEncoder(passwordEncoder()); //this line I had not written return new ProviderManager(daoProvider); }
@mathewfrancis4167 Жыл бұрын
Lovely just what i needed ... i'm new to this level of spring security ... so I hope this question isn't a silly one ... i would like to know how and where you generated the public and private key in you code... thank you :)
@bajrangchapola674810 ай бұрын
Great Content!!! Can you make a video on how this authentication backend works with API gateway ? Any of the members if know
@vipulwarik Жыл бұрын
Thank You! That was very helpful
@bojidaryordanov2035 Жыл бұрын
Insane video. Ty so much
@AlessandroMorelli-i1l Жыл бұрын
This video is amazing
@abdelmoneimelshafei6570 Жыл бұрын
Big thanks, Sir 🥰🥰🥰
@MathiasDurrenberger10 ай бұрын
Well done. A 1000 thanks
@BeneTanStarcraft Жыл бұрын
Thanks for this video!
@sasaprograma Жыл бұрын
Great content, thanks a lot!!
@gaddp Жыл бұрын
sick hoodie man
@bryanantoine8911 Жыл бұрын
great video helped me a lot
@manishareddy110 ай бұрын
Great Video..Thank you so much
@jackedkarlmarx5 ай бұрын
Hey @Unknown Koder, I fixed the bug you encountered at 1:41:35, apparently this stems from a deprecated use of the jwt() Method, this is the correct way of configuring it as of Spring Security 6.1.x: .oauth2ResourceServer((oauth2) -> oauth2 .jwt(jwtConfigurer -> jwtConfigurer.jwtAuthenticationConverter(jwtAuthenticationConverter())))
@AhmetMurati Жыл бұрын
in first minutes I subscribed
@KuldipGhotane Жыл бұрын
It was brilliant, please add oauth 2 support for the same repo
@lucaspraado Жыл бұрын
Hi man, i have this erro in my securityConfiguration. line : .oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt) Error: 'jwt()' is deprecated and marked for removal Do you no fix?
@onadiranbayonle2368 Жыл бұрын
you can have it like this http .oauth2ResourceServer(oauth2 -> oauth2 .jwt(jwt -> jwt .jwtAuthenticationConverter(jwtAuthenticationConverter()) ) );
@josefjanda4008 Жыл бұрын
Is this some help for this part of code?
@ashishprakashsingh90739 ай бұрын
If anyone please help
@fahrican9708 Жыл бұрын
great video!
@vatana7 Жыл бұрын
Thank you for your tutorial
@madukaPcm8 ай бұрын
Greate tutorial, Am asking for getting an end-point which returns an access token by accepting refresh token, Note Access token should also be returned on login attempt.
@WilliamBurroughs-q3b Жыл бұрын
Thanks very much for the vid! Really enjoy your teaching style! I am having a bit of a problem though, when I change the loadUserByUsername() method inside the UserService class to call findUserByUsername on the repo, the app stops accepting a valid username & password combination of admin. I have checked the database and the user admin tuple is definately there but I get an error 401 no matter what I enter? Have been stuck on this for a few days so would appreciate any help! Thanks very much in advance!
@unknownkoder Жыл бұрын
Sounds like a problem in the Spring security configuration most likely.
@WilliamBurroughs-q3b Жыл бұрын
@@unknownkoder Configuration public class SecurityConfig { @Bean public PasswordEncoder passwordEncoder(){ return new BCryptPasswordEncoder(); } @Bean public AuthenticationManager authenticationManager(UserDetailsService detailsService){ DaoAuthenticationProvider daoAuthenticationProvider = new DaoAuthenticationProvider(); daoAuthenticationProvider.setUserDetailsService(detailsService); return new ProviderManager(daoAuthenticationProvider); } @Bean public SecurityFilterChain filterChain (HttpSecurity http) throws Exception{ http .authorizeHttpRequests((authz) -> authz.anyRequest().authenticated() ) .httpBasic(withDefaults()); return http.build(); } } This is my ssecurityConfig at 47 mins - Can you see anything that might be causing this? Thanks in advance!
@paulosamvrosiadis3484 Жыл бұрын
i have the same problem , have you solved it ?
@WilliamBurroughs-q3b Жыл бұрын
@@paulosamvrosiadis3484 Yes! Turns out I wasn't sending the POST request properly. Using postman & ensuring I was sending a POST request properly helped solve it. Goodluck!
@hamzaazeem4602 Жыл бұрын
Same problem :(
@sabinsesumariyan3687 Жыл бұрын
very good content
@kaydanderson4487 Жыл бұрын
Awesome video, I followed everything you said (mostly) and got postman working at the end, but Im a bit confused on how to implement a login page and move to a secured page?
@QmGhq2T7CzQ Жыл бұрын
I am using DOMA, I can't declare the Set authorities as it says it is not supported as persistent type.
@michaels204811 ай бұрын
Thank you for the video, do you know how i can be able to display this information in my next js project
@carlosmollapaza92678 ай бұрын
How to validate jwt is invalid or expired?
@theominarinidemelo756 Жыл бұрын
TU É FODA MAN, VC É INCRIVELLLLLLLL
@domingosgilubisse9606 Жыл бұрын
Thanks a lot mate. Could you add Refresh Token?
@unknownkoder Жыл бұрын
Its definitely an idea I can jot down for a future video.
@abdelkadermiladi564710 ай бұрын
THANK YOU
@Blazs120gl Жыл бұрын
Hi, this was an exhaustive example I've been looking for. Thank you very much! I would like to extend this project with static HTML pages. How can I do that? I've added HTML pages (e.g. an index.html under resources/static) but I can't access any of the pages. they're all blank and I get 401 responses to them. I tried to add the static path to auth request matchers, but no joy so far. Any ideas what's missing? Thanks in advance!
@sfgmbkmbksfg37229 ай бұрын
Mind blowing
@patel5532 Жыл бұрын
I would be great if you upload separate small lecture like 15-25 min length tutorial, Long lecture are so overwhelming and it looser the interest.
@unknownkoder Жыл бұрын
This is why I created chapters, people can watch at their own pace and come back to specific places where they left off.
@jongyoon-k3d Жыл бұрын
best ever
@luciano50268 ай бұрын
Thank you !!!!
@gatio23 Жыл бұрын
Very nice video! Can you tell me how to log out with a jwt token? Should I store it in tokenRepo and disable it on logout? Thanks!
@unknownkoder Жыл бұрын
Yes, there should be something along the lines of an invalidate method for your token object.
@eugenesmith9940 Жыл бұрын
Do we really need to return user credentials (even if it's wrapped into some DTO without any sort of sensitive information)? I mean is it so-called "best practice" or we can just return simple status code? Is it mandatory to return anything or we can just use void methods in such cases?
@unknownkoder Жыл бұрын
Its not mandatory, however some applications may use some of the users information in the frontend of the application. This is why I send back basic info in the tutorial.
@Sparrow-tn9jj Жыл бұрын
Hello, good tutorial. Can you please tell me how to deal with CORS? Simply adnotating the controller wont work
@unknownkoder Жыл бұрын
Theres a CORS configuration you must setup inside the Configuration class and inside the config bean