How to redirect to a specific page after JAAS login in a web application running on JBoss EAP?

Solution Verified - Updated -

Issue

  • How to redirect to a specific page after JAAS login in a web application running on JBoss EAP?
  • After a successful JAAS login is it possible to immediately redirect to a different page?
  • Is the following scenario possible in JBoss EAP?

    • The User has following specified in web.xml file:
                  <security-constraint>
            <web-resource-collection>
              <web-resource-name>MySecuredResource-1</web-resource-name>
              <url-pattern>/secured/*</url-pattern>
            </web-resource-collection>
            <auth-constraint>
              <role-name>JBossAdmin</role-name>
            </auth-constraint>
          </security-constraint>
    
    
          <login-config>
            <auth-method>FORM</auth-method>
            <form-login-config>
              <form-login-page>/login.jsp</form-login-page>
              <form-error-page>/loginfail.jsp</form-error-page>
            </form-login-config>
          </login-config>
    
    
          <security-role>
            <role-name>JBossAdmin</role-name>
          </security-role>
    
    • The user hits http://localhost:8080/loginApp/secured/showPrivateData.jsp, before login, it will be forward to login.jsp
    • After the successful login, instead of coming back to showPrivateData.jsp it should go to a page say Landing.html.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content