Spring Security authenticationmanager must be specified - for custom filter

后端 未结 2 1627
失恋的感觉
失恋的感觉 2021-01-02 03:32

I’m trying to create a custom username password authentication filter since I need to validate passwords from two different sources. I’m using Spring Boot 1.2.1 and Java co

2条回答
  •  旧时难觅i
    2021-01-02 04:39

    The documentation for AbstractAuthenticationProcessingFilter states that you must set an AuthenticationManager.

    I suggest you try adding the following code inside your CustomUsernamePasswordAuthenticationFilter class:

    @Override
    @Autowired
    public void setAuthenticationManager(AuthenticationManager authenticationManager) {
        super.setAuthenticationManager(authenticationManager);
    }
    

提交回复
热议问题