Migrate Spring Security OAuth clients to Spring Security

Proprietary

Migrates the client half of the end-of-life org.springframework.security.oauth:spring-security-oauth2 project to the spring-security-oauth2-client module. Flat security.oauth2.client.* properties and the settings that built an OAuth2RestTemplate in Java both become a single default client registration; rename it to something meaningful when a project has more than one client. Beans whose settings cannot all be read at compile time are left untouched and marked, since a template stripped of its credentials would compile but fail at runtime. Requires Spring Security 6.4 or later for OAuth2ClientHttpRequestInterceptor.

io.moderne.java.spring.security.oauth.MigrateSpringSecurityOAuthClient
mod run . --recipe=io.moderne.java.spring.security.oauth.MigrateSpringSecurityOAuthClient

Install 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.

  1. Add Gradle or Maven dependency org.springframework.security:spring-security-oauth2-client:6.5.x
  2. Change the key of a Spring application property
  3. Change the key of a Spring application property
  4. Change the key of a Spring application property
  5. Change the key of a Spring application property
  6. Change the key of a Spring application property
  7. Change the key of a Spring application property
  8. Comment out Spring properties
  9. Migrate OAuth2RestTemplate beans to RestTemplate with an OAuth2 interceptor