index.adoc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. [[migration]]
  2. = Migrating to 7.0
  3. :spring-security-reference-base-url: https://docs.spring.io/spring-security/reference
  4. Spring Security 6.5 is the last release in the 6.x generation of Spring Security.
  5. It provides strategies for configuring breaking changes to use the 7.0 way before updating.
  6. We recommend you use 6.5 and {spring-security-reference-base-url}/6.5/migration-7/index.html[its preparation steps] to simplify updating to 7.0.
  7. After updating to 6.5, follow this guide to perform any remaining migration or cleanup steps.
  8. And recall that if you run into trouble, the preparation guide includes opt-out steps to revert to 5.x behaviors.
  9. == Update to Spring Security 7
  10. The first step is to ensure you are the latest patch release of Spring Boot 4.0.
  11. Next, you should ensure you are on the latest patch release of Spring Security 7.
  12. For directions, on how to update to Spring Security 7 visit the xref:getting-spring-security.adoc[] section of the reference guide.
  13. === Migrate from Jackson 2 to Jackson 3
  14. The configuration of Jackson 2 `ObjectMapper` with `SecurityJackson2Modules` should be replaced by the configuration of
  15. Jackson 3 `JsonMapper.Builder` with `SecurityJacksonModules`. See the
  16. https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md[Jackson 3 Migration Guide] for more details.
  17. It is recommended to replace the configuration of
  18. individual modules like `CoreJacksonModule` by the module detection from `SecurityJacksonModules` as it enables
  19. automatic inclusion of type information and configure a `PolymorphicTypeValidator` that handles the validation of class
  20. names.
  21. The Jackson 3 support uses a format compatible with the now deprecated Jackson 2 one, so class instances serialized with
  22. Jackson 2 should be deserializable with the Jackson 3 support.
  23. `spring-security-oauth2-authorization-server` now uses Jackson 3 by default. If you want to continue
  24. to use the deprecated Jackson 2 support, the transitive dependency on Jackson 3 (`tools.jackson.core:jackson-databind`)
  25. should be excluded and a dependency on Jackson 2 (`com.fasterxml.jackson.core:jackson-databind`) should be added.
  26. == Perform Application-Specific Steps
  27. Next, there are steps you need to perform based on whether it is a xref:migration/servlet/index.adoc[Servlet] or xref:migration/reactive.adoc[Reactive] application.