SecurityFilterChain: Securing URLs
Learn SecurityFilterChain: Securing URLs (Spring Security, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
What a SecurityFilterChain Is Spring Security is a list of servlet filters that run before your controller. A SecurityFilterChain bean is how you configure that list: which URLs are public, which need a login, which need a role, how a user logs in, and what to do about sessions and CSRF. Since Spring Security 6 (Spring Boot 3) you declare it as a @Bean . The old WebSecurityConfigurerAdapter no longer exists.
More lessons in Spring Security
- Spring Boot Security Basics
- How Spring Security Authenticates
- Users and Passwords (BCrypt)
- Roles, Authorities and RBAC
- Method-Level Security
- CSRF and CORS
- Spring Security - Hands-On Setup
- JWT Authentication
- OAuth 2.0, OpenID Connect and Social Login
- Security Errors and API Hardening
- Mini Project: Role-based API Security (Basic Auth)