Spring Security Access Token and Refresh Token Tutorial With Jwt & Redis [2025]
Hey devs! It’s the weekend time to lock down your hard work. In this video, we dive into Spring Security and explore how to implement robust authorization and authentication using JWTs and Redis. You’ll learn how to configure Spring Security 6 the right way, implement access and refresh tokens with JWTs, set up Redis to handle token validation and blacklisting, and override Spring Security’s default filters using custom JwtAuthFilter and TokenBlacklistFilter. Everything will be tested using Postman to ensure it all works smoothly. To follow along with this tutorial, make sure you have a good IDE (like IntelliJ or VSCode), Postman, Docker, Redis, and Git installed. You can either create a simple Spring Boot application with a basic entity endpoint or get started right away by cloning the starter branch of the GitHub repo using the command below: git clone -b start --single-branch https://github.com/iocods/SpringSecurityJwtDemo2025.git Here are some key resources to help you throughout the video: GitHub Repository: https://github.com/iocods/SpringSecurityJwtDemo2025 JWT Debugger Tool: https://jwt.io/ JWT Maven Dependency: https://mvnrepository.com/artifact/io.jsonwebtoken ⏱️ Timestamps to help you navigate the video: 00:00:00 - Introduction of the Project 00:01:12 - Prerequisites & Setup 00:02:33 - Project Overview 00:08:30 - Spring Security Workflow Explained 00:11:08 - Defining User Entity 00:16:45 - Setting up Beans for Authentication 00:24:00 - Quick Dive into JWTs 00:28:50 - Creating JwtService Class 00:49:50 - Implementing UserService & UserController 01:11:20 - Creating JwtAuthFilter & Integrating with SecurityFilterChain 01:23:30 - Testing Registration & Authentication with Postman 01:30:50 - Implementing Logout with Redis & TokenBlacklistFilter 01:49:40 - Testing Logout with Redis 01:52:55 - Verifying Tokens using jwt.io 01:57:00 - Implementing Refresh Token Logic 02:06:40 - Testing Refresh Token Functionality 02:11:00 - Outro Also, if you’d like to check out a full Spring Boot project that covers the development of a full-stack banking application, watch it here: Want to Checkout More security-related content https://www.youtube.com/playlist?list=PLkTTYfQ8blCw28lxLmM3PXyqqIEVSgr89 And subscribe to stay tuned for more And hey if you’re feeling generous, you can support the channel with a cup of coffee using this link: https://buymeacoffee.com/isiah100 🙌☕ Finally to get an insight on what is coming next on the channel checkout the release train video for the month using the link below
Download
0 formatsNo download links available.