0
如何在我的自定义类中获取AuthenticationManager bean?类WebApplicationContext和ApplicationContext没有方法getBean(“refBean”)。请帮帮我!在spring security中获取AuthenticationManager
如何在我的自定义类中获取AuthenticationManager bean?类WebApplicationContext和ApplicationContext没有方法getBean(“refBean”)。请帮帮我!在spring security中获取AuthenticationManager
春季安全配置定义一个别名,你的认证管理器:
<authentication-manager alias="authenticationManager">
然后你可以在一些春天注入它管理使用的bean注释:
@Autowired
@Qualifier("authenticationManager")
private AuthenticationManager authenticationManager;
注意:您需要一个限定词,因为在运行时有多个AuthenticationManager类型的bean。