springBootVersion =3.3.0

This commit is contained in:
MaxKey 2024-06-03 15:07:38 +08:00
parent e8057b4661
commit aed97e114f
11 changed files with 52 additions and 32 deletions

View File

@ -27,21 +27,21 @@ jibToAuthPassword =docker registry credential
#maxkey used jars version #maxkey used jars version
#spring #spring
springVersion =6.0.19 springVersion =6.1.8
springBootVersion =3.1.11 springBootVersion =3.3.0
springSecurityVersion =6.1.9 springSecurityVersion =6.3.0
springDataVersion =3.1.11 springDataVersion =3.3.0
springkafkaVersion =3.0.13 springkafkaVersion =3.2.0
springretryVersion =1.3.3 springretryVersion =1.3.3
#spring plugin #spring plugin
springplugincoreVersion =3.0.0 springplugincoreVersion =3.0.0
springpluginmetadataVersion =3.0.0 springpluginmetadataVersion =3.0.0
#spring cloud #spring cloud
springcloudVersion =4.0.4 springcloudVersion =4.1.2
#spring cloud alibaba #spring cloud alibaba
springcloudalibabaVersion =2022.0.0.0 springcloudalibabaVersion =2023.0.1.0
springcloudalibabaspringVersion =1.0.11 springcloudalibabaspringVersion =1.0.11
springcloudalibabacsplVersion =1.8.5 springcloudalibabacsplVersion =1.8.7
alibabanacosclientVersion =2.2.3 alibabanacosclientVersion =2.2.3
#Apache commons #Apache commons
commonsbeanutilsVersion =1.9.4 commonsbeanutilsVersion =1.9.4
@ -51,7 +51,7 @@ commonscollections4Version =4.4
commonscompressVersion =1.21 commonscompressVersion =1.21
commonscsvVersion =1.7 commonscsvVersion =1.7
commonstextVersion =1.9 commonstextVersion =1.9
commonsdbcp2Version =2.9.0 commonsdbcp2Version =2.12.0
commonsdbutilsVersion =1.7 commonsdbutilsVersion =1.7
commonsdigester3Version =3.2 commonsdigester3Version =3.2
commonsdigesterVersion =2.1 commonsdigesterVersion =2.1
@ -80,7 +80,7 @@ poiVersion =5.2.3
tomcatVersion =10.1.23 tomcatVersion =10.1.23
#logs #logs
log4jVersion =2.23.1 log4jVersion =2.23.1
slf4jVersion =2.0.11 slf4jVersion =2.0.13
jbossloggingVersion =3.5.3.Final jbossloggingVersion =3.5.3.Final
#Messaging Kafka & RocketMQ #Messaging Kafka & RocketMQ
kafkaclientsVersion =3.4.0 kafkaclientsVersion =3.4.0
@ -103,13 +103,13 @@ minidevjsonsmartVersion =2.4.5
mysqlconnectorjavaVersion =8.4.0 mysqlconnectorjavaVersion =8.4.0
dm8JdbcDriverVersion =8.1.2.192 dm8JdbcDriverVersion =8.1.2.192
postgresqlVersion =42.4.1 postgresqlVersion =42.4.1
druidVersion =1.2.22 druidVersion =1.2.23
druidspringbootstarterVersion =1.2.22 druidspringbootstarterVersion =1.2.23
jedisVersion =4.3.2 jedisVersion =4.3.2
caffeineVersion =3.1.8 caffeineVersion =3.1.8
hibernateVersion =7.0.5.Final hibernateVersion =7.0.5.Final
mybatisVersion =3.5.16 mybatisVersion =3.5.16
mybatisspringVersion =3.0.2 mybatisspringVersion =3.0.3
mybatisjpaextraVersion =3.2 mybatisjpaextraVersion =3.2
#saml #saml
opensamlVersion =2.6.6 opensamlVersion =2.6.6

View File

