Usage of raw types for the DaoAuthenticationConfigurator makes the build() command in AuthenticationManagerBuilder require a cast.
e.g. (AuthenticationManager) new AuthenticationManagerBuilder().userDetailsService(userDetailsService()).passwordEncoder(passwordEncoder).and().build()
instead of just new AuthenticationManagerBuilder().userDetailsService(userDetailsService()).passwordEncoder(passwordEncoder).and().build();