November 2017
Intermediate to advanced
542 pages
14h 24m
English
We'll need to configure Spring Security to have a reference to PasswordEncoder, so that it can encode and compare the presented password during user login. Simply add a passwordEncoder method and refer to the bean ID we defined in the previous step:
//src/main/java/com/packtpub/springsecurity/configuration/SecurityConfig.java @Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth .jdbcAuthentication() .dataSource(dataSource) .usersByUsernameQuery(CUSTOM_USERS_BY_USERNAME_QUERY) .authoritiesByUsernameQuery( CUSTOM_AUTHORITIES_BY_USERNAME_QUERY) .passwordEncoder(passwordEncoder()) ; }
If you were to try the application at this point, you'd notice ...
Read now
Unlock full access