title: Multiple login-config for Java webapp
body: <p>I have a Java web application that has a website for user interactions. To authenticate users I configured the application via web.xml to use FORM-based authentication. Users are forwarded to a login page and everything is fine so far.</p>
  
  <p>Now we are developing a desktop client (in C#) for this web application which accesses the application via RESTful web services. I implemented these services in the same web app as the web site and of course the caller of the web service should be authenticated too. But now I'm facing the problem, that whenever I call a web service the server is returning the login page's HTML as response.</p>
  
  <p>I think it would be cool to be able to use another login-config for my REST service servlet (which would probably use BASIC authentication then).</p>
  
  <p>Google didn't bring up much, but I can't believe I'm the first one being in such situation. So I would like to hear your thoughts and solutions.</p>
  
  <p>Any hint is appreciated.</p>