Spring Security
Authentication, authorization, the filter chain, OAuth 2.0, JWT and common mistakes.
Security articles describe Spring Security 7 (shipped with Spring Boot 4) and link to the official reference documentation for configuration details.
Articles
- Security filter chainHow Spring Security works inside: DelegatingFilterProxy and FilterChainProxy, multiple SecurityFilterChain beans and matchers, the important filters in order, AuthenticationManager and providers, SecurityContext and its storage, ExceptionTranslationFilter, authorization with AuthorizationManager, CSRF and CORS, password storage, and what changed in Spring Security 7 (lambda DSL only, MFA).
- OAuth2, OIDC & JWTModern identity for Spring applications: authentication vs authorization, OAuth 2.0 roles and grant types (authorization code with PKCE, client credentials), OAuth 2.1 changes, OpenID Connect and ID tokens, JWT structure and validation, Spring Boot resource servers and OAuth2 clients, mapping scopes and roles, the BFF pattern for SPAs, token storage, and Spring Authorization Server.
- Method-level securitySecuring service methods in Spring: @EnableMethodSecurity, @PreAuthorize, @PostAuthorize, @PreFilter and @PostFilter, @Secured and JSR-250, SpEL expressions and bean-based authorization checks, object-level (owner) checks against BOLA, meta-annotations and templates, custom AuthorizationManagers, @AuthorizeReturnObject, testing with @WithMockUser, and how it all works through AOP.
Planned topics
These topics are on the roadmap and not written yet. They appear here so you can see the full scope of the section.
- Password storage
- Session-based authentication
- Common Spring Security mistakes