0 Replies Latest reply on Nov 6, 2005 4:40 PM by esojohc

    ERROR WITH LOGIN

    esojohc

      Hi,

      I have a error when i try to sign in my application using DatabaseServerLoginModule and it is:

      HTTP Status 400 - Invalid direct reference to form login page
      
      type Status report
      
      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).


      When I sign in with user and password incorrect the application send to page error.jsp define in web.xml, but when I sign in with user and password correct it throws the last one error. I don´t know where I have to put the page index.jsp for sign in to application.

      login-config.xml:



      <application-policy name = "dominioSeguridad">
       <authentication>
       <login-module code = "org.jboss.security.ClientLoginModule" flag = "required">
       </login-module>
       <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
       <module-option name="dsJndiName">java:jdbc/ConexionMySql</module-option>
       <module-option name="principalsQuery">select constrasena from cuenta where usuario=?</module-option>
       <module-option name="rolesQuery">select nombre, grupo from role where usuario=?</module-option>
       </login-module>
       </authentication>
       </application-policy>
      


      login.jsp:

      <form method="post" action="j_security_check">
      
       <input name="j_username" type="text" size="20" maxlength="30">
      
       <input name="j_password" type="password" size="20" maxlength="30">
      
       <input type="submit" value="Log In">
      
      </form>


      jboss-web.xml:

      <jboss-web>
       <security-domain>java:jaas/dominioSeguridad</security-domain>
       <context-root>/PruebaSeguridad</context-root>
      </jboss-web>


      web.xml:

      <security-constraint>
       <web-resource-collection>
       <web-resource-name>NombreWebResource</web-resource-name>
       <url-pattern>/registrar.jsp</url-pattern>
       <url-pattern>/ingresar.jsp</url-pattern>
       <url-pattern>/index.jsp</url-pattern>
       <http-method>GET</http-method>
       <http-method>POST</http-method>
       </web-resource-collection>
       <auth-constraint>
       <role-name>CO</role-name>
       </auth-constraint>
       <user-data-constraint>
       <transport-guarantee>NONE</transport-guarantee>
       </user-data-constraint>
      </security-constraint>
      
      <login-config>
       <auth-method>FORM</auth-method>
       <form-login-config>
       <form-login-page>/login.jsp</form-login-page>
       <form-error-page>/error.jsp</form-error-page>
       </form-login-config>
      </login-config>
      
      <security-role>
       <description>Role</description>
       <role-name>CO</role-name>
      </security-role>


      jboss.xml:

      <container-configuration>
       <container-name>Standard Stateless SessionBean</container-name>
       <security-domain>java:jaas/dominioSeguridad</security-domain>
      </container-configuration>


      ejb-jar.xml:

      <assembly-descriptor>
       <security-role>
       <description>Descripcion</description>
       <role-name>CO</role-name>
       </security-role>
       <method-permission>
       <role-name>CO</role-name>
       <method>
       <ejb-name>EJBSession</ejb-name>
       <method-intf>Remote</method-intf>
       <method-name>*</method-name>
       </method>
       </method-permission>
      </assembly-descriptor>


      I would like to know how application redirects to index.jsp?????