2017-04-03 54 views
0

包括spring安全启动程序依赖项使得AuthenticationManager在Spring启动应用程序中可用。我可以简单地Autowire AuthenticationManager。 SpringBoot如何理解自动实例化AuthenticationManager的bean,虽然它位于一个非常不同的jar文件中?AuthenticationManager实现如何在SpringBoot应用程序中实例化

例如,

我可以简单的写

@Autowire 的AuthenticationManager authManager;

在我的SpringBoot应用程序中包含依赖项后。 Spring如何知道它应该实例化哪个类以及如何实现?

回答

0

org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration导入配置类org.springframework.boot.autoconfigure.security.AuthenticationManagerConfiguration,其然后提供用于AuthenticationManager豆(它将使用的助洗剂,根据其提供的配置来构建所述认证管理器)。

相关问题