|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright 2002-2019 the original author or authors.
|
|
|
+ * Copyright 2002-2024 the original author or authors.
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -67,11 +67,14 @@ class InitializeUserDetailsBeanManagerConfigurer extends GlobalAuthenticationCon
|
|
|
PasswordEncoder passwordEncoder = getBeanOrNull(PasswordEncoder.class);
|
|
|
UserDetailsPasswordService passwordManager = getBeanOrNull(UserDetailsPasswordService.class);
|
|
|
CompromisedPasswordChecker passwordChecker = getBeanOrNull(CompromisedPasswordChecker.class);
|
|
|
- DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
|
|
|
- provider.setUserDetailsService(userDetailsService);
|
|
|
+ DaoAuthenticationProvider provider;
|
|
|
if (passwordEncoder != null) {
|
|
|
- provider.setPasswordEncoder(passwordEncoder);
|
|
|
+ provider = new DaoAuthenticationProvider(passwordEncoder);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ provider = new DaoAuthenticationProvider();
|
|
|
}
|
|
|
+ provider.setUserDetailsService(userDetailsService);
|
|
|
if (passwordManager != null) {
|
|
|
provider.setUserDetailsPasswordService(passwordManager);
|
|
|
}
|