title: Spring security SSO + Basic Authentication
body: <p>I would like to able security like this in my application:<br>
  Protected by OAuth2 SSO:<br>
  /app/**  ,/VAADIN/**  ,/vaadinServlet/**<br>
  Protected by Basic Authentication:<br>
  /intergration/**<br>
  And the rest of resources are opened.  </p>
  
  <pre><code>@Component
  @EnableOAuth2Sso
  public class SingleSignOnSecurity extends OAuth2SsoConfigurerAdapter {
      @Override
      public void match(RequestMatchers matchers) {
          matchers.antMatchers("/app/**", "/VAADIN/**", "/vaadinServlet/**");
      }
      @Override
      public void configure(HttpSecurity http) throws Exception {
          http.csrf().disable().logout().permitAll();
          http.authorizeRequests().antMatchers("/app/**", "/VAADIN/**", "/vaadinServlet/**").authenticated();
      }
  }
  
  @Component
  public class HardCodedSecurity extends WebSecurityConfigurerAdapter {
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http
             .authorizeRequests()
             .antMatchers("/integration/**").authenticated()
             .and()
             .httpBasic()
             .and()
             .csrf().disable()
             .logout().permitAll();
      }
  }
  </code></pre>
  
  <p>If I put <code>@Order</code> on <code>HardCodedSecurity</code> class to be <code>(SecurityProperties.ACCESS_OVERRIDE_ORDER + 1)</code>, then the SSO works, but not the Basic Auth.  <code>(SecurityProperties.ACCESS_OVERRIDE_ORDER - 1)</code>, then the Basic Auth works, but not the SSO. I can't get both of them to work as described.</p>
  
  <p>I would be thankful if you can help me to the right path here. Thanks !</p>