Author: sohil.shah(a)jboss.com
Date: 2009-11-17 04:09:00 -0500 (Tue, 17 Nov 2009)
New Revision: 13835
Added:
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/WEB-INF/classes/
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/WEB-INF/classes/josso-agent-config.xml
jbossexo/modules/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/
jbossexo/modules/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java
jbossexo/modules/sso/trunk/agent/src/test/
jbossexo/modules/sso/trunk/agent/src/test/java/
jbossexo/modules/sso/trunk/agent/src/test/java/org/
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/cas/
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/cas/TestCASTicketValidation.java
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/josso/
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/josso/TestAssertionValidation.java
jbossexo/modules/sso/trunk/agent/src/test/resources/
jbossexo/modules/sso/trunk/agent/src/test/resources/josso-agent-config.xml
jbossexo/modules/sso/trunk/agent/src/test/resources/log4j.properties
Modified:
jbossexo/modules/sso/trunk/.classpath
jbossexo/modules/sso/trunk/agent/pom.xml
jbossexo/modules/sso/trunk/agent/src/main/config/cas/portal.war/groovy/portal/webui/UILoginForm.gtmpl
jbossexo/modules/sso/trunk/agent/src/main/config/cas/portal.war/login/jsp/login.jsp
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/groovy/portal/webui/UILoginForm.gtmpl
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/login/jsp/login.jsp
jbossexo/modules/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
jbossexo/modules/sso/trunk/gatein-cas-plugin/src/main/config/WEB-INF/deployerConfigContext.xml
jbossexo/modules/sso/trunk/pom.xml
Log:
GateIn SSO Agent
Modified: jbossexo/modules/sso/trunk/.classpath
===================================================================
--- jbossexo/modules/sso/trunk/.classpath 2009-11-16 07:11:36 UTC (rev 13834)
+++ jbossexo/modules/sso/trunk/.classpath 2009-11-17 09:09:00 UTC (rev 13835)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="agent/src/main/java"/>
+ <classpathentry kind="src" path="agent/src/test/java"/>
<classpathentry kind="src"
path="auth-callback/src/main/java"/>
<classpathentry kind="src"
path="auth-callback/src/test/java"/>
<classpathentry kind="src"
path="gatein-cas-plugin/src/main/java"/>
@@ -18,11 +19,17 @@
<classpathentry kind="var"
path="M2_REPO/picocontainer/picocontainer/1.1/picocontainer-1.1.jar"/>
<classpathentry kind="var"
path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
<classpathentry kind="var"
path="M2_REPO/opensso/amserver/8.0/amserver-8.0.jar"/>
- <classpathentry kind="var"
path="M2_REPO/opensso/opensso/8.0/opensso-8.0.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/josso/josso-basic-authscheme/1.8.1/josso-basic-authscheme-1.8.1.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/josso/josso-common/1.8.1/josso-common-1.8.1.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/josso/josso-core/1.8.1/josso-core-1.8.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/opensso/opensso/8.0/opensso-8.0.jar"/>
<classpathentry kind="var"
path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar"
sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jasig/cas/cas-client-core/3.1.9/cas-client-core-3.1.9.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/josso/josso-basic-authscheme/1.8.1/josso-basic-authscheme-1.8.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/josso/josso-agent/1.8.1/josso-agent-1.8.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/josso/josso-agent-shared/1.8.1/josso-agent-shared-1.8.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/josso/josso-common/1.8.1/josso-common-1.8.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/josso/josso-core/1.8.1/josso-core-1.8.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/josso/josso-protocol-client/1.8.1/josso-protocol-client-1.8.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/josso/josso-servlet-agent/1.8.1/josso-servlet-agent-1.8.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/josso/josso-ws/1.8.1/josso-ws-1.8.1.jar"/>
<classpathentry kind="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: jbossexo/modules/sso/trunk/agent/pom.xml
===================================================================
--- jbossexo/modules/sso/trunk/agent/pom.xml 2009-11-16 07:11:36 UTC (rev 13834)
+++ jbossexo/modules/sso/trunk/agent/pom.xml 2009-11-17 09:09:00 UTC (rev 13835)
@@ -30,9 +30,44 @@
<dependency>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.component.web</artifactId>
- </dependency>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jasig.cas</groupId>
+ <artifactId>cas-client-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-agent</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-servlet-agent</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-agent-shared</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-protocol-client</artifactId>
+ </dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<!-- profile for packaging and deploying this plugin into a cas server -->
<profiles>
@@ -90,7 +125,7 @@
<!-- Deploy the SSO Agent -->
<copy
file="${settings.localRepository}/org/gatein/sso/agent/${project.version}/agent-${project.version}.jar"
todir="${gatein.location}/deploy/gatein.ear/lib"
- overwrite="true"/>
+ overwrite="true"/>
</tasks>
</configuration>
<goals>
@@ -156,7 +191,33 @@
<!-- Deploy the SSO Agent -->
<copy
file="${settings.localRepository}/org/gatein/sso/agent/${project.version}/agent-${project.version}.jar"
todir="${gatein.location}/deploy/gatein.ear/lib"
- overwrite="true"/>
+ overwrite="true"/>
+
+
+ <!-- Deploy JOSSO Agent dependencies -->
+ <copy
file="${settings.localRepository}/org/josso/josso-agent/${version.josso}/josso-agent-${version.josso}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+
+ <copy
file="${settings.localRepository}/org/josso/josso-servlet-agent/${version.josso}/josso-servlet-agent-${version.josso}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+
+ <copy
file="${settings.localRepository}/org/josso/josso-agent-shared/${version.josso}/josso-agent-shared-${version.josso}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+
+ <copy
file="${settings.localRepository}/org/josso/josso-protocol-client/${version.josso}/josso-protocol-client-${version.josso}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+
+ <copy
file="${settings.localRepository}/org/josso/josso-common/${version.josso}/josso-common-${version.josso}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+
+ <copy
file="${settings.localRepository}/org/josso/josso-core/${version.josso}/josso-core-${version.josso}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
</tasks>
</configuration>
<goals>
Modified:
jbossexo/modules/sso/trunk/agent/src/main/config/cas/portal.war/groovy/portal/webui/UILoginForm.gtmpl
===================================================================
---
jbossexo/modules/sso/trunk/agent/src/main/config/cas/portal.war/groovy/portal/webui/UILoginForm.gtmpl 2009-11-16
07:11:36 UTC (rev 13834)
+++
jbossexo/modules/sso/trunk/agent/src/main/config/cas/portal.war/groovy/portal/webui/UILoginForm.gtmpl 2009-11-17
09:09:00 UTC (rev 13835)
@@ -83,5 +83,5 @@
</div>
<script>
<%=uicomponent.event("Close");%>
- window.location =
'http://localhost:8080/cas/login?service=http://localhost:1500/portal/private/classic';
+ window.location =
'http://localhost:8888/cas/login?service=http://localhost:8080/portal/private/classic';
</script>
Modified:
jbossexo/modules/sso/trunk/agent/src/main/config/cas/portal.war/login/jsp/login.jsp
===================================================================
---
jbossexo/modules/sso/trunk/agent/src/main/config/cas/portal.war/login/jsp/login.jsp 2009-11-16
07:11:36 UTC (rev 13834)
+++
jbossexo/modules/sso/trunk/agent/src/main/config/cas/portal.war/login/jsp/login.jsp 2009-11-17
09:09:00 UTC (rev 13835)
@@ -31,7 +31,7 @@
<html>
<head>
<script type="text/javascript">
- window.location =
'http://localhost:8080/cas/login?service=http://localhost:1500/portal/private/classic';
+ window.location =
'http://localhost:8888/cas/login?service=http://localhost:8080/portal/private/classic';
</script>
</head>
<body>
Added:
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/WEB-INF/classes/josso-agent-config.xml
===================================================================
---
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/WEB-INF/classes/josso-agent-config.xml
(rev 0)
+++
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/WEB-INF/classes/josso-agent-config.xml 2009-11-17
09:09:00 UTC (rev 13835)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<s:beans
xmlns:s="http://www.springframework.org/schema/beans"
+ xmlns:gen-svlt="urn:org:josso:agent:generic-servlet"
+ xmlns:agent="urn:org:josso:agent:core"
+ xmlns:protocol="urn:org:josso:protocol:client"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+<gen-svlt:agent name="josso-tomcat60-agent"
sessionAccessMinInterval="1000">
+
+
<gatewayLoginUrl>http://localhost:8888/josso/signon/login.do</gatewayLoginUrl>
+
<gatewayLogoutUrl>http://localhost:8888/josso/signon/logout.do</gatewayLogoutUrl>
+
+ <gatewayServiceLocator>
+ <protocol:ws-service-locator endpoint="localhost:8888"/>
+ </gatewayServiceLocator>
+ <configuration>
+ <agent:agent-configuration>
+ <agent:partner-apps>
+ <agent:partner-app id="portal"
context="/portal"/>
+ </agent:partner-apps>
+ </agent:agent-configuration>
+ </configuration>
+ <parametersBuilders>
+ <agent:vhost-parameters-builder/>
+ <agent:appctx-parameters-builder/>
+ </parametersBuilders>
+ </gen-svlt:agent>
+</s:beans>
\ No newline at end of file
Modified:
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/groovy/portal/webui/UILoginForm.gtmpl
===================================================================
---
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/groovy/portal/webui/UILoginForm.gtmpl 2009-11-16
07:11:36 UTC (rev 13834)
+++
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/groovy/portal/webui/UILoginForm.gtmpl 2009-11-17
09:09:00 UTC (rev 13835)
@@ -83,5 +83,5 @@
</div>
<script>
<%=uicomponent.event("Close");%>
- window.location =
'http://localhost:8080/josso/signon/login.do?josso_back_to=http://localhost:1500/portal/private/classic';
+ window.location =
'http://localhost:8888/josso/signon/login.do?josso_back_to=http://localhost:8080/portal/private/classic';
</script>
Modified:
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/login/jsp/login.jsp
===================================================================
---
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/login/jsp/login.jsp 2009-11-16
07:11:36 UTC (rev 13834)
+++
jbossexo/modules/sso/trunk/agent/src/main/config/josso/portal.war/login/jsp/login.jsp 2009-11-17
09:09:00 UTC (rev 13835)
@@ -31,7 +31,7 @@
<html>
<head>
<script type="text/javascript">
- window.location =
'http://localhost:8080/josso/signon/login.do?josso_back_to=http://localhost:1500/portal/private/classic';
+ window.location =
'http://localhost:8888/josso/signon/login.do?josso_back_to=http://localhost:8080/portal/private/classic';
</script>
</head>
<body>
Modified:
jbossexo/modules/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
===================================================================
---
jbossexo/modules/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2009-11-16
07:11:36 UTC (rev 13834)
+++
jbossexo/modules/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2009-11-17
09:09:00 UTC (rev 13835)
@@ -32,6 +32,8 @@
import org.exoplatform.web.login.InitiateLoginServlet;
import org.exoplatform.web.security.Credentials;
+import org.gatein.sso.agent.josso.JOSSOAgent;
+
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*/
@@ -46,9 +48,17 @@
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
- this.processSSOToken(req);
+ try
+ {
+ this.processSSOToken(req);
- super.doGet(req, resp);
+ super.doGet(req, resp);
+ }
+ catch(Exception e)
+ {
+ log.error(this, e);
+ throw new ServletException(e);
+ }
}
@Override
@@ -58,7 +68,7 @@
this.doGet(req, resp);
}
- private void processSSOToken(HttpServletRequest httpRequest)
+ private void processSSOToken(HttpServletRequest httpRequest) throws Exception
{
String ticket = httpRequest.getParameter("ticket");
String jossoAssertion = httpRequest.getParameter("josso_assertion_id");
@@ -74,6 +84,8 @@
Credentials credentials = new Credentials("root", jossoAssertion);
httpRequest.getSession().setAttribute(InitiateLoginServlet.CREDENTIALS,
credentials);
+
+ JOSSOAgent.test(httpRequest,jossoAssertion);
}
}
}
Added:
jbossexo/modules/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java
===================================================================
---
jbossexo/modules/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java
(rev 0)
+++
jbossexo/modules/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java 2009-11-17
09:09:00 UTC (rev 13835)
@@ -0,0 +1,59 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.gatein.sso.agent.josso;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.josso.agent.SSOAgent;
+import org.josso.agent.Lookup;
+import org.josso.agent.SSOAgentRequest;
+import org.josso.agent.SingleSignOnEntry;
+
+import org.josso.servlet.agent.GenericServletSSOAgentRequest;
+import org.josso.servlet.agent.GenericServletLocalSession;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class JOSSOAgent
+{
+ public static void test(HttpServletRequest httpRequest, String assertionId) throws
Exception
+ {
+ System.out.println("Starting simple josso assertion test
case..........................");
+
+ Lookup lookup = Lookup.getInstance();
+ lookup.init("josso-agent-config.xml");
+
+ SSOAgent agent = lookup.lookupSSOAgent();
+
+ System.out.println("Agent: "+agent);
+ System.out.println("AssertionId: "+assertionId);
+
+ SSOAgentRequest request = new
GenericServletSSOAgentRequest(SSOAgentRequest.ACTION_RELAY,
+ null,
+ new GenericServletLocalSession(httpRequest.getSession()),
+ assertionId);
+
+ SingleSignOnEntry result = agent.processRequest(request);
+ System.out.println("SSOEntry: "+result);
+ }
+}
Added:
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/cas/TestCASTicketValidation.java
===================================================================
---
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/cas/TestCASTicketValidation.java
(rev 0)
+++
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/cas/TestCASTicketValidation.java 2009-11-17
09:09:00 UTC (rev 13835)
@@ -0,0 +1,62 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.gatein.sso.agent.cas;
+
+import org.apache.log4j.Logger;
+
+import junit.framework.TestCase;
+
+import org.jasig.cas.client.validation.Cas20ProxyTicketValidator;
+import org.jasig.cas.client.validation.Assertion;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class TestCASTicketValidation extends TestCase
+{
+ private static Logger log = Logger.getLogger(TestCASTicketValidation.class);
+
+ protected static final String CONST_CAS_SERVER_URL =
"http://localhost:8080/cas";
+
+ protected void setUp() throws Exception
+ {
+
+ }
+
+ protected void tearDown() throws Exception
+ {
+
+ }
+
+ public void testSimpleTicket() throws Exception
+ {
+ log.info("Starting simple cas validation test
case..........................");
+
+ Cas20ProxyTicketValidator ticketValidator = new
Cas20ProxyTicketValidator(CONST_CAS_SERVER_URL);
+ ticketValidator.setRenew(true);
+ Assertion assertion =
ticketValidator.validate("ST-3-zm9wIaIGgoKZdb7vh0MU-cas",
"http://localhost:1500/portal/private/classic");
+
+
log.info("------------------------------------------------------------------------------------");
+ log.info("Principal: "+assertion.getPrincipal().getName());
+
log.info("------------------------------------------------------------------------------------");
+ }
+}
Added:
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/josso/TestAssertionValidation.java
===================================================================
---
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/josso/TestAssertionValidation.java
(rev 0)
+++
jbossexo/modules/sso/trunk/agent/src/test/java/org/gatein/sso/agent/josso/TestAssertionValidation.java 2009-11-17
09:09:00 UTC (rev 13835)
@@ -0,0 +1,76 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.gatein.sso.agent.josso;
+
+import org.apache.log4j.Logger;
+
+import junit.framework.TestCase;
+
+import org.josso.agent.SSOAgent;
+import org.josso.agent.Lookup;
+import org.josso.agent.SSOAgentRequest;
+import org.josso.agent.LocalSession;
+import org.josso.agent.SingleSignOnEntry;
+
+import org.josso.servlet.agent.GenericServletSSOAgentRequest;
+import org.josso.servlet.agent.GenericServletLocalSession;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class TestAssertionValidation extends TestCase
+{
+ private static Logger log = Logger.getLogger(TestAssertionValidation.class);
+
+
+ protected void setUp() throws Exception
+ {
+
+ }
+
+ protected void tearDown() throws Exception
+ {
+
+ }
+
+ public void testSimpleAssertion() throws Exception
+ {
+ log.info("Starting simple josso assertion test
case..........................");
+
+ Lookup lookup = Lookup.getInstance();
+ lookup.init("josso-agent-config.xml");
+
+ SSOAgent agent = lookup.lookupSSOAgent();
+
+ log.info("Agent: "+agent);
+
+ String assertionId = "";
+
+ SSOAgentRequest request = new
GenericServletSSOAgentRequest(SSOAgentRequest.ACTION_RELAY,
+ null,
+ new GenericServletLocalSession(null),
+ assertionId);
+
+ SingleSignOnEntry result = agent.processRequest(request);
+ log.info("SSO Info: "+result);
+ }
+}
Added: jbossexo/modules/sso/trunk/agent/src/test/resources/josso-agent-config.xml
===================================================================
--- jbossexo/modules/sso/trunk/agent/src/test/resources/josso-agent-config.xml
(rev 0)
+++ jbossexo/modules/sso/trunk/agent/src/test/resources/josso-agent-config.xml 2009-11-17
09:09:00 UTC (rev 13835)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ JOSSO: Java Open Single Sign-On
+ ~
+ ~ Copyright 2004-2009, Atricore, Inc.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ ~
+ -->
+
+<s:beans
xmlns:s="http://www.springframework.org/schema/beans"
+ xmlns:gen-svlt="urn:org:josso:agent:generic-servlet"
+ xmlns:agent="urn:org:josso:agent:core"
+ xmlns:protocol="urn:org:josso:protocol:client"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <gen-svlt:agent name="josso-svlt-agent"
sessionAccessMinInterval="1000" >
+
+
<gatewayLoginUrl>http://localhost:8080/josso/signon/login.do</gatewayLoginUrl>
+
<gatewayLogoutUrl>http://localhost:8080/josso/signon/logout.do</gatewayLogoutUrl>
+
+ <gatewayServiceLocator>
+ <protocol:ws-service-locator endpoint="localhost:8080" />
+ </gatewayServiceLocator>
+
+ <configuration>
+ <agent:agent-configuration>
+ <agent:partner-apps>
+ <agent:partner-app id="partnerapp"
context="/portal"/>
+ </agent:partner-apps>
+ </agent:agent-configuration>
+ </configuration>
+
+ <!--
+ <parametersBuilders>
+ <agent:vhost-parameters-builder/>
+ <agent:appctx-parameters-builder/>
+ </parametersBuilders>
+ -->
+ </gen-svlt:agent>
+
+
+
+</s:beans>
\ No newline at end of file
Added: jbossexo/modules/sso/trunk/agent/src/test/resources/log4j.properties
===================================================================
--- jbossexo/modules/sso/trunk/agent/src/test/resources/log4j.properties
(rev 0)
+++ jbossexo/modules/sso/trunk/agent/src/test/resources/log4j.properties 2009-11-17
09:09:00 UTC (rev 13835)
@@ -0,0 +1,8 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=INFO, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
Modified:
jbossexo/modules/sso/trunk/gatein-cas-plugin/src/main/config/WEB-INF/deployerConfigContext.xml
===================================================================
---
jbossexo/modules/sso/trunk/gatein-cas-plugin/src/main/config/WEB-INF/deployerConfigContext.xml 2009-11-16
07:11:36 UTC (rev 13834)
+++
jbossexo/modules/sso/trunk/gatein-cas-plugin/src/main/config/WEB-INF/deployerConfigContext.xml 2009-11-17
09:09:00 UTC (rev 13835)
@@ -98,7 +98,7 @@
-->
<bean class="org.gatein.sso.cas.plugin.AuthenticationPlugin">
<property
name="gateInHost"><value>localhost</value></property>
- <property
name="gateInPort"><value>1500</value></property>
+ <property
name="gateInPort"><value>8080</value></property>
<property
name="gateInContext"><value>portal</value></property>
</bean>
</list>
Modified: jbossexo/modules/sso/trunk/pom.xml
===================================================================
--- jbossexo/modules/sso/trunk/pom.xml 2009-11-16 07:11:36 UTC (rev 13834)
+++ jbossexo/modules/sso/trunk/pom.xml 2009-11-17 09:09:00 UTC (rev 13835)
@@ -41,6 +41,7 @@
<!-- cas -->
<version.cas>3.3.4</version.cas>
+ <version.cas.client>3.1.9</version.cas.client>
<!-- josso -->
<version.josso>1.8.1</version.josso>
@@ -78,6 +79,11 @@
<artifactId>cas-server-core</artifactId>
<version>${version.cas}</version>
</dependency>
+ <dependency>
+ <groupId>org.jasig.cas</groupId>
+ <artifactId>cas-client-core</artifactId>
+ <version>${version.cas.client}</version>
+ </dependency>
<!-- opensso -->
<dependency>
@@ -102,6 +108,31 @@
<artifactId>josso-basic-authscheme</artifactId>
<version>${version.josso}</version>
</dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-agent</artifactId>
+ <version>${version.josso}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-agent-shared</artifactId>
+ <version>${version.josso}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-servlet-agent</artifactId>
+ <version>${version.josso}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-protocol-client</artifactId>
+ <version>${version.josso}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-common</artifactId>
+ <version>${version.josso}</version>
+ </dependency>
<dependency>
<groupId>org.apache.xbean</groupId>