116,858 views
In this video we will learn how to implement authentication in our Java Spring applications using the Spring Security library. We will implement Stateless authentication using JWT tokens, with authorization through the ROLES control of our users. ???? Repository with complete project https://github.com/Fernanda-Kipper/au... ???? Clean Architecture Book https://amzn.to/3CQULLK ????Follow me on Instagram! / kipper.dev 00:00:00 Intro 00:00:55 Understanding the project 00:02:35 Adding Spring Security 00:05:30 Understanding Spring Security's default config 00:06:46 Understanding Spring Security in our project 00:07:14 Creating a table in the DB for authenticated users 00:10:35 Creating a user entity in the project 00:12:11 Implementing Spring Security class 00:14:37 Creating a class for user roles 00:18:26 SUBSCRIBE TO THE CHANNEL 00:18:44 Creating a repository to query users 00:20:55 Creating the authentication service 00:23:33 Disabling the default Spring Security config 00:25:10 Implementing the securityfilterchain 00:30:35 Setting up our authentication and authorization (authorizeHttpRequests) 00:32:27 Validating user authentication (AuthenticationController) 00:41:30 Allowing the user to create an account 00:46:15 Changing security settings 00:50:34 Installing library to use JWT 00:52:36 Creating service to generate JWT Token 01:01:44 Creating service to validate JWT Token 01:03:45 Changing security settings 01:11:33 Returning the token to the user 01:13:18 Validating authentication and authorization