Closed knstvk closed 10 months ago
It seems that the problem is that inside the org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2ClientAuthenticationConfigurer#createDefaultAuthenticationProviders
the PasswordEncoder instance is obtained with a helper method:
PasswordEncoder passwordEncoder = OAuth2ConfigurerUtils.getOptionalBean(httpSecurity, PasswordEncoder.class);
This helper method doesn't consider the @Primary
annotation.
The solution may be to move the PasswordEncoder
bean declaration from a regular spring configuration to security auto-configuration with a @ConditionalOnMissingBean
annotation. Then we'll be sure that only one instance of PasswordEncoder
is registered at a time.
Jmix 2.0.2 Steps to reproduce:
@SpringBootApplication
class:The application fails to start: