/spring-boot-java:spring-securityfrom spring-boot-java
Configure, test and review Spring Security 6/7 in Spring Boot 3/4 apps: SecurityFilterChain lambda DSL, method security, OAuth2 resource server with JWT, OIDC login, CSRF/CORS, password encoding, headers, actuator protection, and MockMvc security tests. Use when adding or auditing authentication and authorization.
Ships in spring-boot-java. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Practical guidance for Spring Security 6.x (Spring Boot 3.x) and 7.x (Spring Boot 4.x). Details per topic are in references/.
.env, application-*.properties with credentials, client secrets, private keys, JWT signing keys. Reference them via environment variables or a secret manager.permitAll() on everything, csrf.disable() for browser apps) just to make a test or demo pass.pom.xml parent/BOM, build.gradle(.kts), libs.versions.toml) and run ./mvnw dependency:tree -Dincludes=org.springframework.security or ./gradlew dependencies --configuration runtimeClasspath to see the Spring Security version.and() chaining, authorizeRequests, AntPathRequestMatcher/MvcRequestMatcher style matchers; use the lambda DSL and requestMatchers(...)). Check the "What's New" and migration pages on docs.spring.io/spring-security when upgrading.SecurityFilterChain) or WebFlux (SecurityWebFilterChain, @EnableWebFluxSecurity); browser app with sessions, or stateless API.Declare a SecurityFilterChain bean. WebSecurityConfigurerAdapter no longer exists.
@Configuration
@EnableWebSecurity
@EnableMethodSecurity
class SecurityConfig {
@Bean
SecurityFilterChain api(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests(auth -> auth
.requestMatchers("/actuator/health/**", "/public/**").permitAll()
.requestMatchers("/admin/**").hasRole("ADMIN")
.anyRequest().authenticated())
.oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults()))
.sessionManagement(s -> s.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.csrf(csrf -> csrf.disable()); // only for stateless token APIs without cookies
return http.build();
}
}
Rules of thumb:
anyRequest().authenticated() (deny by default).SecurityFilterChain beans with securityMatcher(...) and @Order when the app mixes an API and a browser UI.@EnableMethodSecurity and use @PreAuthorize/@PostAuthorize on services for fine-grained rules; see method security.spring-observability skill if installed).| Situation | Approach |
|---|---|
| REST API called by SPA/mobile/services with bearer tokens | Resource server + JWT, stateless, CSRF off (no cookie auth) |
| Server-rendered app or SPA with same-site cookie session | Form login or OIDC login, sessions, CSRF on |
| SPA using BFF pattern | OIDC login in the backend, session cookie to browser, CSRF token via cookie repository |
| Internal service-to-service | Client credentials grant, resource server on the receiving side |
spring-boot-starter-security, plus spring-boot-starter-oauth2-resource-server or spring-boot-starter-oauth2-client on Boot 3.x. Boot 4.x names: spring-boot-starter-security-oauth2-resource-server / spring-boot-starter-security-oauth2-client (the old names remain as deprecated aliases).spring-security-test (test scope) on Boot 3.x; on Boot 4.x use spring-boot-starter-security-test (plus spring-boot-starter-security-oauth2-resource-server-test / -client-test when those starters are used) together with modular test starters such as spring-boot-starter-webmvc-test.Run the app's tests plus security-specific tests (401 without credentials, 403 with insufficient role, 200 with the right one, CSRF rejection on state-changing browser requests). Confirm no endpoint was accidentally left open by listing the mappings and checking each against the filter chain.
See also (prefer over this skill for the version in use): Spring Security reference https://docs.spring.io/spring-security/reference/index.html and migration chapter https://docs.spring.io/spring-security/reference/migration/index.html.
LICENSE (opens in a new tab)SOURCE.md (opens in a new tab)references/actuator-protection.md (opens in a new tab)references/csrf-cors-sessions-headers.md (opens in a new tab)references/method-security.md (opens in a new tab)references/oauth2-resource-server-jwt.md (opens in a new tab)references/oidc-login-oauth2-client.md (opens in a new tab)references/password-encoding.md (opens in a new tab)references/review-checklist.md (opens in a new tab)references/testing-security.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fcakiroglu16/marketplace --plugin spring-boot-java10 skills in this plugin
/create-spring-boot-java-projectCreate a new Spring Boot Java project (Maven or Gradle) from start.spring.io with sensible defaults for configuration, PostgreSQL, logging, security, testing and Docker. Use when asked to scaffold, bootstrap or generate a Spring Boot application. Detects existing project versions and never upgrades implicitly./java-hibernate-jpaDiagnose and fix Hibernate ORM / Jakarta Persistence problems in plain Java: N+1 queries, lazy loading errors, identifier generation, entity equals/hashCode, cascades, pagination, batching, locking, caching, Lombok on entities, and Hibernate 6/7 differences. Use when reviewing or writing JPA entities, mappings, and queries. Framework-neutral./Other plugins' skills for the same job