-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Description
The code in AuthenticationManagerConfiguration assumes a PasswordEncoder of NoOpPasswordEncoder which was the default of Spring Security until recently. Now the default is PasswordEncoderFactories.createDelegatingPasswordEncoder().
This is the un-tested version of the updates that should be made:
public class AuthenticationManagerConfiguration {
private static final Log logger = LogFactory
.getLog(AuthenticationManagerConfiguration.class);
@Autowired(required = false)
private PasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
@Bean
public InMemoryUserDetailsManager inMemoryUserDetailsManager() throws Exception {
String password = UUID.randomUUID().toString();
logger.info(String.format("%n%nUsing default security password: %s%n", password));
String encodedPassword = this.encoder.encode(password);
return new InMemoryUserDetailsManager(
User.withUsername("user").password(encodedPassword).roles().build());
}
}A similar change needs to be done in ReactiveAuthenticationManagerConfiguration
Metadata
Metadata
Assignees
Labels
type: taskA general taskA general task