Password hashing in Spring Security is encapsulated and defined by implementations of the o.s.s.authentication.encoding.PasswordEncoder interface. The simple configuration of a password encoder is possible through the passwordEncoder() method within the AuthenticationManagerBuilder element, as follows:
auth
.jdbcAuthentication()
.dataSource(dataSource)
.usersByUsernameQuery(CUSTOM_USERS_BY_USERNAME_QUERY)
.authoritiesByUsernameQuery(CUSTOM_AUTHORITIES_BY_USERNAME_QUERY)
.passwordEncoder(passwordEncoder());
You'll be happy to learn that Spring Security ships with a number of implementations of passwordEncoder, which are applicable for different needs and security requirements.
The following table provides a list of the out-of-the-box implementation classes and their benefits. Note that all implementations reside...