title: Login configuration in Vaadin/Spring application in JBoss AS 7
body: <p>I am trying to configure authentication in my Vaadin/Spring application deployed in JBoss AS 7, but I cannot find any documentation on this. I've managed to configure the application so that only authenticated user can use it. Here is a part of my web.xml:</p>
  
  <pre><code>    &lt;security-constraint&gt;
      &lt;display-name&gt;SecureApplicationConstraint&lt;/display-name&gt;
      &lt;web-resource-collection&gt;
          &lt;web-resource-name&gt;Vaadin application&lt;/web-resource-name&gt;
          &lt;description&gt;The entire Vaadin application is protected&lt;/description&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/web-resource-collection&gt;
      &lt;auth-constraint&gt;
          &lt;description&gt;Only valid users are allowed&lt;/description&gt;
          &lt;role-name&gt;ROLE_ADMIN&lt;/role-name&gt;
          &lt;role-name&gt;ROLE_DOCTOR&lt;/role-name&gt;
          &lt;role-name&gt;ROLE_PATIENT&lt;/role-name&gt;
      &lt;/auth-constraint&gt;
  &lt;/security-constraint&gt;
  &lt;login-config&gt;
      &lt;auth-method&gt;FORM&lt;/auth-method&gt;
      &lt;realm-name&gt;file&lt;/realm-name&gt;
      &lt;form-login-config&gt;
          &lt;form-login-page&gt;/login.jsp&lt;/form-login-page&gt;
          &lt;form-error-page&gt;/loginError.jsp&lt;/form-error-page&gt;
      &lt;/form-login-config&gt;
  &lt;/login-config&gt;
  &lt;security-role&gt;
      &lt;description/&gt;
      &lt;role-name&gt;ROLE_ADMIN&lt;/role-name&gt;
  &lt;/security-role&gt;
  &lt;security-role&gt;
      &lt;description/&gt;
      &lt;role-name&gt;ROLE_DOCTOR&lt;/role-name&gt;
  &lt;/security-role&gt;
  &lt;security-role&gt;
      &lt;description/&gt;
      &lt;role-name&gt;ROLE_PATIENT&lt;/role-name&gt;
  &lt;/security-role&gt;
  </code></pre>
  
  <p>Now the application won't be displayed until the user is authenticated. What I expected was, that the user would be automatically redirected to the login form. I still have to configure the JBoss app server, but cannot find how. I used to work with JBoss 5, where this configuration was done in a login-config.xml file. Does anybody know hoe to configure the authentication REALM in JBoss 7 and make the Vaadin application redirect the user to the login form if he is not authenticated yet? Thanks for your help,</p>
  
  <p>Bye,
  Filip</p>