Spring Security 4扩展了自定义过滤器

时间:2016-02-24 10:54:52

标签: java spring security spring-security filter

要更改我在下面的弹簧安全过滤器

<http auto-config="false" entry-point-ref="authenticationEntryPoint">
    <custom-filter before="FORM_LOGIN_FILTER" ref="customPasswordAuthenticationFilter"/> 
</http>

但我想更改FORM_LOGIN_FILTER所以我更喜欢使用position="FORM_LOGIN_FILTER",但我收到错误:

Configuration problem: 
Filter beans '<customUsernamePasswordAuthenticationFilter>' and '<org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0>' have the same 'order' value. 
When using custom filters, please make sure the positions do not conflict with default filters. Alternatively you can disable the default filters by removing the corresponding child elements from <http> and avoiding the use of <http auto-config='true'>.

该文件提到:

  

属性:position自定义过滤器的显式位置   应放在链中。如果要更换标准,请使用。

0 个答案:

没有答案