@Bean public to default
This commit is contained in:
@@ -36,18 +36,18 @@ import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
@AutoConfiguration
|
||||
public class MaxKeyOpenApiConfig{
|
||||
private static final Logger logger = LoggerFactory.getLogger(MaxKeyOpenApiConfig.class);
|
||||
|
||||
//authenticationRealm for MaxKeyMgtApplication
|
||||
@Bean
|
||||
public JdbcAuthenticationRealm authenticationRealm(
|
||||
@Qualifier("passwordEncoder")
|
||||
PasswordEncoder passwordEncoder,
|
||||
PasswordPolicyValidator passwordPolicyValidator,
|
||||
LoginRepository loginRepository,
|
||||
LoginHistoryRepository loginHistoryRepository,
|
||||
UserInfoService userInfoService,
|
||||
IpLocationParser ipLocationParser,
|
||||
JdbcTemplate jdbcTemplate) {
|
||||
|
||||
//authenticationRealm for MaxKeyMgtApplication
|
||||
@Bean
|
||||
JdbcAuthenticationRealm authenticationRealm(
|
||||
@Qualifier("passwordEncoder")
|
||||
PasswordEncoder passwordEncoder,
|
||||
PasswordPolicyValidator passwordPolicyValidator,
|
||||
LoginRepository loginRepository,
|
||||
LoginHistoryRepository loginHistoryRepository,
|
||||
UserInfoService userInfoService,
|
||||
IpLocationParser ipLocationParser,
|
||||
JdbcTemplate jdbcTemplate) {
|
||||
|
||||
JdbcAuthenticationRealm authenticationRealm = new JdbcAuthenticationRealm(
|
||||
passwordEncoder,
|
||||
@@ -62,8 +62,8 @@ public class MaxKeyOpenApiConfig{
|
||||
return authenticationRealm;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AbstractOtpAuthn timeBasedOtpAuthn() {
|
||||
@Bean
|
||||
AbstractOtpAuthn timeBasedOtpAuthn() {
|
||||
AbstractOtpAuthn tfaOtpAuthn = new TimeBasedOtpAuthn();
|
||||
logger.debug("TimeBasedOtpAuthn inited.");
|
||||
return tfaOtpAuthn;
|
||||
|
||||
@@ -45,23 +45,23 @@ import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
@AutoConfiguration
|
||||
public class Oauth20ClientAutoConfiguration {
|
||||
private static final Logger logger = LoggerFactory.getLogger(Oauth20ClientAutoConfiguration.class);
|
||||
|
||||
|
||||
@Bean
|
||||
public JdbcClientDetailsService oauth20JdbcClientDetailsService(
|
||||
JdbcClientDetailsService oauth20JdbcClientDetailsService(
|
||||
DataSource dataSource, @Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
|
||||
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
|
||||
//clientDetailsService.setPasswordEncoder(passwordReciprocal);
|
||||
logger.debug("JdbcClientDetailsService inited.");
|
||||
return clientDetailsService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TokenStore.
|
||||
* @param persistence int
|
||||
* @return oauth20TokenStore
|
||||
*/
|
||||
@Bean
|
||||
public TokenStore oauth20TokenStore(
|
||||
TokenStore oauth20TokenStore(
|
||||
@Value("${maxkey.server.persistence}") int persistence,
|
||||
JdbcTemplate jdbcTemplate,
|
||||
RedisConnectionFactory jedisConnectionFactory) {
|
||||
@@ -76,13 +76,13 @@ public class Oauth20ClientAutoConfiguration {
|
||||
|
||||
return tokenStore;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* clientDetailsUserDetailsService.
|
||||
* @return oauth20TokenServices
|
||||
*/
|
||||
@Bean
|
||||
public DefaultTokenServices oauth20TokenServices(
|
||||
DefaultTokenServices oauth20TokenServices(
|
||||
JdbcClientDetailsService oauth20JdbcClientDetailsService,
|
||||
TokenStore oauth20TokenStore) {
|
||||
DefaultTokenServices tokenServices = new DefaultTokenServices();
|
||||
@@ -91,17 +91,17 @@ public class Oauth20ClientAutoConfiguration {
|
||||
tokenServices.setSupportRefreshToken(true);
|
||||
return tokenServices;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ProviderManager.
|
||||
* @return oauth20ClientAuthenticationManager
|
||||
*/
|
||||
@Bean
|
||||
public ProviderManager oauth20ClientAuthenticationManager(
|
||||
ProviderManager oauth20ClientAuthenticationManager(
|
||||
JdbcClientDetailsService oauth20JdbcClientDetailsService,
|
||||
@Qualifier("passwordReciprocal")
|
||||
PasswordEncoder passwordReciprocal
|
||||
) {
|
||||
) {
|
||||
|
||||
ClientDetailsUserDetailsService cientDetailsUserDetailsService =
|
||||
new ClientDetailsUserDetailsService(oauth20JdbcClientDetailsService);
|
||||
|
||||
Reference in New Issue
Block a user