Describe the bug I inherit AbstractAuthenticationFilterConfigurer and call super method in configure method will cause
java.lang.IllegalArgumentException: The Filter class CustomAuthenticationFilter does not have a registered order and cannot be added without a specified order. Consider using addFilterBefore or addFilterAfter instead.
To Reproduce
public class CustomConfigurer<H extends HttpSecurityBuilder<H>> extends
AbstractAuthenticationFilterConfigurer<H, CustomConfigurer<H>, CustomAuthenticationFilter>{
public CustomConfigurer() {
super(new CustomAuthenticationFilter(), "/custom");
}
@Override
public void configure(H http) throws Exception {
http.addFilterBefore(getAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
http.authenticationProvider(this.postProcess(customAuthenticationProvider));
super.configure(http);
}
}
Expected behavior super.configure(http); does not report an error
Comment From: jgrandja
@chenzhenjia This issue may be related to gh-9787.
Can you try in a 5.4.x release and let me know if it works.
Comment From: chenzhenjia
@chenzhenjia This issue may be related to gh-9787.
Can you try in a 5.4.x release and let me know if it works.
5.4.x no problem, upgrade to 5.5.0 will report an error
Comment From: jgrandja
@chenzhenjia This issue is most likely related to gh-9787.
I'm going to close this as a duplicate. However, I can reopen if the fix in gh-9787 does not resolve it.