Concept
Spring Security sits in front of your controllers as a chain of servlet filters that authenticate the request and decide whether it may proceed. You configure the chain as a bean: which paths are open, which need a login.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show The security filter chain doing its job.
@Bean
SecurityFilterChain api(HttpSecurity http) throws Exception {
return http
.csrf(csrf -> csrf.disable()) // stateless API, token auth
.sessionManagement(s -> s.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.authorizeHttpRequests(auth -> auth
.requestMatchers("/api/public/**", "/actuator/health").permitAll()
.anyRequest().authenticated())
.oauth2ResourceServer(o -> o.jwt(Customizer.withDefaults()))
.build();
}Ordering matchers with the broad rule first. requestMatchers("/**").authenticated() before permitAll() for public paths means the public paths are never reached; specific rules go first.
Your roadmap puts these before The security filter chain, unless you already know them.
Once a session shows you understand The security filter chain, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on The security filter chain.