🔥 Round 1: The Old Way (Manual Authentication Logic - Pre-Spring Security 5)
UsernamePasswordAuthenticationFilter (Goku in base form 🟡)UsernamePasswordAuthenticationFilter was session-based.HttpServletRequest.getParameter("username") to get credentials.SecurityContextHolder to track authentication state.🔻 Weaknesses:
🔥 Round 2: The New Way (Spring Security 5+ AuthenticationFilter - Super Saiyan Form!)
AuthenticationFilter (Super Saiyan Goku 🟠)HttpServletRequest, but now via customizable AuthenticationConverter!⚡ Key Features:
✅ AuthenticationConverter → Extracts authentication details from requests flexibly.
✅ AuthenticationManager → Decouples authentication logic for better separation of concerns.
✅ Easier Customization → Can swap out token extraction logic without touching Spring internals.
🔺 Super Power (Advantages Over the Old Way):