Author: sohil.shah(a)jboss.com
Date: 2009-11-15 14:17:49 -0500 (Sun, 15 Nov 2009)
New Revision: 13828
Added:
jbossexo/modules/sso/trunk/gatein-josso-plugin/
jbossexo/modules/sso/trunk/gatein-josso-plugin/pom.xml
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/.directory
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/WEB-INF/
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/WEB-INF/gatein.properties
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/josso-gateway-config.xml
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/josso-gateway-gatein-stores.xml
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/java/
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/java/org/
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/josso/
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/josso/plugin/
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/josso/plugin/GateinIdentityPlugin.java
Modified:
jbossexo/modules/sso/trunk/.classpath
jbossexo/modules/sso/trunk/pom.xml
Log:
josso plugin
Modified: jbossexo/modules/sso/trunk/.classpath
===================================================================
--- jbossexo/modules/sso/trunk/.classpath 2009-11-14 20:34:31 UTC (rev 13827)
+++ jbossexo/modules/sso/trunk/.classpath 2009-11-15 19:17:49 UTC (rev 13828)
@@ -4,7 +4,8 @@
<classpathentry kind="src"
path="auth-callback/src/test/java"/>
<classpathentry kind="src"
path="gatein-cas-plugin/src/main/java"/>
<classpathentry kind="src"
path="gatein-cas-plugin/src/test/java"/>
- <classpathentry kind="src"
path="opensso-plugin/src/main/java"/>
+ <classpathentry kind="src"
path="gatein-josso-plugin/src/main/java"/>
+ <classpathentry kind="src"
path="gatein-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"/>
@@ -16,6 +17,9 @@
<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="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Added: jbossexo/modules/sso/trunk/gatein-josso-plugin/pom.xml
===================================================================
--- jbossexo/modules/sso/trunk/gatein-josso-plugin/pom.xml (rev
0)
+++ jbossexo/modules/sso/trunk/gatein-josso-plugin/pom.xml 2009-11-15 19:17:49 UTC (rev
13828)
@@ -0,0 +1,57 @@
+<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-josso-plugin</artifactId>
+ <packaging>jar</packaging>
+ <name>Gatein Integration for JOSSO Single Sign On Framework</name>
+
+ <properties>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-basic-authscheme</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>
+ <plugin>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>maven-xbean-plugin</artifactId>
+ <version>${version.xbean}</version>
+ <executions>
+ <execution>
+ <configuration>
+
<namespace>urn:org:gatein:sso:josso:plugin:gateinidentityplugin</namespace>
+ </configuration>
+ <goals>
+ <goal>mapping</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/.directory
===================================================================
--- jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/.directory
(rev 0)
+++ jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/.directory 2009-11-15
19:17:49 UTC (rev 13828)
@@ -0,0 +1,3 @@
+[Dolphin]
+Timestamp=2009,11,15,13,12,31
+ViewMode=1
Added:
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/WEB-INF/gatein.properties
===================================================================
---
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/WEB-INF/gatein.properties
(rev 0)
+++
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/WEB-INF/gatein.properties 2009-11-15
19:17:49 UTC (rev 13828)
@@ -0,0 +1,3 @@
+gateInHost=localhost
+gateInPort=1500
+gateInContext=portal
\ No newline at end of file
Added:
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/josso-gateway-config.xml
===================================================================
---
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/josso-gateway-config.xml
(rev 0)
+++
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/josso-gateway-config.xml 2009-11-15
19:17:49 UTC (rev 13828)
@@ -0,0 +1,314 @@
+<?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="urn:org:josso:core"
+ xmlns:def-sdselector="urn:org:josso:default:secdomainselector"
+ xmlns:def-sdregistry="urn:org:josso:default:secdomainregistry"
+ xmlns:simple-sdmatcher="urn:org:josso:simple:secdomainmatcher"
+ xmlns:vhost-sdmatcher="urn:org:josso:vhost:secdomainmatcher"
+ xmlns:appcxt-sdmatcher="urn:org:josso:appctx:secdomainmatcher"
+ xmlns:def-auth="urn:org:josso:default:authenticator"
+ xmlns:basic-authscheme="urn:org:josso:basic:authscheme"
+ xmlns:bind-authscheme="urn:org:josso:bind:authscheme"
+ xmlns:ntlm-authscheme="urn:org:josso:ntlm:authscheme"
+ xmlns:strong-authscheme="urn:org:josso:strong:authscheme"
+ xmlns:memory-istore="urn:org:josso:memory:identitystore"
+ xmlns:def-identitymgr="urn:org:josso:default:identitymgr"
+ xmlns:def-identityprv="urn:org:josso:default:identityprovider"
+ xmlns:def-sessionmgr="urn:org:josso:default:sessionmgr"
+ xmlns:memory-sstore="urn:org:josso:memory:sessionstore"
+ xmlns:def-sidgen="urn:org:josso:default:sessionidgen"
+ xmlns:def-assertionmgr="urn:org:josso:default:assertionmgr"
+ xmlns:memory-astore="urn:org:josso:memory:assertionstore"
+ xmlns:def-aidgen="urn:org:josso:default:assertionidgen"
+ xmlns:def-auditmgr="urn:org:josso:default:auditmgr"
+ xmlns:logger-atrailhandler="urn:org:josso:logger:audittrailhandler"
+ xmlns:def-eventmgr="urn:org:josso:default:eventmgr"
+ xmlns:def-pwdmgr="urn:org:josso:default:passwordmgr"
+ xmlns:def-pwdgen="urn:org:josso:default:passwordgenerator"
+ xmlns:email-pwddist="urn:org:josso:email:passworddistributor"
+ xmlns:simple-lostpwd="urn:org:josso:simple:lostpasswordprocess"
+
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
+ urn:org:josso:core
http://www.josso.org/schema/josso-core.xsd
+ urn:org:josso:default:secdomainselector
http://www.josso.org/schema/josso-default-secdomainselector.xsd
+ urn:org:josso:default:secdomainregistry
http://www.josso.org/schema/josso-default-secdomainregistry.xsd
+ urn:org:josso:simple:secdomainmatcher
http://www.josso.org/schema/josso-simple-secdomainmatcher.xsd
+ urn:org:josso:vhost:secdomainmatcher
http://www.josso.org/schema/josso-vhost-secdomainmatcher.xsd
+ urn:org:josso:appctx:secdomainmatcher
http://www.josso.org/schema/josso-appctx-secdomainmatcher.xsd
+ urn:org:josso:default:authenticator
http://www.josso.org/schema/josso-default-authenticator.xsd
+ urn:org:josso:basic:authscheme
http://www.josso.org/schema/josso-basic-authscheme.xsd
+ urn:org:josso:bind:authscheme
http://www.josso.org/schema/josso-bind-authscheme.xsd
+ urn:org:josso:ntlm:authscheme
http://www.josso.org/schema/josso-ntlm-authscheme.xsd
+ urn:org:josso:strong:authscheme
http://www.josso.org/schema/josso-strong-authscheme.xsd
+ urn:org:josso:memory:identitystore
http://www.josso.org/schema/josso-memory-identitystore.xsd
+ urn:org:josso:default:identitymgr
http://www.josso.org/schema/josso-default-identitymgr.xsd
+ urn:org:josso:default:identityprovider
http://www.josso.org/schema/josso-default-identityprovider.xsd
+ urn:org:josso:default:sessionmgr
http://www.josso.org/schema/josso-default-sessionmgr.xsd
+ urn:org:josso:memory:sessionstore
http://www.josso.org/schema/josso-memory-sessionstore.xsd
+ urn:org:josso:default:sessionidgen
http://www.josso.org/schema/josso-default-sessionidgen.xsd
+ urn:org:josso:default:assertionmgr
http://www.josso.org/schema/josso-default-assertionmgr.xsd
+ urn:org:josso:memory:assertionstore
http://www.josso.org/schema/josso-memory-assertionstore.xsd
+ urn:org:josso:default:assertionidgen
http://www.josso.org/schema/josso-default-assertionidgen.xsd
+ urn:org:josso:default:auditmgr
http://www.josso.org/schema/josso-default-auditmgr.xsd
+ urn:org:josso:logger:audittrailhandler
http://www.josso.org/schema/josso-logger-audittrailhandler.xsd
+ urn:org:josso:default:eventmgr
http://www.josso.org/schema/josso-default-eventmgr.xsd
+ urn:org:josso:default:passwordmgr
http://www.josso.org/schema/josso-default-passwordmanager.xsd
+ urn:org:josso:default:passwordgenerator
http://www.josso.org/schema/josso-default-passwordgenerator.xsd
+ urn:org:josso:email:passworddistributor
http://www.josso.org/schema/josso-email-passworddistributor.xsd
+ urn:org:josso:simple:lostpasswordprocess
http://www.josso.org/schema/josso-simple-lostpasswordprocess.xsd">
+
+ <!-- ================================================================== -->
+ <!-- JOSSO Gateway Configuration using Spring + XBean -->
+ <!-- -->
+ <!-- since JOSSO 1.8 -->
+ <!-- ================================================================== -->
+
+ <!-- To keep things organized when using multiple security domains, prepend the
domain name
+ to component ids, in our case all componetes use the 'josso' prefix -->
+
+ <!-- ================================================================== -->
+ <!-- Some components are configured in different files to make -->
+ <!-- configuraiton easier -->
+ <!-- ================================================================== -->
+
+ <!-- Authentication schemes configuration -->
+ <s:import resource="josso-gateway-auth.xml"/>
+
+ <!-- SSO Self services configuration -->
+ <s:import resource="josso-gateway-selfservices.xml"/>
+
+ <!-- Identity, Session and Assertion Stores configuration -->
+ <!--
+ Marker: GateIn customization
+ <s:import resource="josso-gateway-stores.xml" />
+ -->
+ <s:import resource="josso-gateway-gatein-stores.xml" />
+
+ <!-- Web configuration (login form, etc) -->
+ <s:import resource="josso-gateway-web.xml" />
+
+ <!-- JMX, used internally -->
+ <s:import resource="josso-gateway-jmx.xml" />
+
+ <!-- ================================================================== -->
+ <!-- Here we define gateway core structure -->
+ <!-- ================================================================== -->
+ <gateway>
+
+ <sso-domain-selector>
+ <def-sdselector:default-domain-selector/>
+ </sso-domain-selector>
+
+ <sso-domains-registry>
+ <def-sdregistry:default-domains-registry/>
+ </sso-domains-registry>
+
+ <!-- =====================================================================
-->
+ <!-- SSO Security Domains, here we have only one domain configured : josso
-->
+ <!-- Most components are configured elsewhere and referenced here to make
-->
+ <!-- configuration easier.
-->
+ <!--
-->
+ <!-- Unless you have multimple security domains, you will not need to
-->
+ <!-- change this part
-->
+ <!-- =====================================================================
-->
+ <domains>
+ <s:ref bean="josso"/>
+ </domains>
+
+ </gateway>
+
+
+ <!-- JOSSO Default security domain -->
+ <domain name="josso" type="web">
+
+ <sso-web-configuration>
+ <s:ref bean="josso-web-configuraiton"/>
+ </sso-web-configuration>
+
+ <matchers>
+ <simple-sdmatcher:simple-matcher/>
+ </matchers>
+
+ <authenticator>
+ <s:ref bean="josso-authenticator"/>
+ </authenticator>
+
+ <identity-manager>
+ <s:ref bean="josso-identity-manager"/>
+ </identity-manager>
+
+ <session-manager>
+ <s:ref bean="josso-session-manager"/>
+ </session-manager>
+
+ <assertion-manager>
+ <s:ref bean="josso-assertion-manager"/>
+ </assertion-manager>
+
+ <identity-provider>
+ <s:ref bean="josso-identity-provider"/>
+ </identity-provider>
+
+ <audit-manager>
+ <s:ref bean="josso-audit-manager"/>
+ </audit-manager>
+
+ <event-manager>
+ <s:ref bean="josso-event-manager"/>
+ </event-manager>
+
+ <!-- Only needed when using NTLM -->
+ <protocol-manager>
+ <s:ref bean="josso-protocol-manager"/>
+ </protocol-manager>
+
+ <!-- Only neede for self-services (lost password, etc). -->
+ <password-manager>
+ <s:ref bean="josso-password-manager"/>
+ </password-manager>
+
+ </domain>
+
+
+ <!-- ===================================================================== -->
+ <!-- SSO Authenticator, all authentication schemes must be configured here -->
+ <!-- ===================================================================== -->
+ <def-auth:authenticator id="josso-authenticator">
+ <!--
+ <def-auth:schemes>
+ <s:ref bean="josso-basic-authentication"/>
+ <s:ref bean="josso-strong-authentication"/>
+ <s:ref bean="josso-rememberme-authentication"/>
+ </def-auth:schemes>
+ -->
+
+ <!-- Marker: GateIn customization -->
+ <def-auth:schemes>
+ <s:ref bean="josso-bind-authentication"/>
+ </def-auth:schemes>
+ </def-auth:authenticator>
+
+ <!-- ===================================================================== -->
+ <!-- SSO Identity manager, referencing identity store -->
+ <!-- ===================================================================== -->
+ <def-identitymgr:identity-manager id="josso-identity-manager">
+
+ <def-identitymgr:identityStore>
+ <s:ref bean="josso-identity-store"/>
+ </def-identitymgr:identityStore>
+
+ <def-identitymgr:identityStoreKeyAdapter>
+ <s:ref bean="josso-simple-key-adapter"/>
+ </def-identitymgr:identityStoreKeyAdapter>
+
+ </def-identitymgr:identity-manager>
+
+ <!-- ===================================================================== -->
+ <!-- SSO Identity provider -->
+ <!-- ===================================================================== -->
+ <def-identityprv:identity-provider id="josso-identity-provider"/>
+
+ <!-- ===================================================================== -->
+ <!-- SSO Session manager, referencing session store -->
+ <!-- ===================================================================== -->
+ <def-sessionmgr:session-manager id="josso-session-manager"
+ maxInactiveInterval="30"
+ maxSessionsPerUser="-1"
+ invalidateExceedingSessions="false"
+ sessionMonitorInterval="10000">
+
+ <def-sessionmgr:session-id-generator>
+ <def-sidgen:id-generator algorithm="MD5"/>
+ </def-sessionmgr:session-id-generator>
+
+ <def-sessionmgr:session-store>
+ <s:ref bean="josso-session-store"/>
+ </def-sessionmgr:session-store>
+
+ </def-sessionmgr:session-manager>
+
+ <!-- ===================================================================== -->
+ <!-- SSO Assertion anager, referencing assertion store -->
+ <!-- ===================================================================== -->
+ <def-assertionmgr:assertion-manager id="josso-assertion-manager">
+
+ <def-assertionmgr:assertion-id-generator>
+ <def-aidgen:id-generator/>
+ </def-assertionmgr:assertion-id-generator>
+
+ <def-assertionmgr:assertion-store>
+ <s:ref bean="josso-assertion-store"/>
+ </def-assertionmgr:assertion-store>
+
+ </def-assertionmgr:assertion-manager>
+
+ <!-- ===================================================================== -->
+ <!-- SSO Audit Manager with audit trail handlers -->
+ <!-- ===================================================================== -->
+ <def-auditmgr:audit-manager id="josso-audit-manager">
+
+ <!-- Audit Trail Handlers list -->
+ <def-auditmgr:handlers>
+ <logger-atrailhandler:audittrail-logger
category="org.josso.AUDIT"/>
+ </def-auditmgr:handlers>
+
+ </def-auditmgr:audit-manager>
+
+ <!-- ===================================================================== -->
+ <!-- SSO Protocol Manager with handlers -->
+ <!-- ===================================================================== -->
+ <default-protocol-manager id="josso-protocol-manager">
+ <!-- To enable NTLM, uncomment this :
+ <handlers>
+ <ntlm-authscheme:ntlm-protocol-handler/>
+ </handlers>
+ -->
+ </default-protocol-manager>
+
+ <!-- ===================================================================== -->
+ <!-- SSO Event manager, based on spring jmx -->
+ <!-- ===================================================================== -->
+ <def-eventmgr:springjmx-event-manager id="josso-event-manager">
+ <def-eventmgr:listeners>
+ <s:ref bean="josso-audit-manager"/>
+ </def-eventmgr:listeners>
+ </def-eventmgr:springjmx-event-manager>
+
+ <!-- ===================================================================== -->
+ <!-- SSO Simple key addapter used in several components -->
+ <!-- ===================================================================== -->
+ <simple-key-adapter id="josso-simple-key-adapter"/>
+
+ <!-- ===================================================================== -->
+ <!-- Spring Mail Sender bean. Configure mail delivery settings here -->
+ <!-- ===================================================================== -->
+ <s:bean id="josso-spring-mailsender"
class="org.springframework.mail.javamail.JavaMailSenderImpl">
+ <!-- Spring JavaMaileSender properties :
+ protocol, host, port, username, password -->
+ <s:property name="host" value="mail.mycompany.com"/>
+ </s:bean>
+
+</s:beans>
Added:
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/josso-gateway-gatein-stores.xml
===================================================================
---
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/josso-gateway-gatein-stores.xml
(rev 0)
+++
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/config/josso-gateway-gatein-stores.xml 2009-11-15
19:17:49 UTC (rev 13828)
@@ -0,0 +1,77 @@
+<?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:gatein-istore="urn:org:gatein:sso:josso:plugin:gateinidentityplugin"
+ xmlns:bind-authscheme="urn:org:josso:bind:authscheme"
+ xmlns:memory-sstore="urn:org:josso:memory:sessionstore"
+ xmlns:memory-astore="urn:org:josso:memory:assertionstore"
+
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
+ urn:org:josso:memory:identitystore
http://www.josso.org/schema/josso-memory-identitystore.xsd
+ urn:org:josso:memory:sessionstore
http://www.josso.org/schema/josso-memory-sessionstore.xsd
+ urn:org:josso:memory:assertionstore
http://www.josso.org/schema/josso-memory-assertionstore.xsd
+ ">
+
+ <!-- ===================================================================== -->
+ <!-- JOSSO Identity Store, the id is very important because it is -->
+ <!-- referenced by the identity manager, auth schemes and who knows where -->
+ <!-- else. -->
+ <!-- ===================================================================== -->
+ <gatein-istore:gatein-store id="josso-identity-store"
s:scope="singleton"/>
+
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- BIND Authentication Scheme -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <bind-authscheme:bind-auth-scheme
+ id="josso-bind-authentication"
+ name="basic-authentication"
+ hashAlgorithm="MD5"
+ hashEncoding="HEX"
+ ignorePasswordCase="false"
+ ignoreUserCase="false">
+
+
+ <bind-authscheme:credentialStore>
+ <s:ref bean="josso-identity-store"/>
+ </bind-authscheme:credentialStore>
+
+ <bind-authscheme:credentialStoreKeyAdapter>
+ <s:ref bean="josso-simple-key-adapter"/>
+ </bind-authscheme:credentialStoreKeyAdapter>
+
+ </bind-authscheme:bind-auth-scheme>
+
+ <!-- ===================================================================== -->
+ <!-- JOSSO Session Store, the id is very important because it is -->
+ <!-- referenced by the session manager and who knows where else -->
+ <!-- ===================================================================== -->
+ <memory-sstore:memory-store id="josso-session-store"/>
+
+ <!-- ===================================================================== -->
+ <!-- JOSSO Assertion Store, the id is very important because it is -->
+ <!-- referenced by the assertion manager and who knows where elese -->
+ <!-- ===================================================================== -->
+ <memory-astore:memory-store id="josso-assertion-store"/>
+</s:beans>
Added:
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/josso/plugin/GateinIdentityPlugin.java
===================================================================
---
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/josso/plugin/GateinIdentityPlugin.java
(rev 0)
+++
jbossexo/modules/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/josso/plugin/GateinIdentityPlugin.java 2009-11-15
19:17:49 UTC (rev 13828)
@@ -0,0 +1,186 @@
+/******************************************************************************
+ * 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.josso.plugin;
+
+import org.apache.log4j.Logger;
+
+import org.josso.gateway.SSONameValuePair;
+import org.josso.gateway.identity.exceptions.NoSuchUserException;
+import org.josso.gateway.identity.exceptions.SSOIdentityException;
+import org.josso.gateway.identity.service.BaseRole;
+import org.josso.gateway.identity.service.BaseRoleImpl;
+import org.josso.gateway.identity.service.BaseUser;
+import org.josso.gateway.identity.service.BaseUserImpl;
+import org.josso.gateway.identity.service.store.UserKey;
+import org.josso.gateway.identity.service.store.SimpleUserKey;
+import org.josso.gateway.identity.service.store.IdentityStore;
+
+import org.josso.auth.Credential;
+import org.josso.auth.CredentialKey;
+import org.josso.auth.CredentialProvider;
+import org.josso.auth.scheme.AuthenticationScheme;
+import org.josso.auth.scheme.UsernameCredential;
+import org.josso.auth.scheme.PasswordCredential;
+import org.josso.auth.BindableCredentialStore;
+import org.josso.auth.exceptions.SSOAuthenticationException;
+
+/**
+ * @org.apache.xbean.XBean element="gatein-store"
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class GateinIdentityPlugin implements IdentityStore,
+ BindableCredentialStore
+{
+ private static Logger log = Logger.getLogger(GateinIdentityPlugin.class);
+
+ private AuthenticationScheme authenticationScheme = null;
+
+ private String gateInHost;
+ private String gateInPort;
+ private String gateInContext;
+
+ /**
+ *
+ *
+ */
+ public GateinIdentityPlugin()
+ {
+ try
+ {
+ // TODO: readin GateIn configuration from WEB-INF/gatein.properties
+
+ log
+ .info("-------------------------------------------------------------------");
+ log.info("GateIn Host: " + this.gateInHost);
+ log
+ .info("GateIn Identity Plugin successfully
started........................");
+ log
+ .info("-------------------------------------------------------------------");
+ }
+ catch (Exception e)
+ {
+ this.authenticationScheme = null;
+
+ log.error(this, e);
+ throw new RuntimeException(
+ "GateIn Identity Plugin registration failed....");
+ }
+ }
+
+ public void setAuthenticationScheme(AuthenticationScheme authenticationScheme)
+ {
+ this.authenticationScheme = authenticationScheme;
+ }
+
+ 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;
+ }
+
+ // ----------------IdentityStore
+ //
implementation------------------------------------------------------------------------------------------------------------------------
+ public boolean userExists(UserKey userKey) throws SSOIdentityException
+ {
+ log.info("User: "+userKey+" exists....");
+ return true;
+ }
+
+ public BaseRole[] findRolesByUserKey(UserKey userKey)
+ throws SSOIdentityException
+ {
+ log.info("Loading Roles for..."+userKey);
+
+ return null;
+ }
+
+ public BaseUser loadUser(UserKey userKey) throws NoSuchUserException,
+ SSOIdentityException
+ {
+ BaseUser user = new BaseUserImpl();
+ user.setName(userKey.toString());
+ user.addProperty("password", "");
+
+ log.info("Loading
User................................................................");
+ log.info("User:"+user.getName());
+
+ return user;
+ }
+ // ---------------CredentialStore
+ //
implementation----------------------------------------------------------------------------------------------------------------------
+ public Credential[] loadCredentials(CredentialKey credentialKey,
+ CredentialProvider credentialProvider) throws SSOIdentityException
+ {
+ log.info("Loading Credentials using the new
method................................................................");
+ return loadCredentials(credentialKey);
+ }
+
+ public Credential[] loadCredentials(CredentialKey credentialKey) throws
SSOIdentityException
+ {
+ // Get the User corresponding to this credentialKey
+ BaseUser user = this.loadUser((SimpleUserKey) credentialKey);
+ SSONameValuePair[] properties = user.getProperties();
+ String password = properties[0].getValue();
+
+ log.info("Loading Credentials
for................................................................");
+ log.info("User:"+user.getName());
+ log.info("Password:"+password);
+ return new Credential[] { new UsernameCredential(user.getName()),new
PasswordCredential(password) };
+ }
+
+ public boolean bind(String username, String password)
+ throws SSOAuthenticationException
+ {
+ // return this.portalIdentityService.authenticate(username, password);
+ log.info("Performing Authentication........................");
+ log.info("Username: "+username);
+ log.info("Password: "+password);
+ return true;
+ }
+}
Modified: jbossexo/modules/sso/trunk/pom.xml
===================================================================
--- jbossexo/modules/sso/trunk/pom.xml 2009-11-14 20:34:31 UTC (rev 13827)
+++ jbossexo/modules/sso/trunk/pom.xml 2009-11-15 19:17:49 UTC (rev 13828)
@@ -34,6 +34,12 @@
<!-- cas -->
<version.cas>3.3.4</version.cas>
+ <!-- josso -->
+ <version.josso>1.8.1</version.josso>
+
+ <!-- xbean -->
+ <version.xbean>3.4.3</version.xbean>
+
<!-- opensso -->
<version.opensso>8.0</version.opensso>
@@ -47,7 +53,8 @@
<modules>
<module>auth-callback</module>
- <module>gatein-cas-plugin</module>
+ <module>gatein-cas-plugin</module>
+ <module>gatein-josso-plugin</module>
<module>gatein-opensso-plugin</module>
</modules>
@@ -78,6 +85,30 @@
<artifactId>amserver</artifactId>
<version>${version.opensso}</version>
</dependency>
+
+ <!-- josso -->
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-core</artifactId>
+ <version>${version.josso}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-basic-authscheme</artifactId>
+ <version>${version.josso}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring</artifactId>
+ <version>${version.xbean}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<!-- logging -->
<dependency>