Adding a custom filter to be invoked after spring-security filter in a Servlet 3+ environment

前端 未结 3 1837
[愿得一人]
[愿得一人] 2021-01-18 16:35

I\'m using Spring-Security 3.2.4 and Spring Boot 1.1.0 (and it\'s related dependencies versions 4.X). I\'m writing a web application that will be run in an embedded tomcat.<

3条回答
  •  心在旅途
    2021-01-18 17:25

    The FilterChainProxy use by Spring Security is not Ordered (if it was you could order all your filters). But you should be able to register it in a FilterRegistrationBean which is Ordered and register your other filters the same way. In the case of the security filter you can inject it by name into the registration bean. The others you can probably inject by calling a @Bean method.

提交回复
热议问题