spring-security-6

Migrate Spring Security 5 configurations to SecurityFilterChain-based Spring Security 6.

4|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill spring-security-6
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-security-6
Source: https://github.com/GeneralReasoning/env-skillsbench/tree/main/spring-boot-jakarta-migration/environment/skills/spring-security-6
Command: npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill spring-security-6

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrate Spring Security 5 configurations to Spring Security 6 by removing WebSecurityConfigurerAdapter and adopting SecurityFilterChain-based configurations.

Core Features & Use Cases

  • Migrates WebSecurityConfigurerAdapter-based configs to SecurityFilterChain beans.
  • Replaces @EnableGlobalMethodSecurity with @EnableMethodSecurity and updates related imports.
  • Updates URL matching from antMatchers to requestMatchers and demonstrates lambda DSL usage.

Quick Start

Run a migration pass on your Spring Boot project to transform WebSecurityConfigurerAdapter-based configs into SecurityFilterChain beans.

Frequently Asked Questions about spring-security-6

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate WebSecurityConfigurerAdapter to SecurityFilterChain in Spring Security 6?

To migrate WebSecurityConfigurerAdapter to SecurityFilterChain beans in Spring Security 6, remove the adapter class and define your security configuration using SecurityFilterChain beans, enforcing the new lambda DSL style and correct bean wiring.

Why do I need to replace antMatchers with requestMatchers for Spring Boot 3?

You need to replace antMatchers with requestMatchers in Spring Boot 3 because Spring Security 6 deprecates antMatchers in favor of requestMatchers for URL matching. This update ensures compatibility with the new SecurityFilterChain-based configuration approach.

How does method security change when upgrading to Spring Security 6?

Method security changes when upgrading to Spring Security 6 by replacing the @EnableGlobalMethodSecurity annotation with @EnableMethodSecurity. This migration updates related imports and aligns method security with the modern configuration standards.

Can I use lambda DSL style configurations in Spring Security 6?

Yes, you can and should use lambda DSL style configurations in Spring Security 6. The migration process enforces the lambda DSL style for SecurityFilterChain setup, ensuring cleaner and more type-safe security rules.

Does Spring Security 6 migration support AuthenticationManager bean wiring?

Spring Security 6 migration supports AuthenticationManager bean wiring by ensuring correct imports and bean definitions during the transformation. It updates your authentication manager setup across common migration scenarios for Spring Boot 3 projects.

What are the limitations of migrating Spring Security 5 configurations to version 6?

The migration targets Spring Boot 3 projects and covers common scenarios like URL matching, method security, and authentication setup. It focuses specifically on transitioning to SecurityFilterChain beans and may not address highly custom or legacy adapter extensions.