When to use this skill
Use this skill whenever the user wants to:
- Configure authentication, authorization, sessions, and security headers with Spring Security
- Integrate OAuth2, JWT, method security, and CSRF
How to use this skill
- Configuration: SecurityFilterChain, UserDetailsService, PasswordEncoder; login/logout and exception handling.
- Advanced: JWT, OAuth2 client/resource server; @PreAuthorize, CORS.
- Reference:https://docs.spring.io/spring-security/reference/
Best Practices
- Password encryption, session and cookie security; least privilege and role design.
- Use HTTPS and security headers in production; protect sensitive paths.
Keywords
spring security, authentication, authorization, JWT, OAuth2