home / skills / partme-ai / full-stack-skills / spring-security
This skill helps you implement Spring Security for authentication, authorization, OAuth2, and JWT with best practices across Spring applications.
npx playbooks add skill partme-ai/full-stack-skills --skill spring-securityReview the files below or copy the command above to add this skill to your agents.
---
name: spring-security
description: Provides comprehensive guidance for Spring Security including authentication, authorization, OAuth2, JWT, and security best practices. Use when the user asks about Spring Security, needs to implement security in Spring applications, configure authentication, or work with security features.
license: Complete terms in LICENSE.txt
---
## When to use this skill
Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]
## How to use this skill
[待完善:根据具体工具添加使用指南]
## Best Practices
[待完善:根据具体工具添加最佳实践]
## Keywords
[待完善:根据具体工具添加关键词]
This skill provides comprehensive, practical guidance for securing Spring applications using Spring Security. It covers authentication, authorization, OAuth2, JWT, method and URL security, and common best practices. Use it to design, configure, and troubleshoot security for Spring Boot and Spring MVC projects.
The skill inspects your security requirements and maps them to Spring Security components, recommending configuration snippets, filter chains, and bean definitions. It explains how to implement authentication providers, configure OAuth2 and JWT flows, and apply method-level and URL-based access controls. It also helps debug common issues like CSRF, CORS, and token validation failures.
Should I use sessions or JWTs for API security?
Use stateless JWTs for public APIs and microservices for scalability; prefer session-based auth for traditional web apps where server-side session features are needed.
How do I validate JWTs efficiently?
Validate signature and claims locally using the provider's public key or JWKS; cache keys and avoid repeated network calls for performance.