JWT Authentication Flow

Component Inspector

Click on any component in the architecture to understand how stateless JWT authentication works.

Simulation Legend

Credentials (User/Pass)
JWT Bearer Token
Invalid / Expired Access
Req
Frontend / Client
Phase 1: Authentication
AuthController
POST /api/auth/login
AuthenticationManager
Verifies Hash in DB
JwtService
Secret Key HS256
Phase 2: Authorization
JwtAuthenticationFilter
Extracts 'Bearer <token>'
SecurityContextHolder
Sets User State Temporarily
Protected Controller
GET /api/users/profile