title: Multiple user details services for different endpoints
body: <p>I am building a REST API using Spring and am currently authenticating all my requests using a custom user details service and this configuration code:</p>
  
  <pre><code>@Override
  protected void configure(HttpSecurity http) throws Exception {
      http.authorizeRequests().anyRequest().authenticated().and().httpBasic();
  }
  </code></pre>
  
  <p>I am also setting up a <code>DaoAuthenticationProvider</code> to use the my user details service and using that to configure global security.</p>
  
  <p>Now, I want to provide an endpoint that (while still secured with HTTP basic authentication) uses a different user details service to check whether the user is allowed to access the given resource.</p>
  
  <p>How do I use two different user details services for different endpoints?</p>