Arkhe-claude-plugins spring-boot-security
Spring Security 7 implementation for Spring Boot 4. Use when configuring authentication, authorization, OAuth2/JWT resource servers, method security, or CORS/CSRF. Covers the mandatory Lambda DSL migration, SecurityFilterChain patterns, @PreAuthorize, and password encoding. For testing secured endpoints, see spring-boot-testing skill.
install
source · Clone the upstream repo
git clone https://github.com/joaquimscosta/arkhe-claude-plugins
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/joaquimscosta/arkhe-claude-plugins "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/spring-boot/skills/spring-boot-security" ~/.claude/skills/joaquimscosta-arkhe-claude-plugins-spring-boot-security && rm -rf "$T"
manifest:
plugins/spring-boot/skills/spring-boot-security/SKILL.mdsource content
Spring Security 7 for Spring Boot 4
Implements authentication and authorization with Spring Security 7's mandatory Lambda DSL.
Critical Breaking Changes
| Removed API | Replacement | Status |
|---|---|---|
method | Lambda DSL closures | Required |
| | Required |
| | Required |
| bean | Required |
| | Required |
Core Workflow
- Create SecurityFilterChain → 2. Define authorization → 3. Configure authentication → 4. Add method security → 5. Handle CORS/CSRF
See WORKFLOW.md for detailed step-by-step instructions with code examples.
Quick Patterns
See EXAMPLES.md for complete working examples including:
- REST API Security with JWT/OAuth2 (Java + Kotlin)
- Form Login with Session Security and CSRF
- Method Security with @PreAuthorize and SpEL
- CORS Configuration for cross-origin APIs
- Password Encoder (Argon2 for Security 7)
Spring Boot 4 Specifics
- Lambda DSL is mandatory (no
chaining)and() - Argon2 password encoder:
Argon2PasswordEncoder.defaultsForSpring7() - CSRF for SPAs:
CookieCsrfTokenRepository.withHttpOnlyFalse() - @EnableMethodSecurity replaces
@EnableGlobalMethodSecurity
Detailed References
- Workflow: See WORKFLOW.md for detailed step-by-step security configuration
- Examples: See EXAMPLES.md for complete working code examples
- Troubleshooting: See TROUBLESHOOTING.md for common issues and Boot 4 migration
- Security Configuration: See references/SECURITY-CONFIG.md for complete SecurityFilterChain patterns
- Authentication: See references/AUTHENTICATION.md for UserDetailsService, password encoding
- JWT/OAuth2: See references/JWT-OAUTH2.md for resource server, token validation
Related Skills
| Need | Skill |
|---|---|
| Testing secured endpoints | |
| Actuator endpoint security | |
| Dependency verification | |
Anti-Pattern Checklist
| Anti-Pattern | Fix |
|---|---|
Using chaining | Use Lambda DSL closures |
| Replace with |
| Replace with |
| CSRF disabled without JWT | Keep CSRF for session-based auth |
| Hardcoded credentials | Use environment variables or Secret Manager |
on sensitive endpoints | Audit all permit rules |
Missing default | End with |
Critical Reminders
- Lambda DSL is mandatory — No more
chaining in Security 7and() - Order matters — More specific
before general onesrequestMatchers - CSRF for sessions — Only disable for stateless JWT APIs
- Method security needs enabling — Add
@EnableMethodSecurity - Test security configuration — Use
and JWT test support (see@WithMockUser
)spring-boot-testing