Spring Security authenticationmanager must be specified - for custom filter

后端 未结 2 1612
失恋的感觉
失恋的感觉 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条回答
  • 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);
    }
    
    0 讨论(0)
  • 2021-01-02 04:39

    I actually got past the error. I just had to remove the @Component annotation from my custom filter.

    0 讨论(0)
提交回复
热议问题