Usage of raw types for the DaoAuthenticationConfigurator and AuthenticationManagerBuilder makes the AuthenticationManagerBuilder().userDetailsService(uds).passwordEncoder(pe).build() require a cast to AuthenticationManager.