How to represent the Spring Security “custom-filter” using Java configuration?

前端 未结 3 673
情话喂你
情话喂你 2020-12-23 11:45

What is the equivalent Java configuration for the Spring Security tag?



        
3条回答
  •  失恋的感觉
    2020-12-23 12:23

    Try to add @Component to your MyUsernamePasswordAuthenticationFilter class.

    This annotation makes the class considered as candidates for auto-detection, see: @Component


    For this:

    
    

    You can add this:

    .addFilter[Before|After](authenticationTokenProcessingFilter, UsernamePasswordAuthenticationFilter.class)
    

    See: Standard Filter Aliases and Ordering

提交回复
热议问题