Is it possible to show a custom error message in a custom login module with JAAS in EAP 7.2?

Latest response

Does the solution described on still work with EAP 7.2? How do you get error from out of the error page?

I am working on upgrading from Jboss 5.1 to 7.2 and when the LoginModule throw a it is going to Form error page. The JSP is checking for error but is null.

// 5.1 excp was instance of LoginException, but is null.
Exception ex = (Exception) session.getAttribute("j_exception");

I also tried...
Exception ex = (Exception) request.getAttribute("javax.servlet.error.exception");

Could not find anything in session or request with the error.

In Web.xml:


In Jboss-web.xml:


In standalone-full.xml:

 <security-domain name="cp-mydomain" cache-type="default">
        <login-module code="" flag="required">
            <module-option name="loginFailureLimit" value="3"/>
            <module-option name="passwordExpireDays" value="60"/>
        <login-module code="" flag="optional">
            <module-option name="rolesProperties" value="META-INF/"/>
            <module-option name="replaceRole" value="true"/>
            <module-option name="" value="cp-mydomain"/>
            <module-option name="password-stacking" value="useFirstPass"/>


<Context cookies="true" crossContext="true">
    <Valve className=""
        includePassword="false" />

I read that the Context.xml is not longer used, and to put in jboss-xml

I tried:


Where is the ExtendedFormAuthenticator class to use?


I see that JBoss Web was replaced by Undertow, which does not contain support for the Valve functionality. What do I replace the ExtendedFormAuthenticator with?