JBoss Community

Multiple Wars Sharing a Login Page

created by James C in JBoss Web Development - View the full discussion

Greetings all.

 

I am currently using JBoss 6.1.0.Final

 

I have several EARs each with their own WAR.  I am using the standard single sign on valve and form based authentication.

 

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.

 

Problem one occurs because I can not access a page outside of the war.  For example given these three domains

 

/main

/sub1

 

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.

 

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"

 

Is there any way to pass along the actual original request url?

 

What are some solutions to this problem other than including the login fucntionality in every war?

 

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.

 

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.

 

Any suggestions and/or advice welcome.


Let me know if I need to provide more information or elaborate on anything.

 

Thanks in advance.

Reply to this message by going to Community

Start a new discussion in JBoss Web Development at Community