I think the configureGlobal method in the SecurityConfig class needs an @Autowired annotation. The code presented in the book still runs, only because the framework is smart enough to adopt the only PasswordEncoder bean available. The configureGlobal method itself without an @Autowired annotation doesn't get executed or do anything at all.
Below is the amended code:
@Configuration
@EnableWebSecurity
public class SecurityConfig {
...
I think the
configureGlobal
method in theSecurityConfig
class needs an@Autowired
annotation. The code presented in the book still runs, only because the framework is smart enough to adopt the onlyPasswordEncoder
bean available. TheconfigureGlobal
method itself without an@Autowired
annotation doesn't get executed or do anything at all.Below is the amended code:
@Configuration @EnableWebSecurity public class SecurityConfig { ...
}