<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Multiple Wars Sharing a Login Page
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/jamesc1">James C</a> in <i>JBoss Web Development</i> - <a href="http://community.jboss.org/message/633969#633969">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Greetings all.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I am currently using JBoss 6.1.0.Final</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I have several EARs each with their own WAR.  I am using the standard single sign on valve and form based authentication.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The intent is for the user to go to a WAR's URL, be redirected to a login page, and then be sent back to their original page.  I would like it if all the WAR's could share a login page.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Problem one occurs because I can not access a page outside of the war.  For example given these three domains</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>/main</p><p>/sub1</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The WAR associated with the /sub1 domain can not point to /main/login.jsp.  If I attempt it then I simply go to the page /sub1/main/login.jsp.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I have a attempted a simple redirect page in /sub1 pointing to the login page in /main.  The problem with that is that after authenticating the SSO Valve forwards you to the last page which was the redirect to the login page causing what would be a nasty loop but results in the error "Invalid direct reference to form login page"</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Is there any way to pass along the actual original request url?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>What are some solutions to this problem other than including the login fucntionality in every war?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I don't mind making custom valves or filters if necessary however, I have read about failed attempts to add a filter for j_security_check.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The only thing I have on the table right now is to extend the FormAuthenticator and add in the functionality to pass in an original url in a parameter but I would think that this is not an uncommon problem with a better solutions.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Any suggestions and/or advice welcome.</p><p><br/>Let me know if I need to provide more information or elaborate on anything.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks in advance.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/633969#633969">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2112">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>