How to add filter after the HTTP BasicAuthenticationFilter when using @EnableAuthorizationServer
Instead of using @EnableAuthorizationServer
you should be able to extend AuthorizationServerSecurityConfiguration
and include that in your Spring configuration. E.g.
@Configuration
public class OAuth2Config extends AuthorizationServerSecurityConfiguration {
@Override
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
http.addFilterAfter(myFilter(), BasicAuthenticationFilter.class);
}
}