Spring Boot Spring Security JWT: How to authenticate with a username and password

preview_player
Показать описание
In this tutorial, you will learn how to authenticate from a Spring Boot controller with a username and password and return a JSON Web Token in the response. This is a follow-up to a previous tutorial I did on Spring Security + JWT but in that tutorial, I used HTTP Basic Authentication.

🔗Resources & Links mentioned in this video:

👋🏻Connect with me:

Рекомендации по теме
Комментарии
Автор

Another great video, thanks Dan! Just a quick addition: if you are using a custom password encoder (i.e. the BCryptPasswordEncoder) you then have to pass that to the DaoAuthenticationProvider as well.

alexgutjahr
Автор

Nice tutorial, most jwt tutorial out there uses external library to generate keys for your project. Authentication is hard to learn and you're rocking it.

zhenobiikuzo
Автор

I love how accurate and compressed your content is because you are pretty straightforward and understandable.

SmartP
Автор

Dan Vega, I just want to say that Im thankful for this and other tutorials you upload, and I mean that from the bottom of my heart. Im learning a lot from this kind of videos, you are capable of explaining complicated things in a short and clear manner.

sanquinteros
Автор

Thank you for the precise and understandable content.🙏 I will be waiting for the following content about spring security.🎉🎉🎉

sayilircoder
Автор

I love this have been looking a simple way for password authentication but you got me coverted. keep up the great tutorials. Much love for your content.

franciskinyuru
Автор

That was super useful Dan! Thank You very much, maybe let's try to investigate OAuth2 with resource/client/auth server maybe based on Spring Auth Server which is coming with new Spring Boot 3?

bartomiejdziadosz
Автор

This is probably one of the most sought after videos I've ever had

nicholasferrara
Автор

That AuthenticationManager part was very helpful, thanks Dan!

szymontamborski
Автор

It's the video I was looking for. Thank you for making it!

Patric-cgzd
Автор

I have been searching for an easy to digest content on Spring Security, you gave exactly what I was looking for Dan Vega. Already subscrided and looking forward to seeing more amazing content from you.

Thank you.

AlagieFNget
Автор

Hi Dan. It has been a video series filled with very clear and understandable explanations. Thank you so much for your service

drewenia
Автор

awesome, thanks. I couldn't find anywhere info how to make AuthenticationManager in new Spring Security versions

Justsomeguy
Автор

I would appreciate having a tutorial for role based authentication. Also can you make a discord server? Feels like having a community would help us to learn from experienced devs about spring and programming in general.

zhenobiikuzo
Автор

we've been waiting for this! amazing!

maxjustmax
Автор

This video was an absolute GOLD, Dan! Thank you

adrian
Автор

Thanks a lot for the video, it really makes sense relying on recommended approaches instead of custom http filters and jwt libraries. One point I wonder is refresh token and token expiration management when issuing authenticated request which is a common pattern. What is the recommended way to configure it in oauth2 resource server setting? Any official reference or example appreciated. Another follow-up video covering these topics would also be great :)

mrg
Автор

Thank you very much for this wonderful tutorial!

kevinm.
Автор

Great video! Really helpful! Keep up the good work amd give us more videos ;)
It would be good to build on top of this/change the asymmetric encryption with symmetric key and encryption!
Also as another idea - would be good to remove the InMemoryUser and hook this up to an actual database (as you did in the previous videos)

AleksandarT
Автор

You are the best tutor on the new Spring Security configurations, keep up the good work! I had one isssue though getting the RSAKey to generate, i said i need to configure RSAKey as type bean or something, even though i copied your code from github

Hugos