Author: sohil.shah(a)jboss.com
Date: 2009-11-14 13:18:07 -0500 (Sat, 14 Nov 2009)
New Revision: 13820
Added:
jbossexo/modules/sso/trunk/opensso-plugin/
jbossexo/modules/sso/trunk/opensso-plugin/amserver.jar
jbossexo/modules/sso/trunk/opensso-plugin/opensso.jar
jbossexo/modules/sso/trunk/opensso-plugin/pom.xml
jbossexo/modules/sso/trunk/opensso-plugin/src/
jbossexo/modules/sso/trunk/opensso-plugin/src/main/
jbossexo/modules/sso/trunk/opensso-plugin/src/main/config/
jbossexo/modules/sso/trunk/opensso-plugin/src/main/config/AuthenticationPlugin.xml
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/opensso/
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/GateInPrincipal.java
Modified:
jbossexo/modules/sso/trunk/.classpath
jbossexo/modules/sso/trunk/pom.xml
Log:
first stab at opensso plugin
Modified: jbossexo/modules/sso/trunk/.classpath
===================================================================
--- jbossexo/modules/sso/trunk/.classpath 2009-11-14 12:37:59 UTC (rev 13819)
+++ jbossexo/modules/sso/trunk/.classpath 2009-11-14 18:18:07 UTC (rev 13820)
@@ -4,6 +4,7 @@
<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="src"
path="opensso-plugin/src/main/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"/>
@@ -13,6 +14,8 @@
<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/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="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Added: jbossexo/modules/sso/trunk/opensso-plugin/amserver.jar
===================================================================
(Binary files differ)
Property changes on: jbossexo/modules/sso/trunk/opensso-plugin/amserver.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbossexo/modules/sso/trunk/opensso-plugin/opensso.jar
===================================================================
(Binary files differ)
Property changes on: jbossexo/modules/sso/trunk/opensso-plugin/opensso.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbossexo/modules/sso/trunk/opensso-plugin/pom.xml
===================================================================
--- jbossexo/modules/sso/trunk/opensso-plugin/pom.xml (rev 0)
+++ jbossexo/modules/sso/trunk/opensso-plugin/pom.xml 2009-11-14 18:18:07 UTC (rev 13820)
@@ -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>opensso-plugin</artifactId>
+ <packaging>jar</packaging>
+ <name>Gatein Plugin for the OpenSSO Server</name>
+
+ <properties>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>opensso</groupId>
+ <artifactId>opensso</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>opensso</groupId>
+ <artifactId>amserver</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/opensso-plugin/src/main/config/AuthenticationPlugin.xml
===================================================================
--- jbossexo/modules/sso/trunk/opensso-plugin/src/main/config/AuthenticationPlugin.xml
(rev 0)
+++
jbossexo/modules/sso/trunk/opensso-plugin/src/main/config/AuthenticationPlugin.xml 2009-11-14
18:18:07 UTC (rev 13820)
@@ -0,0 +1,20 @@
+<?xml version='1.0' encoding="UTF-8"?>
+
+<!DOCTYPE ModuleProperties PUBLIC "=//iPlanet//Authentication Module Properties
XML Interface 1.0 DTD//EN"
+
"jar://com/sun/identity/authentication/Auth_Module_Properties.dtd">
+
+<ModuleProperties moduleName="AuthenticationPlugin" version="1.0"
>
+ <Callbacks length="2" order="1" timeout="60"
+ header="GateIn OpenSSO Login" >
+ <NameCallback>
+ <Prompt>
+ Username
+ </Prompt>
+ </NameCallback>
+ <PasswordCallback echoPassword="false" >
+ <Prompt>
+ Password
+ </Prompt>
+ </PasswordCallback>
+ </Callbacks>
+</ModuleProperties>
Added:
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java
===================================================================
---
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java
(rev 0)
+++
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java 2009-11-14
18:18:07 UTC (rev 13820)
@@ -0,0 +1,81 @@
+/*
+* 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.opensso.plugin;
+
+import java.util.Map;
+import java.security.Principal;
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+
+import org.apache.log4j.Logger;
+
+import com.sun.identity.authentication.spi.AMLoginModule;
+import com.sun.identity.authentication.spi.AuthLoginException;
+import com.sun.identity.authentication.util.ISAuthConstants;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class AuthenticationPlugin extends AMLoginModule
+{
+ private static Logger log = Logger.getLogger(AuthenticationPlugin.class);
+
+ public AuthenticationPlugin()
+ {
+
+ }
+
+ public void init(Subject subject, Map sharedState, Map options)
+ {
+
+ }
+
+ public int process(Callback[] callbacks, int state) throws AuthLoginException
+ {
+ System.out.println("---------------------------------------------------------------------");
+ System.out.println("Performing GateIn
Login..............................................");
+ System.out.println("---------------------------------------------------------------------");
+
+ for(int i=0; i<callbacks.length; i++)
+ {
+ Callback callback = callbacks[i];
+
+ if(callback instanceof NameCallback)
+ {
+ System.out.println("Username: "+((NameCallback)callback).getName());
+ }
+ else if(callback instanceof PasswordCallback)
+ {
+ System.out.println("Password: "+new
String(((PasswordCallback)callback).getPassword()));
+ }
+ }
+
+ return ISAuthConstants.LOGIN_SUCCEED;
+ }
+
+ public Principal getPrincipal()
+ {
+ return new GateInPrincipal("amadmin");
+ }
+}
Added:
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/GateInPrincipal.java
===================================================================
---
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/GateInPrincipal.java
(rev 0)
+++
jbossexo/modules/sso/trunk/opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/GateInPrincipal.java 2009-11-14
18:18:07 UTC (rev 13820)
@@ -0,0 +1,42 @@
+/*
+* 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.opensso.plugin;
+
+import java.security.Principal;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class GateInPrincipal implements Principal
+{
+ private String name;
+
+ public GateInPrincipal(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+}
Modified: jbossexo/modules/sso/trunk/pom.xml
===================================================================
--- jbossexo/modules/sso/trunk/pom.xml 2009-11-14 12:37:59 UTC (rev 13819)
+++ jbossexo/modules/sso/trunk/pom.xml 2009-11-14 18:18:07 UTC (rev 13820)
@@ -34,6 +34,9 @@
<!-- cas -->
<version.cas>3.3.4</version.cas>
+ <!-- opensso -->
+ <version.opensso>8.0</version.opensso>
+
<!-- exo -->
<org.exoplatform.core.version>2.3.0-Beta02</org.exoplatform.core.version>
<org.exoplatform.ws.version>2.1.0-Beta02</org.exoplatform.ws.version>
@@ -43,8 +46,9 @@
</properties>
<modules>
- <module>gatein-cas</module>
- <module>auth-callback</module>
+ <module>auth-callback</module>
+ <module>gatein-cas</module>
+ <module>opensso-plugin</module>
</modules>
<dependencyManagement>
@@ -62,6 +66,18 @@
<artifactId>cas-server-core</artifactId>
<version>${version.cas}</version>
</dependency>
+
+ <!-- opensso -->
+ <dependency>
+ <groupId>opensso</groupId>
+ <artifactId>opensso</artifactId>
+ <version>${version.opensso}</version>
+ </dependency>
+ <dependency>
+ <groupId>opensso</groupId>
+ <artifactId>amserver</artifactId>
+ <version>${version.opensso}</version>
+ </dependency>
<!-- logging -->
<dependency>