Author: sohil.shah(a)jboss.com
Date: 2009-11-13 14:16:04 -0500 (Fri, 13 Nov 2009)
New Revision: 13814
Added:
jbossexo/modules/sso/trunk/
jbossexo/modules/sso/trunk/.classpath
jbossexo/modules/sso/trunk/.project
jbossexo/modules/sso/trunk/auth-callback/
jbossexo/modules/sso/trunk/auth-callback/.classpath
jbossexo/modules/sso/trunk/auth-callback/.project
jbossexo/modules/sso/trunk/auth-callback/pom.xml
jbossexo/modules/sso/trunk/auth-callback/src/
jbossexo/modules/sso/trunk/auth-callback/src/main/
jbossexo/modules/sso/trunk/auth-callback/src/main/java/
jbossexo/modules/sso/trunk/auth-callback/src/main/java/org/
jbossexo/modules/sso/trunk/auth-callback/src/main/java/org/gatein/
jbossexo/modules/sso/trunk/auth-callback/src/main/java/org/gatein/sso/
jbossexo/modules/sso/trunk/auth-callback/src/main/java/org/gatein/sso/authentication/
jbossexo/modules/sso/trunk/auth-callback/src/main/java/org/gatein/sso/authentication/callback/
jbossexo/modules/sso/trunk/auth-callback/src/main/java/org/gatein/sso/authentication/callback/AuthenticationHandler.java
jbossexo/modules/sso/trunk/auth-callback/src/main/resources/
jbossexo/modules/sso/trunk/auth-callback/src/main/resources/conf/
jbossexo/modules/sso/trunk/auth-callback/src/main/resources/conf/portal/
jbossexo/modules/sso/trunk/auth-callback/src/main/resources/conf/portal/configuration.xml
jbossexo/modules/sso/trunk/auth-callback/src/test/
jbossexo/modules/sso/trunk/auth-callback/src/test/java/
jbossexo/modules/sso/trunk/auth-callback/src/test/resources/
jbossexo/modules/sso/trunk/bin/
jbossexo/modules/sso/trunk/bin/org/
jbossexo/modules/sso/trunk/bin/org/gatein/
jbossexo/modules/sso/trunk/bin/org/gatein/sso/
jbossexo/modules/sso/trunk/bin/org/gatein/sso/authentication/
jbossexo/modules/sso/trunk/bin/org/gatein/sso/authentication/callback/
jbossexo/modules/sso/trunk/bin/org/gatein/sso/authentication/callback/AuthenticationHandler.class
jbossexo/modules/sso/trunk/bin/org/gatein/sso/cas/
jbossexo/modules/sso/trunk/bin/org/gatein/sso/cas/server/
jbossexo/modules/sso/trunk/bin/org/gatein/sso/cas/server/AuthenticationPlugin.class
jbossexo/modules/sso/trunk/bin/org/gatein/sso/cas/server/TestAuthenticationPlugin.class
jbossexo/modules/sso/trunk/gatein-cas/
jbossexo/modules/sso/trunk/gatein-cas/.classpath
jbossexo/modules/sso/trunk/gatein-cas/.project
jbossexo/modules/sso/trunk/gatein-cas/.settings/
jbossexo/modules/sso/trunk/gatein-cas/.settings/org.eclipse.jdt.core.prefs
jbossexo/modules/sso/trunk/gatein-cas/pom.xml
jbossexo/modules/sso/trunk/gatein-cas/src/
jbossexo/modules/sso/trunk/gatein-cas/src/main/
jbossexo/modules/sso/trunk/gatein-cas/src/main/config/
jbossexo/modules/sso/trunk/gatein-cas/src/main/config/deployerConfigContext.xml
jbossexo/modules/sso/trunk/gatein-cas/src/main/java/
jbossexo/modules/sso/trunk/gatein-cas/src/main/java/org/
jbossexo/modules/sso/trunk/gatein-cas/src/main/java/org/gatein/
jbossexo/modules/sso/trunk/gatein-cas/src/main/java/org/gatein/sso/
jbossexo/modules/sso/trunk/gatein-cas/src/main/java/org/gatein/sso/cas/
jbossexo/modules/sso/trunk/gatein-cas/src/main/java/org/gatein/sso/cas/server/
jbossexo/modules/sso/trunk/gatein-cas/src/main/java/org/gatein/sso/cas/server/AuthenticationPlugin.java
jbossexo/modules/sso/trunk/gatein-cas/src/main/resources/
jbossexo/modules/sso/trunk/gatein-cas/src/main/resources/log4j.properties
jbossexo/modules/sso/trunk/gatein-cas/src/test/
jbossexo/modules/sso/trunk/gatein-cas/src/test/java/
jbossexo/modules/sso/trunk/gatein-cas/src/test/java/org/
jbossexo/modules/sso/trunk/gatein-cas/src/test/java/org/gatein/
jbossexo/modules/sso/trunk/gatein-cas/src/test/java/org/gatein/sso/
jbossexo/modules/sso/trunk/gatein-cas/src/test/java/org/gatein/sso/cas/
jbossexo/modules/sso/trunk/gatein-cas/src/test/java/org/gatein/sso/cas/server/
jbossexo/modules/sso/trunk/gatein-cas/src/test/java/org/gatein/sso/cas/server/TestAuthenticationPlugin.java
jbossexo/modules/sso/trunk/gatein-cas/src/test/resources/
jbossexo/modules/sso/trunk/pom.xml
Log:
sso component
Added: jbossexo/modules/sso/trunk/.classpath
===================================================================
--- jbossexo/modules/sso/trunk/.classpath (rev 0)
+++ jbossexo/modules/sso/trunk/.classpath 2009-11-13 19:16:04 UTC (rev 13814)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src"
path="auth-callback/src/main/java"/>
+ <classpathentry kind="src"
path="auth-callback/src/test/java"/>
+ <classpathentry kind="src" path="gatein-cas/src/main/java"/>
+ <classpathentry kind="src" path="gatein-cas/src/test/java"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jasig/cas/cas-server-core/3.3.4/cas-server-core-3.3.4.jar"
sourcepath="M2_REPO/org/jasig/cas/cas-server-core/3.3.4/cas-server-core-3.3.4-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar"
sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/exoplatform/ws/exo.ws.rest.core/2.1.0-Beta02/exo.ws.rest.core-2.1.0-Beta02.jar"
sourcepath="M2_REPO/org/exoplatform/ws/exo.ws.rest.core/2.1.0-Beta02/exo.ws.rest.core-2.1.0-Beta02-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0.jar"
sourcepath="M2_REPO/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: jbossexo/modules/sso/trunk/.project
===================================================================
--- jbossexo/modules/sso/trunk/.project (rev 0)
+++ jbossexo/modules/sso/trunk/.project 2009-11-13 19:16:04 UTC (rev 13814)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>gatein-sso-trunk</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: jbossexo/modules/sso/trunk/auth-callback/.classpath
===================================================================
--- jbossexo/modules/sso/trunk/auth-callback/.classpath (rev 0)
+++ jbossexo/modules/sso/trunk/auth-callback/.classpath 2009-11-13 19:16:04 UTC (rev
13814)
@@ -0,0 +1,51 @@
+<classpath>
+ <classpathentry kind="src" path="src/test/java"
output="target/test-classes" including="**/*.java"/>
+ <classpathentry kind="src" path="src/test/resources"
output="target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/main/java"
including="**/*.java"/>
+ <classpathentry kind="src" path="src/main/resources"
excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar"
sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar"
sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/faces/jsf-api/1.2/jsf-api-1.2.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0.jar"
sourcepath="M2_REPO/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/mail/mail/1.4/mail-1.4.jar"
sourcepath="M2_REPO/javax/mail/mail/1.4/mail-1.4-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/portlet/portlet-api/2.0/portlet-api-2.0.jar"
sourcepath="M2_REPO/javax/portlet/portlet-api/2.0/portlet-api-2.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"
sourcepath="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar"
sourcepath="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/bcel/bcel/5.1/bcel-5.1.jar"
sourcepath="M2_REPO/bcel/bcel/5.1/bcel-5.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/objectweb/carol/carol/2.0.5/carol-2.0.5.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-beanutils/commons-beanutils/1.6/commons-beanutils-1.6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-collections/commons-collections/2.0/commons-collections-2.0.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-fileupload/commons-fileupload/1.0/commons-fileupload-1.0.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar"
sourcepath="M2_REPO/commons-io/commons-io/1.3.2/commons-io-1.3.2-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar"
sourcepath="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/exoplatform/core/exo.core.component.xml-processing/2.3.0-Beta02/exo.core.component.xml-processing-2.3.0-Beta02.jar"
sourcepath="M2_REPO/org/exoplatform/core/exo.core.component.xml-processing/2.3.0-Beta02/exo.core.component.xml-processing-2.3.0-Beta02-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/exoplatform/kernel/exo.kernel.commons/2.2.0-Beta02/exo.kernel.commons-2.2.0-Beta02.jar"
sourcepath="M2_REPO/org/exoplatform/kernel/exo.kernel.commons/2.2.0-Beta02/exo.kernel.commons-2.2.0-Beta02-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/exoplatform/kernel/exo.kernel.component.common/2.2.0-Beta02/exo.kernel.component.common-2.2.0-Beta02.jar"
sourcepath="M2_REPO/org/exoplatform/kernel/exo.kernel.component.common/2.2.0-Beta02/exo.kernel.component.common-2.2.0-Beta02-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/exoplatform/kernel/exo.kernel.container/2.2.0-Beta02/exo.kernel.container-2.2.0-Beta02.jar"
sourcepath="M2_REPO/org/exoplatform/kernel/exo.kernel.container/2.2.0-Beta02/exo.kernel.container-2.2.0-Beta02-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/exoplatform/tool/exo.tool.framework.junit/1.2.0/exo.tool.framework.junit-1.2.0.jar"
sourcepath="M2_REPO/org/exoplatform/tool/exo.tool.framework.junit/1.2.0/exo.tool.framework.junit-1.2.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/exoplatform/ws/exo.ws.frameworks.json/2.1.0-Beta02/exo.ws.frameworks.json-2.1.0-Beta02.jar"
sourcepath="M2_REPO/org/exoplatform/ws/exo.ws.frameworks.json/2.1.0-Beta02/exo.ws.frameworks.json-2.1.0-Beta02-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/exoplatform/ws/exo.ws.rest.core/2.1.0-Beta02/exo.ws.rest.core-2.1.0-Beta02.jar"
sourcepath="M2_REPO/org/exoplatform/ws/exo.ws.rest.core/2.1.0-Beta02/exo.ws.rest.core-2.1.0-Beta02-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/howl/howl-logger/0.1.11/howl-logger-0.1.11.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.7/jaxb-impl-2.1.7.jar"
sourcepath="M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.7/jaxb-impl-2.1.7-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jibx/jibx-bind/1.2.1/jibx-bind-1.2.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jibx/jibx-extras/1.2.1/jibx-extras-1.2.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jibx/jibx-run/1.2.1/jibx-run-1.2.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/jmock/jmock/1.0.1/jmock-1.0.1.jar"
sourcepath="M2_REPO/jmock/jmock/1.0.1/jmock-1.0.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/jotm/jotm/2.0.10/jotm-2.0.10.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/jotm/jotm_jrmp_stubs/2.0.10/jotm_jrmp_stubs-2.0.10.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar"
sourcepath="M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/junit/junit/3.8.2/junit-3.8.2.jar"
sourcepath="M2_REPO/junit/junit/3.8.2/junit-3.8.2-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar"
sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar"
sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/picocontainer/picocontainer/1.1/picocontainer-1.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/quartz/quartz/1.5.0-RC2/quartz-1.5.0-RC2.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.jar"
sourcepath="M2_REPO/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/slf4j/slf4j-log4j12/1.5.6/slf4j-log4j12-1.5.6.jar"
sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.5.6/slf4j-log4j12-1.5.6-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/xml-resolver/xml-resolver/1.1/xml-resolver-1.1.jar"
sourcepath="M2_REPO/xml-resolver/xml-resolver/1.1/xml-resolver-1.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar"
sourcepath="M2_REPO/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/xstream/xstream/1.0.2/xstream-1.0.2.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file
Added: jbossexo/modules/sso/trunk/auth-callback/.project
===================================================================
--- jbossexo/modules/sso/trunk/auth-callback/.project (rev 0)
+++ jbossexo/modules/sso/trunk/auth-callback/.project 2009-11-13 19:16:04 UTC (rev 13814)
@@ -0,0 +1,13 @@
+<projectDescription>
+ <name>auth-callback</name>
+ <comment>Gatein Single Sign On Integration</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: jbossexo/modules/sso/trunk/auth-callback/pom.xml
===================================================================
--- jbossexo/modules/sso/trunk/auth-callback/pom.xml (rev 0)
+++ jbossexo/modules/sso/trunk/auth-callback/pom.xml 2009-11-13 19:16:04 UTC (rev 13814)
@@ -0,0 +1,30 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.gatein.sso</groupId>
+ <artifactId>gatein-sso-parent</artifactId>
+ <relativePath>../pom.xml</relativePath>
+ <version>trunk-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>auth-callback</artifactId>
+ <packaging>jar</packaging>
+ <name>A RESTful call back service used by SSO servers to perform authentication
against the Gatein instance</name>
+
+ <properties>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.rest.core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ </dependency>
+ </dependencies>
+</project>
+
Added:
jbossexo/modules/sso/trunk/auth-callback/src/main/java/org/gatein/sso/authentication/callback/AuthenticationHandler.java
===================================================================
---
jbossexo/modules/sso/trunk/auth-callback/src/main/java/org/gatein/sso/authentication/callback/AuthenticationHandler.java
(rev 0)
+++
jbossexo/modules/sso/trunk/auth-callback/src/main/java/org/gatein/sso/authentication/callback/AuthenticationHandler.java 2009-11-13
19:16:04 UTC (rev 13814)
@@ -0,0 +1,64 @@
+/*
+* 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.authentication.callback;
+
+import org.apache.log4j.Logger;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.exoplatform.services.rest.resource.ResourceContainer;
+
+/**
+ * This is a RESTful component that is invoked by central SSO servers like CAS server,
JOSSO server etc, to invoke
+ * Gatein authentication related queries during their own "Authentication
process"
+ *
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+@Path("/sso/authcallback")
+public class AuthenticationHandler implements ResourceContainer
+{
+ private static Logger log = Logger.getLogger(AuthenticationHandler.class);
+
+ @GET
+ @Path("/auth/{1}/{2}")
+ @Produces(
+ {MediaType.TEXT_PLAIN})
+ public String authenticate(@PathParam("1") String username,
@PathParam("2") String password)
+ {
+ log.info("---------------------------------------");
+ log.info("Username="+username);
+ log.info("Password="+password);
+ log.info("---------------------------------------");
+
+ if(username.equals("root") && password.equals("gtn"))
+ {
+ return ""+Boolean.TRUE;
+ }
+
+ return ""+Boolean.FALSE;
+ }
+}
Added:
jbossexo/modules/sso/trunk/auth-callback/src/main/resources/conf/portal/configuration.xml
===================================================================
---
jbossexo/modules/sso/trunk/auth-callback/src/main/resources/conf/portal/configuration.xml
(rev 0)
+++
jbossexo/modules/sso/trunk/auth-callback/src/main/resources/conf/portal/configuration.xml 2009-11-13
19:16:04 UTC (rev 13814)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <type>org.gatein.sso.authentication.callback.AuthenticationHandler</type>
+ </component>
+</configuration>
\ No newline at end of file
Added:
jbossexo/modules/sso/trunk/bin/org/gatein/sso/authentication/callback/AuthenticationHandler.class
===================================================================
(Binary files differ)
Property changes on:
jbossexo/modules/sso/trunk/bin/org/gatein/sso/authentication/callback/AuthenticationHandler.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
jbossexo/modules/sso/trunk/bin/org/gatein/sso/cas/server/AuthenticationPlugin.class
===================================================================
(Binary files differ)
Property changes on:
jbossexo/modules/sso/trunk/bin/org/gatein/sso/cas/server/AuthenticationPlugin.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
jbossexo/modules/sso/trunk/bin/org/gatein/sso/cas/server/TestAuthenticationPlugin.class
===================================================================
(Binary files differ)
Property changes on:
jbossexo/modules/sso/trunk/bin/org/gatein/sso/cas/server/TestAuthenticationPlugin.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbossexo/modules/sso/trunk/gatein-cas/.classpath
===================================================================
--- jbossexo/modules/sso/trunk/gatein-cas/.classpath (rev 0)
+++ jbossexo/modules/sso/trunk/gatein-cas/.classpath 2009-11-13 19:16:04 UTC (rev 13814)
@@ -0,0 +1,59 @@
+<classpath>
+ <classpathentry kind="src" path="src/test/java"
output="target/test-classes" including="**/*.java"/>
+ <classpathentry kind="src" path="src/test/resources"
output="target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/main/java"
including="**/*.java"/>
+ <classpathentry kind="src" path="src/main/resources"
excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar"
sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar"
sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"
sourcepath="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar"
sourcepath="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/xml/xmldsig/1.0/xmldsig-1.0.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"
sourcepath="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar"
sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/asm/asm/1.5.3/asm-1.5.3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jasig/cas/cas-server-core/3.3.4/cas-server-core-3.3.4.jar"
sourcepath="M2_REPO/org/jasig/cas/cas-server-core/3.3.4/cas-server-core-3.3.4-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/cglib/cglib/2.1_3/cglib-2.1_3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.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/commons-lang/commons-lang/2.2/commons-lang-2.2.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"
sourcepath="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"
sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/hibernate/ejb3-persistence/1.0.1.GA/ejb3-persistence-1.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/hibernate/hibernate-annotations/3.3.1.GA/hibernate-annotations-3.3.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/hibernate/hibernate-commons-annotations/3.0.0.ga/hibernate-commons-annotations-3.0.0.ga.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/inspektr/inspektr-core/0.7.0/inspektr-core-0.7.0.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/jaxen/jaxen/1.1-beta-6/jaxen-1.1-beta-6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/jaxme/jaxme-api/0.3/jaxme-api-0.3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/jdom/jdom/1.0/jdom-1.0.jar"
sourcepath="M2_REPO/jdom/jdom/1.0/jdom-1.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"
sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar"
sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/ognl/ognl/2.6.9/ognl-2.6.9.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/opensaml/opensaml/1.1b/opensaml-1.1b.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jasig/service/person-directory-api/1.5.0-RC5/person-directory-api-1.5.0-RC5.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jasig/service/person-directory-impl/1.5.0-RC5/person-directory-impl-1.5.0-RC5.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/pull-parser/pull-parser/2/pull-parser-2.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/msv/relaxngDatatype/20030807/relaxngDatatype-20030807.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/springframework/spring-beans/2.5.6/spring-beans-2.5.6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/springframework/spring-binding/1.0.5/spring-binding-1.0.5.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/springframework/spring-context/2.5.6/spring-context-2.5.6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/springframework/spring-context-support/2.5.6/spring-context-support-2.5.6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/springframework/spring-core/2.5.6/spring-core-2.5.6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/springframework/spring-orm/2.5.6/spring-orm-2.5.6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/springframework/spring-tx/2.5.6/spring-tx-2.5.6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/springframework/spring-web/2.5.6/spring-web-2.5.6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/springframework/spring-webflow/1.0.5/spring-webflow-1.0.5.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/springframework/spring-webmvc/2.5.6/spring-webmvc-2.5.6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/apache/santuario/xmlsec/1.4.0/xmlsec-1.4.0.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/xpp3/xpp3/1.1.3.3/xpp3-1.1.3.3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/msv/xsdlib/20030807/xsdlib-20030807.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file
Added: jbossexo/modules/sso/trunk/gatein-cas/.project
===================================================================
--- jbossexo/modules/sso/trunk/gatein-cas/.project (rev 0)
+++ jbossexo/modules/sso/trunk/gatein-cas/.project 2009-11-13 19:16:04 UTC (rev 13814)
@@ -0,0 +1,13 @@
+<projectDescription>
+ <name>gatein-cas</name>
+ <comment>Gatein Single Sign On Integration</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: jbossexo/modules/sso/trunk/gatein-cas/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- jbossexo/modules/sso/trunk/gatein-cas/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++ jbossexo/modules/sso/trunk/gatein-cas/.settings/org.eclipse.jdt.core.prefs 2009-11-13
19:16:04 UTC (rev 13814)
@@ -0,0 +1,5 @@
+#Fri Nov 13 12:35:24 CST 2009
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: jbossexo/modules/sso/trunk/gatein-cas/pom.xml
===================================================================
--- jbossexo/modules/sso/trunk/gatein-cas/pom.xml (rev 0)
+++ jbossexo/modules/sso/trunk/gatein-cas/pom.xml 2009-11-13 19:16:04 UTC (rev 13814)
@@ -0,0 +1,42 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.gatein.sso</groupId>
+ <artifactId>gatein-sso-parent</artifactId>
+ <relativePath>../pom.xml</relativePath>
+ <version>trunk-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>gatein-cas</artifactId>
+ <packaging>jar</packaging>
+ <name>Gatein Integration for CAS Single Sign On Framework</name>
+
+ <properties>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jasig.cas</groupId>
+ <artifactId>cas-server-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: jbossexo/modules/sso/trunk/gatein-cas/src/main/config/deployerConfigContext.xml
===================================================================
--- jbossexo/modules/sso/trunk/gatein-cas/src/main/config/deployerConfigContext.xml
(rev 0)
+++
jbossexo/modules/sso/trunk/gatein-cas/src/main/config/deployerConfigContext.xml 2009-11-13
19:16:04 UTC (rev 13814)
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ | deployerConfigContext.xml centralizes into one file some of the declarative
configuration that
+ | all CAS deployers will need to modify.
+ |
+ | This file declares some of the Spring-managed JavaBeans that make up a CAS deployment.
+ | The beans declared in this file are instantiated at context initialization time by the
Spring
+ | ContextLoaderListener declared in web.xml. It finds this file because this
+ | file is among those declared in the context parameter
"contextConfigLocation".
+ |
+ | By far the most common change you will need to make in this file is to change the last
bean
+ | declaration to replace the default SimpleTestUsernamePasswordAuthenticationHandler
with
+ | one implementing your approach for authenticating usernames and passwords.
+ +-->
+<beans
xmlns="http://www.springframework.org/schema/beans"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:p="http://www.springframework.org/schema/p"
+
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+ <!--
+ | This bean declares our AuthenticationManager. The CentralAuthenticationService
service bean
+ | declared in applicationContext.xml picks up this AuthenticationManager by reference
to its id,
+ | "authenticationManager". Most deployers will be able to use the default
AuthenticationManager
+ | implementation and so do not need to change the class of this bean. We include the
whole
+ | AuthenticationManager here in the userConfigContext.xml so that you can see the
things you will
+ | need to change in context.
+ +-->
+ <bean id="authenticationManager"
+ class="org.jasig.cas.authentication.AuthenticationManagerImpl">
+ <!--
+ | This is the List of CredentialToPrincipalResolvers that identify what Principal is
trying to authenticate.
+ | The AuthenticationManagerImpl considers them in order, finding a
CredentialToPrincipalResolver which
+ | supports the presented credentials.
+ |
+ | AuthenticationManagerImpl uses these resolvers for two purposes. First, it uses
them to identify the Principal
+ | attempting to authenticate to CAS /login . In the default configuration, it is the
DefaultCredentialsToPrincipalResolver
+ | that fills this role. If you are using some other kind of credentials than
UsernamePasswordCredentials, you will need to replace
+ | DefaultCredentialsToPrincipalResolver with a CredentialsToPrincipalResolver that
supports the credentials you are
+ | using.
+ |
+ | Second, AuthenticationManagerImpl uses these resolvers to identify a service
requesting a proxy granting ticket.
+ | In the default configuration, it is the
HttpBasedServiceCredentialsToPrincipalResolver that serves this purpose.
+ | You will need to change this list if you are identifying services by something more
or other than their callback URL.
+ +-->
+ <property name="credentialsToPrincipalResolvers">
+ <list>
+ <!--
+ | UsernamePasswordCredentialsToPrincipalResolver supports the
UsernamePasswordCredentials that we use for /login
+ | by default and produces SimplePrincipal instances conveying the username from the
credentials.
+ |
+ | If you've changed your LoginFormAction to use credentials other than
UsernamePasswordCredentials then you will also
+ | need to change this bean declaration (or add additional declarations) to declare a
CredentialsToPrincipalResolver that supports the
+ | Credentials you are using.
+ +-->
+ <bean
+ class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver"
/>
+ <!--
+ | HttpBasedServiceCredentialsToPrincipalResolver supports HttpBasedCredentials. It
supports the CAS 2.0 approach of
+ | authenticating services by SSL callback, extracting the callback URL from the
Credentials and representing it as a
+ | SimpleService identified by that callback URL.
+ |
+ | If you are representing services by something more or other than an HTTPS URL
whereat they are able to
+ | receive a proxy callback, you will need to change this bean declaration (or add
additional declarations).
+ +-->
+ <bean
+ class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver"
/>
+ </list>
+ </property>
+
+ <!--
+ | Whereas CredentialsToPrincipalResolvers identify who it is some Credentials might
authenticate,
+ | AuthenticationHandlers actually authenticate credentials. Here we declare the
AuthenticationHandlers that
+ | authenticate the Principals that the CredentialsToPrincipalResolvers identified.
CAS will try these handlers in turn
+ | until it finds one that both supports the Credentials presented and succeeds in
authenticating.
+ +-->
+ <property name="authenticationHandlers">
+ <list>
+ <!--
+ | This is the authentication handler that authenticates services by means of
callback via SSL, thereby validating
+ | a server side SSL certificate.
+ +-->
+ <bean
class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
+ p:httpClient-ref="httpClient" />
+ <!--
+ | This is the authentication handler declaration that every CAS deployer will need
to change before deploying CAS
+ | into production. The default SimpleTestUsernamePasswordAuthenticationHandler
authenticates UsernamePasswordCredentials
+ | where the username equals the password. You will need to replace this with an
AuthenticationHandler that implements your
+ | local authentication strategy. You might accomplish this by coding a new such
handler and declaring
+ | edu.someschool.its.cas.MySpecialHandler here, or you might use one of the handlers
provided in the adaptors modules.
+ +-->
+
+ <!--
+ <bean
class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler"
/>
+ -->
+ <!-- Integrates with the Gatein Authentication Service to perform
authentication -->
+ <bean class="org.gatein.sso.cas.server.AuthenticationPlugin">
+ <property
name="gateInHost"><value>localhost</value></property>
+ <property
name="gateInPort"><value>1500</value></property>
+ <property
name="gateInContext"><value>portal</value></property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+
+
+ <!--
+ This bean defines the security roles for the Services Management application. Simple
deployments can use the in-memory version.
+ More robust deployments will want to use another option, such as the Jdbc version.
+
+ The name of this should remain "userDetailsService" in order for Acegi to find
it.
+
+ To use this, you should add an entry similar to the following between the two value
tags:
+ battags=notused,ROLE_ADMIN
+
+ where battags is the username you want to grant access to. You can put one entry per
line.
+ -->
+ <bean id="userDetailsService"
class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
+ <property name="userMap">
+ <value>
+
+ </value>
+ </property>
+ </bean>
+
+ <!--
+ Bean that defines the attributes that a service may return. This example uses the
Stub/Mock version. A real implementation
+ may go against a database or LDAP server. The id should remain
"attributeRepository" though.
+ -->
+ <bean id="attributeRepository"
+ class="org.jasig.services.persondir.support.StubPersonAttributeDao">
+ <property name="backingMap">
+ <map>
+ <entry key="uid" value="uid" />
+ <entry key="eduPersonAffiliation" value="eduPersonAffiliation"
/>
+ <entry key="groupMembership" value="groupMembership" />
+ </map>
+ </property>
+ </bean>
+
+ <!--
+ Sample, in-memory data store for the ServiceRegistry. A real implementation
+ would probably want to replace this with the JPA-backed ServiceRegistry DAO
+ The name of this bean should remain "serviceRegistryDao".
+ -->
+ <bean
+ id="serviceRegistryDao"
+ class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl" />
+</beans>
Added:
jbossexo/modules/sso/trunk/gatein-cas/src/main/java/org/gatein/sso/cas/server/AuthenticationPlugin.java
===================================================================
---
jbossexo/modules/sso/trunk/gatein-cas/src/main/java/org/gatein/sso/cas/server/AuthenticationPlugin.java
(rev 0)
+++
jbossexo/modules/sso/trunk/gatein-cas/src/main/java/org/gatein/sso/cas/server/AuthenticationPlugin.java 2009-11-13
19:16:04 UTC (rev 13814)
@@ -0,0 +1,140 @@
+/*
+* 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.cas.server;
+
+import org.apache.log4j.Logger;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.GetMethod;
+
+import
org.jasig.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler;
+import org.jasig.cas.authentication.principal.UsernamePasswordCredentials;
+
+/**
+ * This is a Gatein Authentication Plugin for the CAS server. It is deployed along with
the CAS server and provides authentication
+ * against a Gatein instance
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class AuthenticationPlugin extends AbstractUsernamePasswordAuthenticationHandler
+{
+ private static Logger log = Logger.getLogger(AuthenticationPlugin.class);
+
+ private String gateInHost;
+ private String gateInPort;
+ private String gateInContext;
+
+ public AuthenticationPlugin()
+ {
+
+ }
+
+ public String getGateInHost()
+ {
+ return gateInHost;
+ }
+
+
+
+ public void setGateInHost(String gateInHost)
+ {
+ this.gateInHost = gateInHost;
+ }
+
+
+
+ public String getGateInPort()
+ {
+ return gateInPort;
+ }
+
+
+ public void setGateInPort(String gateInPort)
+ {
+ this.gateInPort = gateInPort;
+ }
+
+ public String getGateInContext()
+ {
+ return gateInContext;
+ }
+
+ public void setGateInContext(String gateInContext)
+ {
+ this.gateInContext = gateInContext;
+ }
+ //-----------------------------------------------------------------------------------------------------------------------------------------------------------------
+ public boolean authenticateUsernamePasswordInternal(final UsernamePasswordCredentials
credentials)
+ {
+ try
+ {
+ final String username = credentials.getUsername();
+ final String password = credentials.getPassword();
+
+ StringBuilder urlBuffer = new StringBuilder();
+
urlBuffer.append("http://"+this.gateInHost+":"+this.gateInPort+"/"+this.gateInContext+"/rest/sso/authcallback/auth/"+username+"/"+password);
+
+
log.info("-------------------------------------------------------------------");
+ log.info("REST Request="+urlBuffer.toString());
+
log.info("-------------------------------------------------------------------");
+
+ return this.executeRemoteCall(urlBuffer.toString());
+ }
+ catch(Exception e)
+ {
+ log.error(this, e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ private boolean executeRemoteCall(String authUrl) throws Exception
+ {
+ HttpClient client = new HttpClient();
+ GetMethod method = null;
+ try
+ {
+ method = new GetMethod(authUrl);
+
+ int status = client.executeMethod(method);
+ String response = method.getResponseBodyAsString();
+
+ switch(status)
+ {
+ case 200:
+ if(response.equals(Boolean.TRUE.toString()))
+ {
+ return true;
+ }
+ break;
+ }
+
+ return false;
+ }
+ finally
+ {
+ if(method != null)
+ {
+ method.releaseConnection();
+ }
+ }
+ }
+}
Added: jbossexo/modules/sso/trunk/gatein-cas/src/main/resources/log4j.properties
===================================================================
--- jbossexo/modules/sso/trunk/gatein-cas/src/main/resources/log4j.properties
(rev 0)
+++ jbossexo/modules/sso/trunk/gatein-cas/src/main/resources/log4j.properties 2009-11-13
19:16:04 UTC (rev 13814)
@@ -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
Added:
jbossexo/modules/sso/trunk/gatein-cas/src/test/java/org/gatein/sso/cas/server/TestAuthenticationPlugin.java
===================================================================
---
jbossexo/modules/sso/trunk/gatein-cas/src/test/java/org/gatein/sso/cas/server/TestAuthenticationPlugin.java
(rev 0)
+++
jbossexo/modules/sso/trunk/gatein-cas/src/test/java/org/gatein/sso/cas/server/TestAuthenticationPlugin.java 2009-11-13
19:16:04 UTC (rev 13814)
@@ -0,0 +1,64 @@
+/*
+* 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.cas.server;
+
+import junit.framework.TestCase;
+
+import org.jasig.cas.authentication.principal.UsernamePasswordCredentials;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class TestAuthenticationPlugin extends TestCase
+{
+ private AuthenticationPlugin authPlugin;
+
+ public void setUp() throws Exception
+ {
+ this.authPlugin = new AuthenticationPlugin();
+
+ this.authPlugin.setGateInHost("localhost");
+ this.authPlugin.setGateInPort("1500");
+ this.authPlugin.setGateInContext("portal");
+ }
+
+ public void tearDown() throws Exception
+ {
+ this.authPlugin = null;
+ }
+ //-------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ public void testAuthenticationCallback() throws Exception
+ {
+ UsernamePasswordCredentials credentials = new UsernamePasswordCredentials();
+ credentials.setUsername("root");
+ credentials.setPassword("gtn");
+
+ boolean authResult = this.authPlugin.authenticate(credentials);
+ assertTrue("Login should have succeeded!!", authResult);
+
+ credentials = new UsernamePasswordCredentials();
+ credentials.setUsername("root");
+ credentials.setPassword("blah");
+ authResult = this.authPlugin.authenticate(credentials);
+ assertFalse("Login should *not* have succeeded!!", authResult);
+ }
+}
Added: jbossexo/modules/sso/trunk/pom.xml
===================================================================
--- jbossexo/modules/sso/trunk/pom.xml (rev 0)
+++ jbossexo/modules/sso/trunk/pom.xml 2009-11-13 19:16:04 UTC (rev 13814)
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This pom functions as a default configuration. The subproject
+ poms each inherit configuration from this one.
+
+ When adding version information for an artifact please do the following
+ - add a version property for the specific version
+ - add a dependency in the dependencyManagement section which refers to
+ the property
+-->
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.gatein.sso</groupId>
+ <artifactId>gatein-sso-parent</artifactId>
+ <version>trunk-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Gatein Single Sign On Integration</name>
+ <
url>http://www.jboss.org/gatein</url>
+ <description>Gatein Single Sign On Integration</description>
+
+ <properties>
+ <version.junit>3.8.1</version.junit>
+
+ <!-- http client -->
+ <version.commons-httpclient>3.1</version.commons-httpclient>
+
+ <!-- logging -->
+ <version.log4j>1.2.14</version.log4j>
+ <version.jboss.logging>2.0.2.GA</version.jboss.logging>
+ <version.apache.logging>1.0.4-jboss</version.apache.logging>
+
+ <!-- cas -->
+ <version.cas>3.3.4</version.cas>
+
+ <!-- exo -->
+ <org.exoplatform.ws.version>2.1.0-Beta02</org.exoplatform.ws.version>
+
+ <!-- JAX-RS jsr-311 -->
+ <version.javax.ws.rs>1.0</version.javax.ws.rs>
+ </properties>
+
+ <modules>
+ <module>gatein-cas</module>
+ <module>auth-callback</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- junit -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ </dependency>
+
+ <!-- cas -->
+ <dependency>
+ <groupId>org.jasig.cas</groupId>
+ <artifactId>cas-server-core</artifactId>
+ <version>${version.cas}</version>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${version.log4j}</version>
+ </dependency>
+
+ <!-- httpclient -->
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>${version.commons-httpclient}</version>
+ </dependency>
+
+ <!-- jax-rs api -->
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>${version.javax.ws.rs}</version>
+ </dependency>
+
+ <!-- exo -->
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.rest.core</artifactId>
+ <version>${org.exoplatform.ws.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <
url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <
url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+
+ <repository>
+ <id>josso-m2-repo</id>
+ <name>JOSSO Maven2 Repository</name>
+ <url>http://repository.josso.org</url>
+ <releases>
+ <checksumPolicy>fail</checksumPolicy>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <checksumPolicy>fail</checksumPolicy>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+ <repository>
+ <id>exo-int</id>
+ <
url>http://maven2.exoplatform.org/rest/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+
+ <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>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <
id>java.net maven repository</id>
+ <
url>http://download.java.net/maven/2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+</project>