Search code examples
web-applicationsjbossjboss7.x

Form based authentication in JBoss successful but throws 408 error page


I am trying to migrate my java application from JBoss 5.1 to JBoss 7.0. I am able to deploy the application, but if I want to login (form based authentication), I get a 408 (time out) error page. Check out this extract from server.log:

10:06:52,997 TRACE [org.jboss.security.authentication.JBossCachedAuthenticationManager] (http--127.0.0.1-8080-5) End isValid, true
10:06:52,997 TRACE [org.jboss.as.web.security.JBossWebRealm] (http--127.0.0.1-8080-5) User: tlubrpa1 is authenticated
10:06:52,997 DEBUG [org.apache.catalina.authenticator.FormAuthenticator] (http--127.0.0.1-8080-5) Authentication of 'tlubrpa1' was successful
10:06:52,998 DEBUG [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/SSIS2_1]] (http--127.0.0.1-8080-5) User took so long to log on the session expired
10:06:52,998 DEBUG [org.apache.catalina.authenticator.AuthenticatorBase] (http--127.0.0.1-8080-5)  Failed authenticate() test ??/SSIS2_1/View/Mainpage/j_security_check
10:06:53,511 DEBUG [org.apache.catalina.session.ManagerBase] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) Start expire sessions StandardManager at 1311062813511 sessioncount 0
10:06:53,512 DEBUG [org.apache.catalina.session.ManagerBase] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) End expire sessions StandardManager processingTime 1 expired sessions: 0
10:06:54,181 TRACE [org.jboss.as.deployment] (DeploymentScanner-threads - 1) Scanning directory C:\java\jboss-as-web-7.0.0.Final\standalone\deployments for deployment content changes

This is my the corresponding extract from standalone.xml:

<subsystem xmlns="urn:jboss:domain:security:1.0">
        <security-domains>
            <security-domain name="SSIS2-domain">
                <authentication>
                    <login-module code="Database" flag="required">
                        <module-option name="dsJndiName" value="java:/SSIS2DSDev"/>
                        <module-option name="principalsQuery" value="SELECT password FROM users WHERE username=? AND active=1"/>
                        <module-option name="rolesQuery" value="SELECT USERROLE.rolename, 'Roles' FROM USERS INNER JOIN (USERROLE INNER JOIN MAPUSERUSERROLE ON USERROLE.roleid = MAPUSERUSERROLE.roleid) ON USERS.userid = MAPUSERUSERROLE.userid where USERS.username=?"/>
                        <module-option name="hashAlgorithm" value="MD5"/>
                        <module-option name="hashEncoding" value="base64"/>
                    </login-module>
                </authentication>
            </security-domain>
        </security-domains>
    </subsystem>

The security stuff is actually the same like in the login-config.xml from JBoss 5.1, and as you can see above it authenticates the user.

Does anyone have an idea?


Solution

  • I found out that it is actually a bug. There is a workaround. Add this to standalone.xml right after the element:

    <system-properties>
        <property name="org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR" value="false"/>
    </system-properties>