Skip to content

giuseppe-trisciuoglio/developer-kit / plugins/developer-kit-java/skills/spring-boot-security-jwt

spring-boot-security-jwt

Verified

Provides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.

references/structure.md

View on GitHub
# Spring Security JWT Skill Structure

```
spring-boot-security-jwt/
├── SKILL.md                           # Main skill documentation
├── README.md                          # User-friendly overview and quick start
├── structure.md                       # This file - skill structure documentation
│
├── references/                        # Comprehensive reference documentation
│   ├── jwt-configuration.md          # Complete JWT setup and configuration
│   ├── examples.md                   # Real-world implementation examples
│   ├── authorization-patterns.md     # RBAC, ABAC, and permission models
│   ├── token-management.md           # Refresh tokens, rotation, and revocation
│   ├── microservices-security.md     # Inter-service authentication
│   ├── oauth2-integration.md         # OAuth2 provider integration
│   ├── testing-jwt-security.md       # Unit and integration testing
│   ├── performance-optimization.md   # Caching and performance tuning
│   ├── security-hardening.md         # Security best practices
│   └── troubleshooting.md            # Common issues and solutions
│
├── scripts/                          # Utility scripts
│   └── test-jwt-setup.sh            # Automated testing script
│
└── assets/                           # Supporting assets and tools
    └── generate-jwt-keys.sh         # Key generation utility
```

## Skill Coverage

### Core Features (SKILL.md)
- JWT generation and validation with multiple algorithms (RSA, HMAC, ECDSA)
- Bearer token and cookie-based authentication patterns
- Database-backed and OAuth2 provider integration
- Both RBAC and permission-based access control
- Advanced patterns: refresh tokens, token rotation, multi-tenancy

### Configuration (jwt-configuration.md)
- Comprehensive dependency management
- Key configuration for RSA, HMAC, and ECDSA
- Custom claims and validation
- Application properties and YAML configurations
- Key rotation support

### Implementation Examples (examples.md)
- Complete application setup
- Domain models (User, Role, Permission entities)
- Authentication and registration controllers
- Service layer implementations
- Advanced security configuration

### Authorization Patterns (authorization-patterns.md)
- Hierarchical role structures
- Custom permission evaluators
- Attribute-Based Access Control (ABAC)
- Time-based access control
- Location-based restrictions
- Organizational access control

### Token Management (token-management.md)
- Secure refresh token storage
- Token rotation strategies
- Token blacklisting
- Session management
- Distributed security events

### Microservices Security (microservices-security.md)
- Inter-service authentication
- API gateway patterns
- Distributed token validation
- Service mesh integration (Istio)
- Circuit breaker patterns

### OAuth2 Integration (oauth2-integration.md)
- Multi-provider support
- Custom OAuth2 user service
- Token exchange patterns
- Delegated authorization
- Client registration API

### Testing (testing-jwt-security.md)
- Unit testing JWT services
- Integration tests with Testcontainers
- Security testing with OWASP ZAP
- Performance testing
- Custom security test utilities

### Performance Optimization (performance-optimization.md)
- Caching strategies for token validation
- Database optimization
- Async processing
- Monitoring and metrics
- Resource optimization

### Security Hardening (security-hardening.md)
- Secure configuration practices
- Attack prevention (brute force, XSS, SQL injection)
- Key management best practices
- Security monitoring
- GDPR compliance features

### Troubleshooting (troubleshooting.md)
- Common JWT token problems
- Authentication flow debugging
- Configuration validation
- Quick fix scripts
- Debugging checklist

## Integration Points

This skill integrates with:

1. **Spring Boot Actuator** - For security monitoring and health checks
2. **Spring Data JPA** - For user and token persistence
3. **Spring Cache** - For token validation caching
4. **JUnit Testing** - For comprehensive security testing
5. **LangChain4j** - For AI-powered security analysis (if needed)

## Quick Start Flow

1. Review README.md for overview
2. Generate keys using `./assets/generate-jwt-keys.sh`
3. Implement basic JWT using SKILL.md quick start
4. Reference jwt-configuration.md for detailed setup
5. Use examples.md for implementation patterns
6. Apply security-hardening.md for production
7. Run tests with `./scripts/test-jwt-setup.sh`
8. Monitor with troubleshooting.md as needed

## Key Benefits

1. **Comprehensive Coverage**: From basic JWT to advanced microservices patterns
2. **Production Ready**: Includes security hardening and performance optimization
3. **Well Documented**: Each aspect has detailed reference documentation
4. **Practical Examples**: Real-world code implementations
5. **Testing Included**: Automated test suite and testing strategies
6. **Troubleshooting Guide**: Common issues and solutions

## Maintenance

This skill should be updated when:
- New Spring Security features are released
- New security vulnerabilities are discovered
- Performance optimizations are identified
- Community feedback suggests improvements
- Integration patterns evolve
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall