Author: sohil.shah(a)jboss.com
Date: 2010-04-13 17:24:07 -0400 (Tue, 13 Apr 2010)
New Revision: 2611
Modified:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
Log:
GTNPORTAL-1027 - GateIn+SSO integration: Blank screen when SSO ticket is not valid
(OpenSSO)
Modified:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
===================================================================
---
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2010-04-13
21:12:40 UTC (rev 2610)
+++
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2010-04-13
21:24:07 UTC (rev 2611)
@@ -70,7 +70,16 @@
{
try
{
- this.processSSOToken(req,resp);
+ this.processSSOToken(req,resp);
+
+ String portalContext = req.getContextPath();
+ if(req.getAttribute("abort") != null)
+ {
+ String ssoRedirect = portalContext + "/sso";
+ resp.sendRedirect(ssoRedirect);
+ return;
+ }
+
super.doGet(req, resp);
}
catch(Exception e)
@@ -105,8 +114,16 @@
}
else
{
- //See if an OpenSSO Token was used
- OpenSSOAgent.getInstance(this.ssoServerUrl,
this.ssoCookieName).validateTicket(httpRequest);
+ try
+ {
+ //See if an OpenSSO Token was used
+ OpenSSOAgent.getInstance(this.ssoServerUrl,
this.ssoCookieName).validateTicket(httpRequest);
+ }
+ catch(IllegalStateException ilse)
+ {
+ //somehow cookie failed validation, retry by starting the opensso login process
again
+ httpRequest.setAttribute("abort", Boolean.TRUE);
+ }
}
}
}
Show replies by date