I am trying to implement Basic Auth + oAuth2 in springboot, means some url should work like traditional way after login to system, and some should work on AOuth2.
Li
If you need different security setups for different parts of your application, you need to create separate Spring Security @Configuration-s, where each one will configure just one authentication mechanism. Each configuration should specify the URIs it covers and the configurations need to be @Order-ed. The configuration without the @Order annotation is considered the last - the fallback. It's described in the Spring Security reference manual.
So you will need three configurations:
http.antMatcher("/superAdmin/**")... with @Order(1).http.antMatcher("/api/vi/**")... with @Order(2).@Order annotation specified.