title: Form-based JAAS authentication: Log-in on index.xhtml and stay on index.xhtml
body: <p><em>I guess that this question has been answered somewhere before, but googleing for jaas and form-based authentication does not help:</em></p>
  
  <p>I would like to use JAAS in my JSF application, because I like the idea that you can change the login module from Database to Ldap without changing the application.</p>
  
  <p>However, the <code>web.xml</code> login-config seems to be limited to <code>BASIC</code>, <code>CLIENT-CERT</code>, <code>FORM</code>, etc., and I don't want to use any of those. Form-based authentication seems close to what I need, but I do not have a strict separation between public and restricted pages.</p>
  
  <p><strong>I just want the user to be able to (<em>optionally</em>) log-in on <code>index.xhtml</code> but stay on <code>index.xhtml</code> without any redirection.</strong></p>
  
  <p>How can I authenticate with JAAS using an HTML form without having a <code>&lt;url-pattern&gt;</code> constraint in <code>web.xml</code>?</p>
  
  <p>P.S.: In case it is relevant: I'm using JBoss AS 7.1. and JSF 2</p>