Author: sohil.shah(a)jboss.com
Date: 2010-04-13 16:06:54 -0400 (Tue, 13 Apr 2010)
New Revision: 2609
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/cas/CASAgent.java
Log:
GTNPORTAL-1046 - GateIn and secure CAS integration: problem with renew parameter
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
19:09:59 UTC (rev 2608)
+++
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2010-04-13
20:06:54 UTC (rev 2609)
@@ -46,6 +46,7 @@
private String ssoServerUrl;
private String ssoCookieName;
+ private boolean casRenewTicket;
@Override
@@ -55,6 +56,12 @@
this.ssoServerUrl =
this.getServletConfig().getInitParameter("ssoServerUrl");
this.ssoCookieName =
this.getServletConfig().getInitParameter("ssoCookieName");
+
+ String casRenewTicketConfig =
this.getServletConfig().getInitParameter("casRenewTicket");
+ if(casRenewTicketConfig != null)
+ {
+ this.casRenewTicket = Boolean.parseBoolean(casRenewTicketConfig);
+ }
}
@Override
@@ -87,7 +94,9 @@
if (ticket != null && ticket.trim().length() > 0)
{
- CASAgent.getInstance(this.ssoServerUrl).validateTicket(httpRequest, ticket);
+ CASAgent casagent = CASAgent.getInstance(this.ssoServerUrl);
+ casagent.setRenewTicket(this.casRenewTicket);
+ casagent.validateTicket(httpRequest, ticket);
}
else if (jossoAssertion != null && jossoAssertion.trim().length() > 0)
{
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/cas/CASAgent.java
===================================================================
---
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/cas/CASAgent.java 2010-04-13
19:09:59 UTC (rev 2608)
+++
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/cas/CASAgent.java 2010-04-13
20:06:54 UTC (rev 2609)
@@ -41,6 +41,7 @@
private static CASAgent singleton;
private String casServerUrl;
+ private boolean renewTicket;
private CASAgent(String casServerUrl)
{
@@ -62,10 +63,21 @@
return CASAgent.singleton;
}
+
+ public boolean isRenewTicket()
+ {
+ return renewTicket;
+ }
+
+ public void setRenewTicket(boolean renewTicket)
+ {
+ this.renewTicket = renewTicket;
+ }
+
public void validateTicket(HttpServletRequest httpRequest, String ticket) throws
Exception
{
Cas20ProxyTicketValidator ticketValidator = new
Cas20ProxyTicketValidator(casServerUrl);
- ticketValidator.setRenew(true);
+ ticketValidator.setRenew(this.renewTicket);
String serviceUrl = "http://"+ httpRequest.getServerName() +":" +
httpRequest.getServerPort() +
httpRequest.getContextPath() +"/private/classic";