title: Multiple AuthenticationProvider with different UsernamePasswordAuthToken to authenticate different login forms without fallback authentication
body: <p>While working with spring security I had a look at interesting thread in stackoverflow, there it was requirement to have authenticating <strong>two set of users</strong> against <strong>different authentication provider</strong> say employees against <code>LDAP</code> and customer against <code>DATABASE</code>. Thread came up with accepted solution to have a single login form with a radio button to distinguish employee from customer and to have <strong>custom authentication filter</strong> which differentiate login request based on userType and sets different authenticationToken(<strong>customerAuthToken</strong>/<strong>employeeAuthToken</strong>) and request is proceeded for authentication. There will be two <code>AuthenticationProvider</code> implementation and authentication is done and decided by supporting token.
  In this way thread was able to provide interesting solution to avoid fallback authentication which spring security provides by default.</p>
  
  <p>Have a look at thread <a href="https://stackoverflow.com/questions/4783063/configuring-spring-security-3-x-to-have-multiple-entry-points">Configuring Spring Security 3.x to have multiple entry points</a></p>
  
  <p>Since answer is completely in xml configuration. I just wanted to have the solution be available in java configuration. I will be posting that in answer.</p>
  
  <p><strong>Now my question</strong>, <em>with evolution of spring version, is it possible to have the same functionality by any new features/ minimal configurations apart from my answer</em>?</p>