Migrate to Spring Security 6.0
MSALMigrate applications to the latest Spring Security 6.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.
org. openrewrite. java. spring. security6. UpgradeSpringSecurity_6_0mod run . --recipe= org. openrewrite. java. spring. security6. UpgradeSpringSecurity_6_0Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Migrate to Spring Security 5.8
- Upgrade Gradle or Maven dependency versions
org.springframework.security:*:6.0.x - Upgrade Gradle or Maven dependency versions
org.springframework.security:spring-security-oauth2-authorization-server:1.0.x - Remove explicit configuration of SHA-256 as encoding and matching algorithm for
TokenBasedRememberMeServices - Remove calls matching
AuthenticationEntryPointFailureHandler.setRethrowAuthenticationServiceException(true) - Remove explicit
SecurityContextConfigurer.requireExplicitSave(true)opt-in - Keep the Spring Security 5
RequestCachequerying behavior - Remove unnecessary
use-authorization-managerfor message security in Spring Security 6 - Remove the
useAuthorizationManager=trueattribute from@EnableReactiveMethodSecurity - Remove unnecessary
filterSecurityInterceptorOncePerRequest(false)when upgrading to Spring Security 6