Get instance of AuthenticationManager Manually

前端 未结 1 1897
庸人自扰
庸人自扰 2021-01-02 11:52

I\'m trying to implement the below, but my authenticationManager instance throws the below exception and is not autowired. How do I get an instance of it from Spring manual

相关标签:
1条回答
  • 2021-01-02 12:21

    First, provide an explicit bean name for your AuthenticationManager

    <authentication-manager alias="authenticationManager">
       ...
    </authentication-manager>
    

    Second, use qualifier when auto-wiring:

    @Autowired
    @Qualifier("authenticationManager")
    protected AuthenticationManager authenticationManager;
    
    0 讨论(0)
提交回复
热议问题