@ -47,9 +47,9 @@ public class AuthnProviderAutoConfiguration {
@Bean @Bean
public AbstractAuthenticationProvider authenticationProvider( public AbstractAuthenticationProvider authenticationProvider(
AbstractAuthenticationProvider normalAuthenticationProvider, NormalAuthenticationProvider normalAuthenticationProvider,
AbstractAuthenticationProvider mobileAuthenticationProvider, MobileAuthenticationProvider mobileAuthenticationProvider,
AbstractAuthenticationProvider trustedAuthenticationProvider TrustedAuthenticationProvider trustedAuthenticationProvider
) { ) {
AuthenticationProviderFactory authenticationProvider = new AuthenticationProviderFactory(); AuthenticationProviderFactory authenticationProvider = new AuthenticationProviderFactory();
authenticationProvider.addAuthenticationProvider(normalAuthenticationProvider); authenticationProvider.addAuthenticationProvider(normalAuthenticationProvider);
@ -60,7 +60,7 @@ public class AuthnProviderAutoConfiguration {
} }
@Bean @Bean
public AbstractAuthenticationProvider normalAuthenticationProvider( public NormalAuthenticationProvider normalAuthenticationProvider(
AbstractAuthenticationRealm authenticationRealm, AbstractAuthenticationRealm authenticationRealm,
ApplicationConfig applicationConfig, ApplicationConfig applicationConfig,
SessionManager sessionManager, SessionManager sessionManager,
@ -76,7 +76,7 @@ public class AuthnProviderAutoConfiguration {
} }
@Bean @Bean
public AbstractAuthenticationProvider mobileAuthenticationProvider( public MobileAuthenticationProvider mobileAuthenticationProvider(
AbstractAuthenticationRealm authenticationRealm, AbstractAuthenticationRealm authenticationRealm,
ApplicationConfig applicationConfig, ApplicationConfig applicationConfig,
SmsOtpAuthnService smsAuthnService, SmsOtpAuthnService smsAuthnService,
@ -92,7 +92,7 @@ public class AuthnProviderAutoConfiguration {
} }
@Bean @Bean
public AbstractAuthenticationProvider trustedAuthenticationProvider( public TrustedAuthenticationProvider trustedAuthenticationProvider(
AbstractAuthenticationRealm authenticationRealm, AbstractAuthenticationRealm authenticationRealm,
ApplicationConfig applicationConfig, ApplicationConfig applicationConfig,
SessionManager sessionManager SessionManager sessionManager

View File

@ -26,6 +26,7 @@ import org.dromara.maxkey.crypto.jose.keystore.JWKSetKeyStore;
import org.dromara.maxkey.crypto.jwt.signer.service.impl.DefaultJwtSigningAndValidationService; import org.dromara.maxkey.crypto.jwt.signer.service.impl.DefaultJwtSigningAndValidationService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -58,7 +59,7 @@ public class JwtAuthnAutoConfiguration {
*/ */
@Bean @Bean
public DefaultJwtSigningAndValidationService jwtLoginValidationService( public DefaultJwtSigningAndValidationService jwtLoginValidationService(
JWKSetKeyStore jwtLoginJwkSetKeyStore) @Qualifier("jwtLoginJwkSetKeyStore") JWKSetKeyStore jwtLoginJwkSetKeyStore)
throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException { throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
DefaultJwtSigningAndValidationService jwtSignerValidationService = DefaultJwtSigningAndValidationService jwtSignerValidationService =
new DefaultJwtSigningAndValidationService(jwtLoginJwkSetKeyStore); new DefaultJwtSigningAndValidationService(jwtLoginJwkSetKeyStore);
@ -76,6 +77,7 @@ public class JwtAuthnAutoConfiguration {
public JwtLoginService jwtLoginService( public JwtLoginService jwtLoginService(
@Value("${maxkey.login.jwt.issuer}") @Value("${maxkey.login.jwt.issuer}")
String issuer, String issuer,
@Qualifier("jwtLoginValidationService")
DefaultJwtSigningAndValidationService jwtLoginValidationService) { DefaultJwtSigningAndValidationService jwtLoginValidationService) {
JwtLoginService jwtLoginService = new JwtLoginService( JwtLoginService jwtLoginService = new JwtLoginService(
jwtLoginValidationService, jwtLoginValidationService,

View File

@ -30,6 +30,7 @@ import org.dromara.maxkey.web.WebInstRequestFilter;
import org.dromara.maxkey.web.WebXssRequestFilter; import org.dromara.maxkey.web.WebXssRequestFilter;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.endpoint.ApiVersion; import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
@ -193,6 +194,7 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
*/ */
@Bean (name = "addConverterRequestMappingHandlerAdapter") @Bean (name = "addConverterRequestMappingHandlerAdapter")
public RequestMappingHandlerAdapter requestMappingHandlerAdapter( public RequestMappingHandlerAdapter requestMappingHandlerAdapter(
@Qualifier("mappingJacksonHttpMessageConverter")
MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter, MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter,
MarshallingHttpMessageConverter marshallingHttpMessageConverter, MarshallingHttpMessageConverter marshallingHttpMessageConverter,
StringHttpMessageConverter stringHttpMessageConverter, StringHttpMessageConverter stringHttpMessageConverter,
@ -217,6 +219,7 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
*/ */
@Bean (name = "restTemplate") @Bean (name = "restTemplate")
public RestTemplate restTemplate( public RestTemplate restTemplate(
@Qualifier("mappingJacksonHttpMessageConverter")
MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter, MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter,
MarshallingHttpMessageConverter marshallingHttpMessageConverter) { MarshallingHttpMessageConverter marshallingHttpMessageConverter) {
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();

View File

@ -48,6 +48,7 @@ import org.dromara.maxkey.persistence.repository.LoginRepository;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.FilterRegistrationBean;
@ -75,9 +76,9 @@ public class Oauth20AutoConfiguration implements InitializingBean {
private static final Logger _logger = LoggerFactory.getLogger(Oauth20AutoConfiguration.class); private static final Logger _logger = LoggerFactory.getLogger(Oauth20AutoConfiguration.class);
@Bean @Bean
public FilterRegistrationBean<Filter> TokenEndpointAuthenticationFilter() { public FilterRegistrationBean<Filter> tokenEndpointAuthenticationFilter() {
_logger.debug("TokenEndpointAuthenticationFilter init "); _logger.debug("TokenEndpointAuthenticationFilter init ");
FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<Filter>(); FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>();
registration.setFilter(new TokenEndpointAuthenticationFilter()); registration.setFilter(new TokenEndpointAuthenticationFilter());
registration.addUrlPatterns( registration.addUrlPatterns(
OAuth2Constants.ENDPOINT.ENDPOINT_TOKEN + "/*", OAuth2Constants.ENDPOINT.ENDPOINT_TOKEN + "/*",
@ -93,7 +94,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* http://openid.net/specs/openid-connect-core-1_0.html#SelfIssued * http://openid.net/specs/openid-connect-core-1_0.html#SelfIssued
*/ */
@Bean(name = "oidcProviderMetadata") @Bean(name = "oidcProviderMetadata")
public OIDCProviderMetadataDetails OIDCProviderMetadataDetails( public OIDCProviderMetadataDetails oidcProviderMetadata(
@Value("${maxkey.oidc.metadata.issuer}") @Value("${maxkey.oidc.metadata.issuer}")
String issuer, String issuer,
@Value("${maxkey.oidc.metadata.authorizationEndpoint}") @Value("${maxkey.oidc.metadata.authorizationEndpoint}")
@ -133,6 +134,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
*/ */
@Bean(name = "jwtSignerValidationService") @Bean(name = "jwtSignerValidationService")
public DefaultJwtSigningAndValidationService jwtSignerValidationService( public DefaultJwtSigningAndValidationService jwtSignerValidationService(
@Qualifier("jwkSetKeyStore")
JWKSetKeyStore jwkSetKeyStore) JWKSetKeyStore jwkSetKeyStore)
throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException { throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
DefaultJwtSigningAndValidationService jwtSignerValidationService = DefaultJwtSigningAndValidationService jwtSignerValidationService =
@ -152,6 +154,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
*/ */
@Bean(name = "jwtEncryptionService") @Bean(name = "jwtEncryptionService")
public DefaultJwtEncryptionAndDecryptionService jwtEncryptionService( public DefaultJwtEncryptionAndDecryptionService jwtEncryptionService(
@Qualifier("jwkSetKeyStore")
JWKSetKeyStore jwkSetKeyStore) JWKSetKeyStore jwkSetKeyStore)
throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException { throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
DefaultJwtEncryptionAndDecryptionService jwtEncryptionService = DefaultJwtEncryptionAndDecryptionService jwtEncryptionService =
@ -224,7 +227,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return oauth20JdbcClientDetailsService * @return oauth20JdbcClientDetailsService
*/ */
@Bean(name = "oauth20JdbcClientDetailsService") @Bean(name = "oauth20JdbcClientDetailsService")
public JdbcClientDetailsService jdbcClientDetailsService(DataSource dataSource,PasswordEncoder passwordReciprocal) { public JdbcClientDetailsService jdbcClientDetailsService(DataSource dataSource,@Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource); JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
//clientDetailsService.setPasswordEncoder(passwordReciprocal); //clientDetailsService.setPasswordEncoder(passwordReciprocal);
_logger.debug("OAuth 2 Jdbc ClientDetails Service init."); _logger.debug("OAuth 2 Jdbc ClientDetails Service init.");
@ -301,6 +304,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
*/ */
@Bean(name = "oauth20UserAuthenticationManager") @Bean(name = "oauth20UserAuthenticationManager")
public ProviderManager oauth20UserAuthenticationManager( public ProviderManager oauth20UserAuthenticationManager(
@Qualifier("passwordEncoder")
PasswordEncoder passwordEncoder, PasswordEncoder passwordEncoder,
LoginRepository loginRepository LoginRepository loginRepository
) { ) {
@ -323,6 +327,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
@Bean(name = "oauth20ClientAuthenticationManager") @Bean(name = "oauth20ClientAuthenticationManager")
public ProviderManager oauth20ClientAuthenticationManager( public ProviderManager oauth20ClientAuthenticationManager(
JdbcClientDetailsService oauth20JdbcClientDetailsService, JdbcClientDetailsService oauth20JdbcClientDetailsService,
@Qualifier("passwordReciprocal")
PasswordEncoder passwordReciprocal PasswordEncoder passwordReciprocal
) { ) {

View File

@ -46,6 +46,7 @@ import org.opensaml.xml.parse.BasicParserPool;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -108,7 +109,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
@Bean(name = "authnResponseGenerator") @Bean(name = "authnResponseGenerator")
public AuthnResponseGenerator authnResponseGenerator(TimeService timeService,IDService idService, public AuthnResponseGenerator authnResponseGenerator(TimeService timeService,IDService idService,
@Value("${maxkey.saml.v20.idp.issuer}") String issuerEntityName) { @Value("${maxkey.saml.v20.idp.issuer}") String issuerEntityName) {
_logger.debug("issuerEntityName " + issuerEntityName); _logger.debug("issuerEntityName {}" , issuerEntityName);
AuthnResponseGenerator generator = new AuthnResponseGenerator(issuerEntityName,timeService,idService); AuthnResponseGenerator generator = new AuthnResponseGenerator(issuerEntityName,timeService,idService);
return generator; return generator;
} }
@ -279,7 +280,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
*/ */
@Bean(name = "extractPostBindingAdapter") @Bean(name = "extractPostBindingAdapter")
public ExtractPostBindingAdapter extractPostBindingAdapter(OpenHTTPPostDecoder openHTTPPostDecoder, public ExtractPostBindingAdapter extractPostBindingAdapter(OpenHTTPPostDecoder openHTTPPostDecoder,
KeyStoreLoader keyStoreLoader,IssueInstantRule issueInstantRule,MessageReplayRule messageReplayRule) { @Qualifier("keyStoreLoader") KeyStoreLoader keyStoreLoader,IssueInstantRule issueInstantRule,MessageReplayRule messageReplayRule) {
ExtractPostBindingAdapter adapter = new ExtractPostBindingAdapter(openHTTPPostDecoder); ExtractPostBindingAdapter adapter = new ExtractPostBindingAdapter(openHTTPPostDecoder);
adapter.setIssueInstantRule(issueInstantRule); adapter.setIssueInstantRule(issueInstantRule);
adapter.setKeyStoreLoader(keyStoreLoader); adapter.setKeyStoreLoader(keyStoreLoader);
@ -293,7 +294,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
*/ */
@Bean(name = "extractRedirectBindingAdapter") @Bean(name = "extractRedirectBindingAdapter")
public ExtractRedirectBindingAdapter extractRedirectBindingAdapter(OpenHTTPRedirectDecoder openHTTPRedirectDecoder, public ExtractRedirectBindingAdapter extractRedirectBindingAdapter(OpenHTTPRedirectDecoder openHTTPRedirectDecoder,
KeyStoreLoader keyStoreLoader,IssueInstantRule issueInstantRule,MessageReplayRule messageReplayRule) { @Qualifier("keyStoreLoader") KeyStoreLoader keyStoreLoader,IssueInstantRule issueInstantRule,MessageReplayRule messageReplayRule) {
ExtractRedirectBindingAdapter adapter = new ExtractRedirectBindingAdapter(openHTTPRedirectDecoder); ExtractRedirectBindingAdapter adapter = new ExtractRedirectBindingAdapter(openHTTPRedirectDecoder);
adapter.setIssueInstantRule(issueInstantRule); adapter.setIssueInstantRule(issueInstantRule);
adapter.setKeyStoreLoader(keyStoreLoader); adapter.setKeyStoreLoader(keyStoreLoader);

View File

@ -45,6 +45,7 @@ import org.dromara.maxkey.persistence.service.LdapContextService;
import org.dromara.maxkey.persistence.service.UserInfoService; import org.dromara.maxkey.persistence.service.UserInfoService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -98,7 +99,7 @@ public class MaxKeyConfig {
//可以在此实现其他的登陆认证方式请实现AbstractAuthenticationRealm //可以在此实现其他的登陆认证方式请实现AbstractAuthenticationRealm
@Bean @Bean
public JdbcAuthenticationRealm authenticationRealm( public JdbcAuthenticationRealm authenticationRealm(
PasswordEncoder passwordEncoder, @Qualifier("passwordEncoder") PasswordEncoder passwordEncoder,
PasswordPolicyValidator passwordPolicyValidator, PasswordPolicyValidator passwordPolicyValidator,
LoginRepository loginService, LoginRepository loginService,
LoginHistoryRepository loginHistoryService, LoginHistoryRepository loginHistoryService,

View File

@ -27,6 +27,7 @@ import org.dromara.maxkey.persistence.repository.PasswordPolicyValidator;
import org.dromara.maxkey.persistence.service.UserInfoService; import org.dromara.maxkey.persistence.service.UserInfoService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
@ -39,6 +40,7 @@ public class MaxKeyMgtConfig {
//authenticationRealm for MaxKeyMgtApplication //authenticationRealm for MaxKeyMgtApplication
@Bean @Bean
public JdbcAuthenticationRealm authenticationRealm( public JdbcAuthenticationRealm authenticationRealm(
@Qualifier("passwordEncoder")
PasswordEncoder passwordEncoder, PasswordEncoder passwordEncoder,
PasswordPolicyValidator passwordPolicyValidator, PasswordPolicyValidator passwordPolicyValidator,
LoginRepository loginRepository, LoginRepository loginRepository,

View File

@ -28,6 +28,7 @@ import org.dromara.maxkey.authz.oauth2.provider.token.store.RedisTokenStore;
import org.dromara.maxkey.persistence.redis.RedisConnectionFactory; import org.dromara.maxkey.persistence.redis.RedisConnectionFactory;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -47,7 +48,7 @@ public class Oauth20ClientAutoConfiguration {
@Bean @Bean
public JdbcClientDetailsService oauth20JdbcClientDetailsService( public JdbcClientDetailsService oauth20JdbcClientDetailsService(
DataSource dataSource,PasswordEncoder passwordReciprocal) { DataSource dataSource , @Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource); JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
//clientDetailsService.setPasswordEncoder(passwordReciprocal); //clientDetailsService.setPasswordEncoder(passwordReciprocal);
logger.debug("JdbcClientDetailsService inited."); logger.debug("JdbcClientDetailsService inited.");
@ -98,6 +99,7 @@ public class Oauth20ClientAutoConfiguration {
@Bean @Bean
public ProviderManager oauth20ClientAuthenticationManager( public ProviderManager oauth20ClientAuthenticationManager(
JdbcClientDetailsService oauth20JdbcClientDetailsService, JdbcClientDetailsService oauth20JdbcClientDetailsService,
@Qualifier("passwordReciprocal")
PasswordEncoder passwordReciprocal PasswordEncoder passwordReciprocal
) { ) {

View File

@ -27,6 +27,7 @@ import org.dromara.maxkey.persistence.repository.PasswordPolicyValidator;
import org.dromara.maxkey.persistence.service.UserInfoService; import org.dromara.maxkey.persistence.service.UserInfoService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
@ -39,6 +40,7 @@ public class MaxKeyOpenApiConfig{
//authenticationRealm for MaxKeyMgtApplication //authenticationRealm for MaxKeyMgtApplication
@Bean @Bean
public JdbcAuthenticationRealm authenticationRealm( public JdbcAuthenticationRealm authenticationRealm(
@Qualifier("passwordEncoder")
PasswordEncoder passwordEncoder, PasswordEncoder passwordEncoder,
PasswordPolicyValidator passwordPolicyValidator, PasswordPolicyValidator passwordPolicyValidator,
LoginRepository loginRepository, LoginRepository loginRepository,

View File

@ -28,6 +28,7 @@ import org.dromara.maxkey.authz.oauth2.provider.token.store.RedisTokenStore;
import org.dromara.maxkey.persistence.redis.RedisConnectionFactory; import org.dromara.maxkey.persistence.redis.RedisConnectionFactory;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -47,7 +48,7 @@ public class Oauth20ClientAutoConfiguration {
@Bean @Bean
public JdbcClientDetailsService oauth20JdbcClientDetailsService( public JdbcClientDetailsService oauth20JdbcClientDetailsService(
DataSource dataSource,PasswordEncoder passwordReciprocal) { DataSource dataSource, @Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource); JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
//clientDetailsService.setPasswordEncoder(passwordReciprocal); //clientDetailsService.setPasswordEncoder(passwordReciprocal);
logger.debug("JdbcClientDetailsService inited."); logger.debug("JdbcClientDetailsService inited.");
@ -98,6 +99,7 @@ public class Oauth20ClientAutoConfiguration {
@Bean @Bean
public ProviderManager oauth20ClientAuthenticationManager( public ProviderManager oauth20ClientAuthenticationManager(
JdbcClientDetailsService oauth20JdbcClientDetailsService, JdbcClientDetailsService oauth20JdbcClientDetailsService,
@Qualifier("passwordReciprocal")
PasswordEncoder passwordReciprocal PasswordEncoder passwordReciprocal
) { ) {