Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Springboot 3 with JWT Authentication & Authorization in 2025
Rating: 4.2 out of 5(151 ratings)
19,324 students

Springboot 3 with JWT Authentication & Authorization in 2025

UPDATED-2025 - Learn to secure your SpringBoot based RESTful API's using Role Based JWT Authentication & Authorization
Created byRanjan Pandey
Last updated 1/2025
English

What you'll learn

  • You will learn basics of security like Authentication and Authorization
  • You will learn everything about JWT(JSON Web Token)
  • You will learn to Implement JWT with SpringBoot and Spring Security
  • You will learn to Develop CRUD API and secure it with JWT
  • You will learn to Implement Role Based Authentication & Authorization with JWT & Spring Security
  • You will learn to setup a SpringBoot project from scratch
  • You will learn to create API's which will talk to Database using Spring Data JPA
  • You will learn to protect your API's based on user role
  • You will get the complete source code

Course content

3 sections47 lectures3h 4m total length
  • What is JWT and How does it work to serve Token based Authentication and Author5:41
  • How does JWT token look like and its different parts3:30
  • Understanding the JWT Workflow3:25
  • Software Download and Installation1:45
  • Generating the starter springboot 3.3.5 project2:13
  • Intellij Project Settings2:40
  • Adding JWT dependencies2:40
  • Adding Different User Roles1:34
  • Creating Role Entity1:43
  • Creating User Entity3:00
  • Adding profile based application properties files1:45
  • Adding H2 file based Database configuration2:55
  • Creating Role Repository with required custom queries4:12
  • Creating User Repository with required custom queries1:20
  • Adding logic for UserDetailsImpl class for mapping the User Entity and Role6:36
  • Adding logic for UserServiceImpl to load user and save user2:53
  • Service for generating validating token and extracting claims6:21
  • Implementing JWT Authentication Filter6:51
  • Implementing and understanding Security Config bean4:06
  • Exception handling for all security errors1:55
  • Understanding Security Filter Chaining configuration2:34
  • Handling Cors Configuration in the application1:24
  • Creating Signup Request DTO3:34
  • Creating LoginRequest and Response DTO and Message DTO2:43
  • Implementing Signup and Registration functionality in Auth Controller7:42
  • Understanding Auth Controller2:48
  • Startup command to insert roles into database2:28
  • Solving circular dependency2:42
  • Testing the application4:22
  • Updating Security Config rules and testing again4:44
  • Implement Test Controller to test Authentication and Authorization1:59
  • Testing different roles with API endpoints security3:24
  • Get LoggedIn user information4:25
  • Defining ErrorDTO and BusinessException in Backend API3:00
  • Implementing Global Exception Handler2:04
  • Mapping the Login Response to right fields2:01
  • Source code

Requirements

  • Basic knowledge of Java
  • Basic knowledge SpringBoot

Description

This course has been updated in 2025 as per new Spring Security Features and JWT Specification to implement Role Based Authentication & Authorization of any SpringBoot based Application.

  • Develop CRUD API and secure it with JWT

JWT(Json web token) is a standard for securing API's in a Microservices architecture, using this standard we can secure API's built in any technology like Nodejs, Python, .NET etc but in this course we will building API's using Java and SpringBoot and than we will be securing them using JWT and Spring security, we will also use all the industry best practices and standards along the way.

We will start with learning concepts like:

  • What is Authentication

  • What is Authorization

  • Importance of securing RESTful API's

  • What is JWT(Json Web Token)

  • Various components and terminology associated with JWT

  • Workflow and a diagramatic use case of using JWT

Than we will move on to the actual handson and implementation of JWT in our Springboot project by following below steps:

  • Create springboot project from scratch

  • Adding required maven dependencies

  • Setup project in Github and follow continous integration process

  • Setting up database and establishing connection

  • Create our Hibernate entity classes

  • Create our controller class

  • Create the first API

  • Start configuring JWT and Spring security

  • Create security related classes like configuartion, filters, service

  • Making the secret and expiration time configurable

  • Configuring the allowed and not allowed endpoints

  • Creating user registration and login endpoints

  • Creating Role based classes

  • Create multiple roles

  • Restrict users to functionalities based on Roles

  • Setting up github to push code with token

  • Creating a JWT token

  • Using the JWT token to call a secured API

  • Using Postman to test our API's

  • Mechanism to check if a particular JWT token is valid or not

  • Extracting user information and role information from JWT token

  • Develop CRUD API and secure it with JWT

  • Complete source code

Who this course is for:

  • Anyone who wants to learn about securing API's at an industry grade standard