Spring Boot's auto configuration should use HttpSecurity.oauth2AuthorizationServer instead of HttpSecurity.with.
- Spring Boot's auto configuration currently overrides authorization server configuration applied by users providing
Customizer<HttpSecurity> Beans. Switching to oauth2AuthorzationServer (which caches previous invocations made by the Customizer<HttpSecurity>) will fix this problem.
- The built in DSL is the modern and documented way to configure Authorization Server in Spring Security 7.