1 Reply Latest reply on Oct 22, 2009 10:49 AM by Wolfgang Knauf

    Error using DatabaseServerLoginModule

    Keith Hennessy Newbie

      Hello Here is a bit of the relevant code I'm using:

      web.xml

      <web-resource-collection>
       <web-resource-name>constraint1</web-resource-name>
       <url-pattern>/index.jsp</url-pattern>
       <http-method>GET</http-method>
       <http-method>POST</http-method>
       </web-resource-collection>




      <login-config>
       <auth-method>FORM</auth-method>
       <realm-name>myrealm</realm-name>
       <form-login-config>
       <form-login-page>/login.jsp</form-login-page>
       <form-error-page>/loginFailure.jsp</form-error-page>
       </form-login-config>
       </login-config>


      jboss-web.xml

      <security-domain>java:/jaas/marsPolicy</security-domain>


      login-config.xml

      <application-policy name = "marsPolicy">
       <authentication>
       <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
       <module-option name = "dsJndiName">java:/datasource/marquis-backup</module-option>
       <module-option name = "principalsQuery">SELECT password FROM [user] WHERE loginId = ?</module-option>
       <module-option name = "rolesQuery">select description, 'roles' from role r, userrole ur, [user] u where u.userId = ur.userId and ur.roleId = r.roleId and u.loginid = ?</module-option>
       </login-module>
       </authentication>
       </application-policy>



      When I enter invalid credentials I'm properly forwarded to loginFailure.jsp, when I enter valid credentials I get the following error:

      message: Invalid direct reference to form login page

      description: The request sent by the client was syntactically incorrect (Invalid direct reference to form login page).



      How can I correct this error?

      Thank you.
      Keith