Currently, it is not possible to do this

@Bean
@Order(1)
WebSecurityConfigurerAdapter testWebSecurityConfigurerAdapter() {
    return new WebSecurityConfigurerAdapter() {
        @Override
        protected void configure(HttpSecurity http) throws Exception {
            //something
        }
    };
}

It would be nice if @Order worked on the bean definition for WebSecurityConfigurerAdapters.

Comment From: jgrandja

Related #9154

Comment From: rwinch

Given WebSecurityConfigurerAdapter is deprecated we do not plan to add this feature. See gh-10822