gatein SVN: r952 - in components/sso/trunk: agent/src/main/java/org/gatein/sso/agent/josso and 12 other directories.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-12-06 12:47:33 -0500 (Sun, 06 Dec 2009)
New Revision: 952
Added:
components/sso/trunk/packaging/josso/src/main/config/gatein/
components/sso/trunk/packaging/josso/src/main/config/gatein/gatein.ear/
components/sso/trunk/packaging/josso/src/main/config/gatein/gatein.ear/META-INF/
components/sso/trunk/packaging/josso/src/main/config/gatein/gatein.ear/META-INF/gatein-jboss-beans.xml
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/WEB-INF/
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/WEB-INF/web.xml
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/groovy/
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/groovy/portal/
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/groovy/portal/webui/
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/groovy/portal/webui/UILoginForm.gtmpl
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/login/
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/login/jsp/
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/login/jsp/login.jsp
Modified:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java
components/sso/trunk/packaging/josso/pom.xml
Log:
josso integration
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2009-12-06 17:01:49 UTC (rev 951)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2009-12-06 17:47:33 UTC (rev 952)
@@ -32,6 +32,7 @@
import org.exoplatform.web.login.InitiateLoginServlet;
import org.gatein.sso.agent.cas.CASAgent;
+import org.gatein.sso.agent.josso.JOSSOAgent;
import org.gatein.sso.agent.opensso.OpenSSOAgent;
/**
@@ -91,6 +92,7 @@
else if (jossoAssertion != null && jossoAssertion.trim().length() > 0)
{
//TODO: fix the JOSSO Agent. This will need to the new client side JOSSO stack that can run on 5.1.0.GA
+ JOSSOAgent.getInstance(this.ssoServerUrl).validateTicket(httpRequest);
}
else
{
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java 2009-12-06 17:01:49 UTC (rev 951)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java 2009-12-06 17:47:33 UTC (rev 952)
@@ -23,6 +23,10 @@
import javax.servlet.http.HttpServletRequest;
+import org.apache.log4j.Logger;
+
+import org.exoplatform.web.security.Credentials;
+import org.gatein.sso.agent.GenericSSOAgent;
import org.josso.agent.SSOAgent;
import org.josso.agent.Lookup;
import org.josso.agent.SSOAgentRequest;
@@ -38,24 +42,40 @@
*/
public class JOSSOAgent
{
- /*public static void test(HttpServletRequest httpRequest, String assertionId) throws Exception
+ private static Logger log = Logger.getLogger(Logger.class);
+ private static JOSSOAgent singleton;
+
+ private String serverUrl = null;
+
+ private JOSSOAgent(String serverUrl)
{
- System.out.println("Starting simple josso assertion test case..........................");
+ this.serverUrl = serverUrl;
+ }
+
+ public static JOSSOAgent getInstance(String serverUrl)
+ {
+ if(JOSSOAgent.singleton == null)
+ {
+ synchronized(JOSSOAgent.class)
+ {
+ if(JOSSOAgent.singleton == null)
+ {
+ JOSSOAgent.singleton = new JOSSOAgent(serverUrl);
+ }
+ }
+ }
+ return JOSSOAgent.singleton;
+ }
+
+ public void validateTicket(HttpServletRequest httpRequest) throws Exception
+ {
+ String ticket = httpRequest.getParameter("josso_assertion_id");
+ log.info("Trying to validate the following Ticket: "+ticket);
- Lookup lookup = Lookup.getInstance();
- lookup.init("josso-agent-config.xml");
+ //TODO: Use the JOSSO Client Library to validate the token and extract the subject that was authenticated
- SSOAgent agent = lookup.lookupSSOAgent();
-
- System.out.println("Agent: "+agent);
- System.out.println("AssertionId: "+assertionId);
-
- SSOAgentRequest request = new GenericServletSSOAgentRequest(SSOAgentRequest.ACTION_RELAY,
- null,
- new GenericServletLocalSession(httpRequest.getSession()),
- assertionId);
-
- SingleSignOnEntry result = agent.processRequest(request);
- System.out.println("SSOEntry: "+result);
- }*/
+ //Just do a hack login for now...to cutoff the infinite redirects
+ Credentials credentials = new Credentials("demo", "");
+ httpRequest.getSession().setAttribute(GenericSSOAgent.CREDENTIALS, credentials);
+ }
}
Modified: components/sso/trunk/packaging/josso/pom.xml
===================================================================
--- components/sso/trunk/packaging/josso/pom.xml 2009-12-06 17:01:49 UTC (rev 951)
+++ components/sso/trunk/packaging/josso/pom.xml 2009-12-06 17:47:33 UTC (rev 952)
@@ -109,9 +109,11 @@
overwrite="true"/>
<!-- Deploy JOSSO Agent dependencies -->
+ <!--
<copy file="${settings.localRepository}/opensso/openssoclientsdk/${version.opensso}/openssoclientsdk-${version.opensso}.jar"
todir="${gatein.location}/deploy/gatein.ear/lib"
- overwrite="true"/>
+ overwrite="true"/>
+ -->
</tasks>
</configuration>
<goals>
Added: components/sso/trunk/packaging/josso/src/main/config/gatein/gatein.ear/META-INF/gatein-jboss-beans.xml
===================================================================
--- components/sso/trunk/packaging/josso/src/main/config/gatein/gatein.ear/META-INF/gatein-jboss-beans.xml (rev 0)
+++ components/sso/trunk/packaging/josso/src/main/config/gatein/gatein.ear/META-INF/gatein-jboss-beans.xml 2009-12-06 17:47:33 UTC (rev 952)
@@ -0,0 +1,29 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <application-policy xmlns="urn:jboss:security-beans:1.0" name="gatein-domain">
+ <!--
+ <authentication>
+ <login-module code="org.exoplatform.web.security.PortalLoginModule" flag="required">
+ <module-option name="portalContainerName">portal</module-option>
+ <module-option name="realmName">gatein-domain</module-option>
+ </login-module>
+ <login-module code="org.exoplatform.services.security.jaas.SharedStateLoginModule" flag="required">
+ <module-option name="portalContainerName">portal</module-option>
+ <module-option name="realmName">gatein-domain</module-option>
+ </login-module>
+ <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required">
+ <module-option name="portalContainerName">portal</module-option>
+ <module-option name="realmName">gatein-domain</module-option>
+ </login-module>
+ </authentication>
+ -->
+ <authentication>
+ <login-module code="org.gatein.sso.agent.login.SSOLoginModule" flag="required"></login-module>
+ <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required">
+ <module-option name="portalContainerName">portal</module-option>
+ <module-option name="realmName">gatein-domain</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+</deployment>
Added: components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/WEB-INF/web.xml
===================================================================
--- components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/WEB-INF/web.xml (rev 0)
+++ components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/WEB-INF/web.xml 2009-12-06 17:47:33 UTC (rev 952)
@@ -0,0 +1,316 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>portal</display-name>
+
+ <context-param>
+ <param-name>org.exoplatform.frameworks.jcr.command.web.fckeditor.digitalAssetsWorkspace</param-name>
+ <param-value>portal</param-value>
+ <description>Binary assets workspace name</description>
+ </context-param>
+
+ <context-param>
+ <param-name>org.exoplatform.frameworks.jcr.command.web.fckeditor.digitalAssetsPath</param-name>
+ <param-value>/</param-value>
+ <description>Binary assets path</description>
+ </context-param>
+
+ <!-- ================================================================== -->
+ <!-- RESOURCE FILTER TO CACHE MERGED JAVASCRIPT AND CSS -->
+ <!-- ================================================================== -->
+ <filter>
+ <filter-name>GenericFilter</filter-name>
+ <filter-class>org.exoplatform.web.filter.GenericFilter</filter-class>
+ </filter>
+ <filter>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <filter-class>org.exoplatform.portal.application.ResourceRequestFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>ThreadLocalSessionProviderInitializedFilter</filter-name>
+ <filter-class>org.exoplatform.frameworks.jcr.web.ThreadLocalSessionProviderInitializedFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>SetCurrentIdentityFilter</filter-name>
+ <filter-class>org.exoplatform.services.security.web.SetCurrentIdentityFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>RestEncodingFilter</filter-name>
+ <filter-class>org.exoplatform.services.rest.servlet.RestEncodingFilter</filter-class>
+ <init-param>
+ <param-name>REQUEST_ENCODING</param-name>
+ <param-value>UTF-8</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>CacheUserProfileFilter</filter-name>
+ <filter-class>org.exoplatform.web.CacheUserProfileFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>GenericFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>*.css</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>*.gif</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>*.png</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>*.jpg</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>/javascript/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>SetCurrentIdentityFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>CacheUserProfileFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>RestEncodingFilter</filter-name>
+ <url-pattern>/rest/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ThreadLocalSessionProviderInitializedFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <!-- ================================================================== -->
+ <!-- LISTENER -->
+ <!-- ================================================================== -->
+ <listener>
+ <listener-class>org.exoplatform.web.GenericHttpListener</listener-class>
+ </listener>
+ <listener>
+ <listener-class>org.exoplatform.portal.application.PortalSessionListener</listener-class>
+ </listener>
+ <listener>
+ <listener-class>org.exoplatform.services.security.web.JAASConversationStateListener</listener-class>
+ </listener>
+ <!-- ================================================================== -->
+ <!-- SERVLET -->
+ <!-- ================================================================== -->
+ <servlet>
+ <servlet-name>portal</servlet-name>
+ <servlet-class>org.exoplatform.portal.application.PortalController</servlet-class>
+ <init-param>
+ <param-name>webui.configuration</param-name>
+ <param-value>app:/WEB-INF/webui-configuration.xml</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>RestServer</servlet-name>
+ <description>eXo - Platform REST Server</description>
+ <servlet-class>org.exoplatform.services.rest.servlet.RestServlet</servlet-class>
+ <load-on-startup>4</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>javascript</servlet-name>
+ <servlet-class>org.exoplatform.portal.webui.javascript.JavascriptServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>Controller</servlet-name>
+ <servlet-class>org.exoplatform.frameworks.jcr.web.CommandControllerServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- SSO Integration -->
+ <!--
+ <servlet>
+ <servlet-name>PortalLoginController</servlet-name>
+ <servlet-class>org.exoplatform.web.login.PortalLoginController</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>InitiateLoginServlet</servlet-name>
+ <servlet-class>org.exoplatform.web.login.InitiateLoginServlet</servlet-class>
+ </servlet>
+ -->
+ <servlet>
+ <servlet-name>InitiateLoginServlet</servlet-name>
+ <servlet-class>org.gatein.sso.agent.GenericSSOAgent</servlet-class>
+ <init-param>
+ <param-name>ssoServerUrl</param-name>
+ <param-value>http://localhost:8888/josso</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ssoCookieName</param-name>
+ <param-value>josso_assertion_id</param-value>
+ </init-param>
+ </servlet>
+
+ <servlet>
+ <servlet-name>ErrorLoginServlet</servlet-name>
+ <servlet-class>org.exoplatform.web.login.ErrorLoginServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>GateInServlet</servlet-name>
+ <servlet-class>org.gatein.wci.api.GateInServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <!-- ================================================================= -->
+ <servlet-mapping>
+ <servlet-name>InitiateLoginServlet</servlet-name>
+ <url-pattern>/initiatelogin</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>ErrorLoginServlet</servlet-name>
+ <url-pattern>/errorlogin</url-pattern>
+ </servlet-mapping>
+
+ <!-- SSO Integration -->
+ <!--
+ <servlet-mapping>
+ <servlet-name>PortalLoginController</servlet-name>
+ <url-pattern>/login</url-pattern>
+ </servlet-mapping>
+ -->
+
+ <servlet-mapping>
+ <servlet-name>javascript</servlet-name>
+ <url-pattern>/javascript/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/private/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/public/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/admin/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/service</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/command/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>RestServer</servlet-name>
+ <url-pattern>/rest/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>Controller</servlet-name>
+ <url-pattern>/connector</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>GateInServlet</servlet-name>
+ <url-pattern>/gateinservlet</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+
+ <!-- The Welcome File List for IBM WebSphere -->
+
+ <welcome-file-list>
+ <welcome-file>/index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>user authentication</web-resource-name>
+ <url-pattern>/private/*</url-pattern>
+ <http-method>POST</http-method>
+ <http-method>GET</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>users</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>admin authentication</web-resource-name>
+ <url-pattern>/admin/*</url-pattern>
+ <http-method>POST</http-method>
+ <http-method>GET</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>admin</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <login-config>
+ <auth-method>FORM</auth-method>
+ <realm-name>gatein-domain</realm-name>
+ <form-login-config>
+ <form-login-page>/initiatelogin</form-login-page>
+ <form-error-page>/errorlogin</form-error-page>
+ </form-login-config>
+ </login-config>
+ <security-role>
+ <description>a simple user role</description>
+ <role-name>users</role-name>
+ </security-role>
+ <security-role>
+ <description>the admin role</description>
+ <role-name>admin</role-name>
+ </security-role>
+</web-app>
\ No newline at end of file
Added: components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/groovy/portal/webui/UILoginForm.gtmpl
===================================================================
--- components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/groovy/portal/webui/UILoginForm.gtmpl (rev 0)
+++ components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/groovy/portal/webui/UILoginForm.gtmpl 2009-12-06 17:47:33 UTC (rev 952)
@@ -0,0 +1,87 @@
+<%
+ import org.exoplatform.web.application.JavascriptManager;
+ import javax.servlet.http.HttpSession;
+ def rcontext = _ctx.getRequestContext();
+ JavascriptManager jsmanager = rcontext.getJavascriptManager();
+ jsmanager.importJavascript('eXo.portal.UIPortalControl');
+ jsmanager.addCustomizedOnLoadScript('document.getElementById("UIPortalComponentLogin").username.focus();');
+ HttpSession session = rcontext.getRequest().getSession();
+ String requestPath = rcontext.getRequestContextPath() + "/private/" + rcontext.getPortalOwner();
+ session.setAttribute("initialURI", requestPath);
+%>
+<div class="UILoginForm">
+ <div class="LoginDecorator">
+ <div class="TopLeftLoginDecorator">
+ <div class="TopRightLoginDecorator">
+ <div class="TopCenterLoginDecorator">
+ <div class="SigninTitle"><%=_ctx.appRes("UILoginForm.label.Signin")%></div>
+ </div>
+ </div>
+ </div>
+ <div class="MiddleLeftLoginDecorator">
+ <div class="MiddleRightLoginDecorator">
+ <div class="LoginDecoratorBackground">
+ <div class="LoginDetailBox">
+ <% uiform.begin(); %>
+ <!--<form class="UIForm" id="$uicomponent.id" name="loginForm" action="<%= rcontext.getRequestContextPath() + "/login"%>" method="post" style="margin: 0px;">
+ <input type="hidden" name="<%= uiform.ACTION %>" value=""/>-->
+ <input type="hidden" name="uri" value="<%=session.getAttribute("initialURI"); %>"/>
+ <div class="VerticalLayout">
+ <table class="UIFormGrid">
+ <tr class="UserNameField">
+ <td class="FieldLabel"><%=_ctx.appRes("UILoginForm.label.UserName")%></td>
+ <td><% uiform.renderChild(0)%></td>
+ </tr>
+ <tr class="PasswordField" id="UIPortalLoginFormControl" onkeypress="eXo.portal.UIPortalControl.onEnterPress(event)">
+ <td class="FieldLabel"><%=_ctx.appRes("UILoginForm.label.password")%></td>
+ <td><% uiform.renderChild(1)%></td>
+ </tr>
+ <tr class="RememberField" onkeypress="eXo.portal.UIPortalControl.onEnterPress(event)">
+ <td class="FieldLabel"><% uiform.renderChild(2)%></td>
+ <td><%=_ctx.appRes("UILoginForm.label.RememberOnComputer")%></td>
+ </tr>
+ </table>
+ <div class="ForgetPass"><a href="<%= uicomponent.event("ForgetPassword") %>"><%=_ctx.appRes("UILoginForm.label.forgot")%></a></div>
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="login(this);" id="UIPortalLoginFormAction" class="ActionButton SimpleStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="#"><%=_ctx.appRes("UILoginForm.label.Signin");%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div onclick="<%=uicomponent.event("Close");%>" class="ActionButton SimpleStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);"><%=_ctx.appRes("UILoginForm.label.Discard")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <%uiform.end()%>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="BottomLeftLoginDecorator">
+ <div class="BottomRightLoginDecorator">
+ <div class="BottomCenterLoginDecorator"><span></span></div>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+ <%=uicomponent.event("Close");%>
+ window.location = 'http://localhost:8888/josso/signon/login.do?josso_back_to=http://localhos...';
+</script>
Added: components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/login/jsp/login.jsp
===================================================================
--- components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/login/jsp/login.jsp (rev 0)
+++ components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/login/jsp/login.jsp 2009-12-06 17:47:33 UTC (rev 952)
@@ -0,0 +1,39 @@
+<%--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+--%>
+
+<%@ page import="java.net.URLEncoder"%>
+<%@ page import="javax.servlet.http.Cookie"%>
+<%@ page import="org.exoplatform.container.PortalContainer"%>
+<%@ page import="org.exoplatform.services.resources.ResourceBundleService"%>
+<%@ page import="java.util.ResourceBundle"%>
+<%@ page import="org.exoplatform.web.login.InitiateLoginServlet"%>
+<%@ page language="java" %>
+<%@ page contentType="text/html; charset=utf-8" %>
+
+<html>
+ <head>
+ <script type="text/javascript">
+ window.location = 'http://localhost:8888/josso/signon/login.do?josso_back_to=http://localhos...';
+ </script>
+ </head>
+ <body>
+ </body>
+</html>
\ No newline at end of file
15 years
gatein SVN: r951 - components/sso/trunk/packaging/josso.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-12-06 12:01:49 -0500 (Sun, 06 Dec 2009)
New Revision: 951
Modified:
components/sso/trunk/packaging/josso/
Log:
svn ignore
Property changes on: components/sso/trunk/packaging/josso
___________________________________________________________________
Name: svn:ignore
+ target
15 years
gatein SVN: r950 - in components/sso/trunk: packaging and 8 other directories.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-12-06 12:00:34 -0500 (Sun, 06 Dec 2009)
New Revision: 950
Added:
components/sso/trunk/packaging/josso/pom.xml
components/sso/trunk/packaging/josso/src/
components/sso/trunk/packaging/josso/src/main/
components/sso/trunk/packaging/josso/src/main/config/
components/sso/trunk/packaging/josso/src/main/config/plugin/
components/sso/trunk/packaging/josso/src/main/config/plugin/WEB-INF/
components/sso/trunk/packaging/josso/src/main/config/plugin/WEB-INF/classes/
components/sso/trunk/packaging/josso/src/main/config/plugin/WEB-INF/classes/gatein.properties
components/sso/trunk/packaging/josso/src/main/config/plugin/lib/
components/sso/trunk/packaging/josso/src/main/config/plugin/lib/josso-gateway-config.xml
components/sso/trunk/packaging/josso/src/main/config/plugin/lib/josso-gateway-gatein-stores.xml
Removed:
components/sso/trunk/gatein-josso-plugin/src/main/config/
Modified:
components/sso/trunk/packaging/pom.xml
Log:
josso tomcat plugin
Added: components/sso/trunk/packaging/josso/pom.xml
===================================================================
--- components/sso/trunk/packaging/josso/pom.xml (rev 0)
+++ components/sso/trunk/packaging/josso/pom.xml 2009-12-06 17:00:34 UTC (rev 950)
@@ -0,0 +1,201 @@
+<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>packaging</artifactId>
+ <relativePath>../pom.xml</relativePath>
+ <version>trunk-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>josso-pkg</artifactId>
+ <packaging>jar</packaging>
+ <name>JOSSO Agent and Server Packages</name>
+
+ <dependencies>
+ <!-- gatein installation dependencies -->
+ <!-- -
+ <dependency>
+ <groupId>org.gatein.sso</groupId>
+ <artifactId>auth-callback</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.sso</groupId>
+ <artifactId>agent</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jasig.cas</groupId>
+ <artifactId>cas-client-core</artifactId>
+ </dependency>
+ -->
+
+ <!-- cas server plugin installation dependencies -->
+ <!--
+ <dependency>
+ <groupId>org.gatein.sso</groupId>
+ <artifactId>gatein-cas-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+ -->
+ </dependencies>
+
+ <profiles>
+ <!-- Install the JOSSO Agent into the Gatein Server -->
+ <profile>
+ <id>gatein-josso-install</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <version>1.40</version>
+ <executions>
+ <execution>
+ <id>agent-package</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <echo message="Preparing the JOSSO Agent for GateIn"/>
+
+ <!-- setup the directory for cas agent artifact -->
+ <delete dir="${basedir}/target/gatein"/>
+ <mkdir dir="${basedir}/target/gatein"/>
+
+ <unjar src="${gatein.location}/deploy/gatein.ear/02portal.war"
+ dest="${basedir}/target/gatein/portal.war" overwrite="true"/>
+
+ <!-- override the core artifacts -->
+ <copy todir="${basedir}/target/gatein/portal.war" overwrite="true">
+ <fileset dir="${basedir}/src/main/config/gatein/portal.war"/>
+ </copy>
+
+ <!-- jar it back up -->
+ <jar destfile="${basedir}/target/gatein/02portal.war" basedir="${basedir}/target/gatein/portal.war"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>agent-install</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+ <echo message="Deploying the JOSSO Agent for GateIn"/>
+
+ <copy file="${basedir}/target/gatein/02portal.war"
+ todir="${gatein.location}/deploy/gatein.ear"
+ overwrite="true"/>
+
+ <copy file="${basedir}/src/main/config/gatein/gatein.ear/META-INF/gatein-jboss-beans.xml"
+ tofile="${gatein.location}/deploy/gatein.ear/META-INF/gatein-jboss-beans.xml"
+ overwrite="true"/>
+
+ <!-- Deploy the Authentication Callback RESTful service -->
+ <copy file="${settings.localRepository}/org/gatein/sso/auth-callback/${project.version}/auth-callback-${project.version}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+
+ <!-- Deploy the SSO Agent -->
+ <copy file="${settings.localRepository}/org/gatein/sso/agent/${project.version}/agent-${project.version}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+
+ <!-- Deploy JOSSO Agent dependencies -->
+ <copy file="${settings.localRepository}/opensso/openssoclientsdk/${version.opensso}/openssoclientsdk-${version.opensso}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- Install the JOSSO Plugin into an JOSSO Server -->
+ <profile>
+ <id>plugin-josso-install</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <version>1.40</version>
+ <executions>
+ <execution>
+ <id>plugin-tomcat-package</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <echo message="Preparing the JOSSO Plugin for Tomcat 6.0.2......"/>
+
+ <!-- setup the directory for the plugin artifacts -->
+ <delete dir="${basedir}/target/plugin"/>
+ <mkdir dir="${basedir}/target/plugin"/>
+
+ <copy todir="${basedir}/target/plugin/lib">
+ <fileset dir="${basedir}/src/main/config/plugin/lib">
+ <include name="josso-gateway-*.xml"/>
+ </fileset>
+ </copy>
+
+ <copy todir="${basedir}/target/plugin/webapps/josso/WEB-INF/classes">
+ <fileset dir="${basedir}/src/main/config/plugin/WEB-INF/classes"/>
+ </copy>
+
+ <!-- prepare the plugin jar -->
+ <copy tofile="${basedir}/target/plugin/webapps/josso/WEB-INF/lib/gatein-josso-plugin.jar"
+ file="${settings.localRepository}/org/gatein/sso/gatein-josso-plugin/${project.version}/gatein-josso-plugin-${project.version}.jar"
+ overwrite="true"/>
+
+ <!-- copy thirdparty dependency -->
+ <copy tofile="${basedir}/target/plugin/webapps/josso/WEB-INF/lib/log4j.jar"
+ file="${settings.localRepository}/apache-log4j/log4j/${version.log4j}/log4j-${version.log4j}.jar"
+ overwrite="true"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>plugin-tomcat-install</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+ <echo message="Starting JOSSO Plugin Deployment into Tomcat 6.0.2......"/>
+
+ <!-- jar plugin -->
+ <jar destfile="${basedir}/target/plugin.jar" basedir="${basedir}/target/plugin"/>
+
+ <!-- explode the jar to install the plugin -->
+ <unjar src="${basedir}/target/plugin.jar" dest="${tomcat60.location}" overwrite="true"/>
+
+ <!-- cleanup -->
+ <delete dir="${tomcat60.location}/META-INF"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
+
Added: components/sso/trunk/packaging/josso/src/main/config/plugin/WEB-INF/classes/gatein.properties
===================================================================
--- components/sso/trunk/packaging/josso/src/main/config/plugin/WEB-INF/classes/gatein.properties (rev 0)
+++ components/sso/trunk/packaging/josso/src/main/config/plugin/WEB-INF/classes/gatein.properties 2009-12-06 17:00:34 UTC (rev 950)
@@ -0,0 +1,3 @@
+host=localhost
+port=8080
+context=portal
\ No newline at end of file
Added: components/sso/trunk/packaging/josso/src/main/config/plugin/lib/josso-gateway-config.xml
===================================================================
--- components/sso/trunk/packaging/josso/src/main/config/plugin/lib/josso-gateway-config.xml (rev 0)
+++ components/sso/trunk/packaging/josso/src/main/config/plugin/lib/josso-gateway-config.xml 2009-12-06 17:00:34 UTC (rev 950)
@@ -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: components/sso/trunk/packaging/josso/src/main/config/plugin/lib/josso-gateway-gatein-stores.xml
===================================================================
--- components/sso/trunk/packaging/josso/src/main/config/plugin/lib/josso-gateway-gatein-stores.xml (rev 0)
+++ components/sso/trunk/packaging/josso/src/main/config/plugin/lib/josso-gateway-gatein-stores.xml 2009-12-06 17:00:34 UTC (rev 950)
@@ -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>
Modified: components/sso/trunk/packaging/pom.xml
===================================================================
--- components/sso/trunk/packaging/pom.xml 2009-12-06 15:31:35 UTC (rev 949)
+++ components/sso/trunk/packaging/pom.xml 2009-12-06 17:00:34 UTC (rev 950)
@@ -15,6 +15,7 @@
<modules>
<module>cas</module>
<module>opensso</module>
+ <module>josso</module>
</modules>
</project>
15 years
gatein SVN: r949 - in components/sso/trunk: agent/src/main/java/org/gatein/sso/agent/opensso and 7 other directories.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-12-06 10:31:35 -0500 (Sun, 06 Dec 2009)
New Revision: 949
Added:
components/sso/trunk/packaging/opensso/src/main/config/plugin/WEB-INF/
components/sso/trunk/packaging/opensso/src/main/config/plugin/WEB-INF/classes/
components/sso/trunk/packaging/opensso/src/main/config/plugin/WEB-INF/classes/gatein.properties
Modified:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java
components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java
components/sso/trunk/packaging/cas/src/main/config/gatein/portal.war/WEB-INF/web.xml
components/sso/trunk/packaging/opensso/pom.xml
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/WEB-INF/web.xml
Log:
opensso integration - code stablization
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2009-12-06 14:30:49 UTC (rev 948)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2009-12-06 15:31:35 UTC (rev 949)
@@ -39,9 +39,12 @@
*/
public class GenericSSOAgent extends InitiateLoginServlet
{
+ private static final long serialVersionUID = 6330639010812906309L;
+
private static Logger log = Logger.getLogger(GenericSSOAgent.class);
- private String casServerUrl;
+ private String ssoServerUrl;
+ private String ssoCookieName;
@Override
@@ -49,7 +52,8 @@
{
super.init();
- this.casServerUrl = this.getServletConfig().getInitParameter("casServerUrl");
+ this.ssoServerUrl = this.getServletConfig().getInitParameter("ssoServerUrl");
+ this.ssoCookieName = this.getServletConfig().getInitParameter("ssoCookieName");
}
@Override
@@ -82,7 +86,7 @@
if (ticket != null && ticket.trim().length() > 0)
{
- CASAgent.getInstance(this.casServerUrl).validateTicket(httpRequest, ticket);
+ CASAgent.getInstance(this.ssoServerUrl).validateTicket(httpRequest, ticket);
}
else if (jossoAssertion != null && jossoAssertion.trim().length() > 0)
{
@@ -91,7 +95,7 @@
else
{
//See if an OpenSSO Token was used
- OpenSSOAgent.getInstance().validateTicket(httpRequest);
+ OpenSSOAgent.getInstance(this.ssoServerUrl, this.ssoCookieName).validateTicket(httpRequest);
}
}
}
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java 2009-12-06 14:30:49 UTC (rev 948)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java 2009-12-06 15:31:35 UTC (rev 949)
@@ -42,17 +42,16 @@
private static Logger log = Logger.getLogger(OpenSSOAgent.class);
private static OpenSSOAgent singleton;
- private String cookieName;
- private String openSSOUrl;
+ private String cookieName;
+ private String serverUrl;
- private OpenSSOAgent()
- {
- //TODO: make this part of externally configured properties
- this.cookieName = "iPlanetDirectoryPro";
- this.openSSOUrl = "http://localhost:8888/opensso";
+ private OpenSSOAgent(String serverUrl, String cookieName)
+ {
+ this.serverUrl = serverUrl;
+ this.cookieName = cookieName;
}
- public static OpenSSOAgent getInstance()
+ public static OpenSSOAgent getInstance(String serverUrl, String cookieName)
{
if(OpenSSOAgent.singleton == null)
{
@@ -60,33 +59,13 @@
{
if(OpenSSOAgent.singleton == null)
{
- OpenSSOAgent.singleton = new OpenSSOAgent();
+ OpenSSOAgent.singleton = new OpenSSOAgent(serverUrl, cookieName);
}
}
}
return OpenSSOAgent.singleton;
}
- public String getCookieName()
- {
- return cookieName;
- }
-
- public void setCookieName(String cookieName)
- {
- this.cookieName = cookieName;
- }
-
- public String getOpenSSOUrl()
- {
- return openSSOUrl;
- }
-
- public void setOpenSSOUrl(String openSSOUrl)
- {
- this.openSSOUrl = openSSOUrl;
- }
-
public void validateTicket(HttpServletRequest httpRequest) throws Exception
{
String token = null;
@@ -124,7 +103,7 @@
PostMethod post = null;
try
{
- String url = this.openSSOUrl+"/identity/isTokenValid";
+ String url = this.serverUrl+"/identity/isTokenValid";
post = new PostMethod(url);
post.addParameter("tokenid", token);
@@ -159,7 +138,7 @@
try
{
String uid = null;
- String url = this.openSSOUrl+"/identity/attributes";
+ String url = this.serverUrl+"/identity/attributes";
post = new PostMethod(url);
post.addParameter("subjectid", token);
post.addParameter("attributes_names", "uid");
Modified: components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java
===================================================================
--- components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java 2009-12-06 14:30:49 UTC (rev 948)
+++ components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java 2009-12-06 15:31:35 UTC (rev 949)
@@ -21,7 +21,11 @@
*/
package org.gatein.sso.opensso.plugin;
+import java.util.Properties;
import java.util.Map;
+import java.io.InputStream;
+import java.io.IOException;
+
import java.security.Principal;
import javax.security.auth.Subject;
import javax.security.auth.callback.Callback;
@@ -79,15 +83,33 @@
public AuthenticationPlugin()
{
-
}
public void init(Subject subject, Map sharedState, Map options)
{
- //TODO: make this configurable
- this.gateInHost = "localhost";
- this.gateInPort = "8080";
- this.gateInContext = "portal";
+ InputStream is = null;
+ try
+ {
+ //Load the GateIn properties
+ Properties properties = new Properties();
+ is = Thread.currentThread().getContextClassLoader().getResourceAsStream("gatein.properties");
+ properties.load(is);
+
+ this.gateInHost = properties.getProperty("host");
+ this.gateInPort = properties.getProperty("port");
+ this.gateInContext = properties.getProperty("context");
+ }
+ catch(IOException ioe)
+ {
+
+ }
+ finally
+ {
+ if(is != null)
+ {
+ try{is.close();}catch(Exception e){}
+ }
+ }
}
public int process(Callback[] callbacks, int state) throws AuthLoginException
Modified: components/sso/trunk/packaging/cas/src/main/config/gatein/portal.war/WEB-INF/web.xml
===================================================================
--- components/sso/trunk/packaging/cas/src/main/config/gatein/portal.war/WEB-INF/web.xml 2009-12-06 14:30:49 UTC (rev 948)
+++ components/sso/trunk/packaging/cas/src/main/config/gatein/portal.war/WEB-INF/web.xml 2009-12-06 15:31:35 UTC (rev 949)
@@ -182,8 +182,8 @@
<servlet-name>InitiateLoginServlet</servlet-name>
<servlet-class>org.gatein.sso.agent.GenericSSOAgent</servlet-class>
<init-param>
- <param-name>casServerUrl</param-name>
- <param-value>http://localhost:8888/cas</param-value>
+ <param-name>ssoServerUrl</param-name>
+ <param-value>http://localhost:8888/cas</param-value>
</init-param>
</servlet>
Modified: components/sso/trunk/packaging/opensso/pom.xml
===================================================================
--- components/sso/trunk/packaging/opensso/pom.xml 2009-12-06 14:30:49 UTC (rev 948)
+++ components/sso/trunk/packaging/opensso/pom.xml 2009-12-06 15:31:35 UTC (rev 949)
@@ -149,6 +149,9 @@
<copy todir="${basedir}/target/plugin/webapps/opensso/config/auth/default">
<fileset dir="${basedir}/src/main/config/plugin/config/auth/default"/>
</copy>
+ <copy todir="${basedir}/target/plugin/webapps/opensso/WEB-INF">
+ <fileset dir="${basedir}/src/main/config/plugin/WEB-INF"/>
+ </copy>
<!-- prepare the plugin jar -->
<copy tofile="${basedir}/target/plugin/webapps/opensso/WEB-INF/lib/gatein-opensso-plugin.jar"
Modified: components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/WEB-INF/web.xml
===================================================================
--- components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/WEB-INF/web.xml 2009-12-06 14:30:49 UTC (rev 948)
+++ components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/WEB-INF/web.xml 2009-12-06 15:31:35 UTC (rev 949)
@@ -182,9 +182,13 @@
<servlet-name>InitiateLoginServlet</servlet-name>
<servlet-class>org.gatein.sso.agent.GenericSSOAgent</servlet-class>
<init-param>
- <param-name>casServerUrl</param-name>
- <param-value>http://localhost:8888/cas</param-value>
- </init-param>
+ <param-name>ssoServerUrl</param-name>
+ <param-value>http://localhost:8888/opensso</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ssoCookieName</param-name>
+ <param-value>iPlanetDirectoryPro</param-value>
+ </init-param>
</servlet>
<servlet>
Added: components/sso/trunk/packaging/opensso/src/main/config/plugin/WEB-INF/classes/gatein.properties
===================================================================
--- components/sso/trunk/packaging/opensso/src/main/config/plugin/WEB-INF/classes/gatein.properties (rev 0)
+++ components/sso/trunk/packaging/opensso/src/main/config/plugin/WEB-INF/classes/gatein.properties 2009-12-06 15:31:35 UTC (rev 949)
@@ -0,0 +1,5 @@
+host=localhost
+
+port=8080
+
+context=portal
\ No newline at end of file
15 years
gatein SVN: r948 - in components/sso/trunk: agent/src/main/java/org/gatein/sso/agent/opensso and 2 other directories.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-12-06 09:30:49 -0500 (Sun, 06 Dec 2009)
New Revision: 948
Modified:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java
components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java
components/sso/trunk/packaging/opensso/pom.xml
components/sso/trunk/pom.xml
Log:
opensso integration - code stablization
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java 2009-12-05 22:19:09 UTC (rev 947)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java 2009-12-06 14:30:49 UTC (rev 948)
@@ -21,6 +21,7 @@
*/
package org.gatein.sso.agent.opensso;
+import java.io.InputStream;
import java.util.Properties;
import org.apache.log4j.Logger;
@@ -29,7 +30,6 @@
import javax.servlet.http.Cookie;
import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.exoplatform.web.security.Credentials;
import org.gatein.sso.agent.GenericSSOAgent;
@@ -117,7 +117,7 @@
}
}
}
-
+ //-------------------------------------------------------------------------------------------------------------------------------------------------------------------
private boolean isTokenValid(String token) throws Exception
{
HttpClient client = new HttpClient();
@@ -131,10 +131,10 @@
int status = client.executeMethod(post);
String response = post.getResponseBodyAsString();
- log.info("-------------------------------------------------------");
- log.info("Status: "+status);
- log.info("Response: "+response);
- log.info("-------------------------------------------------------");
+ log.debug("-------------------------------------------------------");
+ log.debug("Status: "+status);
+ log.debug("Response: "+response);
+ log.debug("-------------------------------------------------------");
if(response.contains(Boolean.TRUE.toString()))
{
@@ -157,7 +157,8 @@
HttpClient client = new HttpClient();
PostMethod post = null;
try
- {
+ {
+ String uid = null;
String url = this.openSSOUrl+"/identity/attributes";
post = new PostMethod(url);
post.addParameter("subjectid", token);
@@ -166,12 +167,19 @@
int status = client.executeMethod(post);
String response = post.getResponseBodyAsString();
- log.debug("Must Just Read the uid attribute-------------------------------------------------------");
+ log.debug("--------------------------------------------------------");
log.debug("Status: "+status);
- log.debug("Response: "+response);
+ log.debug(response);
+ log.debug("--------------------------------------------------------");
+ if(response != null)
+ {
+ Properties properties = this.loadAttributes(response);
+ uid = properties.getProperty("uid");
+ }
- return "demo";
+
+ return uid;
}
finally
{
@@ -181,4 +189,44 @@
}
}
}
+
+ private Properties loadAttributes(String response) throws Exception
+ {
+ InputStream is = null;
+ try
+ {
+ Properties properties = new Properties();
+
+ String[] tokens = response.split("\n");
+ String name = null;
+ for(String token: tokens)
+ {
+ if(token.startsWith("userdetails.attribute.name"))
+ {
+ name = token.substring(token.indexOf("=")+1);
+ }
+ else if(token.startsWith("userdetails.attribute.value"))
+ {
+ String value = token.substring(token.indexOf("=")+1);
+
+ if(name != null)
+ {
+ properties.setProperty(name, value);
+ }
+
+ //cleanup
+ name = null;
+ }
+ }
+
+ return properties;
+ }
+ finally
+ {
+ if(is != null)
+ {
+ is.close();
+ }
+ }
+ }
}
Modified: components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java
===================================================================
--- components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java 2009-12-05 22:19:09 UTC (rev 947)
+++ components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java 2009-12-06 14:30:49 UTC (rev 948)
@@ -43,6 +43,9 @@
private String gateInHost;
private String gateInPort;
private String gateInContext;
+
+ private String username;
+ private String password;
public String getGateInHost()
{
@@ -91,25 +94,17 @@
{
try
{
- System.out.println("---------------------------------------------------------------------");
- System.out.println("Performing GateIn Login..............................................");
- System.out.println("---------------------------------------------------------------------");
-
- String username = null;
- String password = null;
for (int i = 0; i < callbacks.length; i++)
{
Callback callback = callbacks[i];
if (callback instanceof NameCallback)
{
- username = ((NameCallback) callback).getName();
- System.out.println("Username: " + username);
+ this.username = ((NameCallback) callback).getName();
}
else if (callback instanceof PasswordCallback)
{
- password = new String(((PasswordCallback) callback).getPassword());
- System.out.println("Password: " + password);
+ this.password = new String(((PasswordCallback) callback).getPassword());
}
}
@@ -117,34 +112,26 @@
urlBuffer.append("http://" + this.gateInHost + ":" + this.gateInPort + "/"
+ this.gateInContext + "/rest/sso/authcallback/auth/" + username + "/"
+ password);
-
- System.out.println("-------------------------------------------------------------------");
- System.out.println("REST Request=" + urlBuffer.toString());
- System.out.println("-------------------------------------------------------------------");
-
- System.out.println("About to execute REST call........");
+
boolean success = this.executeRemoteCall(urlBuffer.toString());
-
- System.out.println("REST Call was a success....("+success+")");
+ if(!success)
+ {
+ throw new AuthLoginException("GateIn Login Callback Failed!!");
+ }
return ISAuthConstants.LOGIN_SUCCEED;
}
catch(Throwable e)
- {
- System.out.println("------------------------------------------------------");
- System.out.println("Exception :"+e.toString());
- System.out.println("Message :"+e.getMessage());
- System.out.println("------------------------------------------------------");
- e.printStackTrace();
+ {
throw new AuthLoginException(e);
}
}
public Principal getPrincipal()
{
- return new GateInPrincipal("demo");
+ return new GateInPrincipal(this.username);
}
-
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------
private boolean executeRemoteCall(String authUrl) throws Exception
{
HttpClient client = new HttpClient();
Modified: components/sso/trunk/packaging/opensso/pom.xml
===================================================================
--- components/sso/trunk/packaging/opensso/pom.xml 2009-12-05 22:19:09 UTC (rev 947)
+++ components/sso/trunk/packaging/opensso/pom.xml 2009-12-06 14:30:49 UTC (rev 948)
@@ -158,6 +158,9 @@
<!-- copy thirdparty dependency -->
<copy tofile="${basedir}/target/plugin/webapps/opensso/WEB-INF/lib/commons-httpclient.jar"
file="${settings.localRepository}/commons-httpclient/commons-httpclient/${version.commons-httpclient}/commons-httpclient-${version.commons-httpclient}.jar"
+ overwrite="true"/>
+ <copy tofile="${basedir}/target/plugin/webapps/opensso/WEB-INF/lib/commons-logging.jar"
+ file="${settings.localRepository}/commons-logging/commons-logging/${version.commons-logging}/commons-logging-${version.commons-logging}.jar"
overwrite="true"/>
</tasks>
</configuration>
Modified: components/sso/trunk/pom.xml
===================================================================
--- components/sso/trunk/pom.xml 2009-12-05 22:19:09 UTC (rev 947)
+++ components/sso/trunk/pom.xml 2009-12-06 14:30:49 UTC (rev 948)
@@ -45,6 +45,7 @@
<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>
+ <version.commons-logging>1.0.4</version.commons-logging>
<!-- cas -->
<version.cas>3.3.4</version.cas>
15 years
gatein SVN: r947 - portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-05 17:19:09 -0500 (Sat, 05 Dec 2009)
New Revision: 947
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java
Log:
remove dead code
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java 2009-12-05 22:17:48 UTC (rev 946)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java 2009-12-05 22:19:09 UTC (rev 947)
@@ -30,13 +30,9 @@
/** . */
private final ApplicationRegistryServiceImpl registry;
- /** . */
-// private final DomainSession session;
-
- public Injector(ApplicationRegistryServiceImpl registry/*, DomainSession session*/)
+ public Injector(ApplicationRegistryServiceImpl registry)
{
this.registry = registry;
-// this.session = session;
}
public void created(Object o)
@@ -45,13 +41,6 @@
public void loaded(String id, String path, String name, Object o)
{
-/*
- if (o instanceof NodeAware)
- {
- Node node = session.getNode(o);
- ((NodeAware)o).setNode(node);
- }
-*/
if (o instanceof CategoryDefinition)
{
((CategoryDefinition)o).registry = registry;
@@ -60,13 +49,6 @@
public void added(String id, String path, String name, Object o)
{
-/*
- if (o instanceof NodeAware)
- {
- Node node = session.getNode(o);
- ((NodeAware)o).setNode(node);
- }
-*/
if (o instanceof CategoryDefinition)
{
((CategoryDefinition)o).registry = registry;
@@ -75,12 +57,6 @@
public void removed(String id, String path, String name, Object o)
{
-/*
- if (o instanceof NodeAware)
- {
- ((NodeAware)o).setNode(null);
- }
-*/
if (o instanceof CategoryDefinition)
{
((CategoryDefinition)o).registry = null;
15 years
gatein SVN: r946 - portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-05 17:17:48 -0500 (Sat, 05 Dec 2009)
New Revision: 946
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
Log:
rename root content registry to "contents" instead of "registry"
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2009-12-05 22:04:13 UTC (rev 945)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2009-12-05 22:17:48 UTC (rev 946)
@@ -91,10 +91,10 @@
public ContentRegistry getContentRegistry()
{
ChromatticSession session = lifeCycle.getChromattic().openSession();
- ContentRegistry registry = session.findByPath(ContentRegistry.class, "registry");
+ ContentRegistry registry = session.findByPath(ContentRegistry.class, "contents");
if (registry == null)
{
- registry = session.insert(ContentRegistry.class, "registry");
+ registry = session.insert(ContentRegistry.class, "contents");
}
return registry;
}
15 years
gatein SVN: r945 - in portal/trunk: component/web and 8 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-05 17:04:13 -0500 (Sat, 05 Dec 2009)
New Revision: 945
Added:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ContextualTask.java
portal/trunk/component/web/src/main/java/conf/autologin-nodetypes.xml
portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TokenContainer.java
portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TokenEntry.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/autologin-configuration.xml
Modified:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticLifeCycle.java
portal/trunk/component/web/pom.xml
portal/trunk/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java
portal/trunk/component/web/src/main/java/org/exoplatform/web/security/Credentials.java
portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java
portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java
portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/security-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
portal/trunk/webui/core/pom.xml
Log:
GTNPORTAL-308 : Cookie token service with Chromattic
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticLifeCycle.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticLifeCycle.java 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticLifeCycle.java 2009-12-05 22:04:13 UTC (rev 945)
@@ -24,6 +24,7 @@
import org.exoplatform.container.xml.InitParams;
import java.util.List;
+import java.util.concurrent.Callable;
/**
* <p>The chromattic life cycle objets is a plugin that allow to bootstrap a chromattic builder and make
Added: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ContextualTask.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ContextualTask.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ContextualTask.java 2009-12-05 22:04:13 UTC (rev 945)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.commons.chromattic;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ * @param <V> the return type value
+ */
+public abstract class ContextualTask<V>
+{
+
+ /**
+ * Executes a task within a context from the specified life cycle. If an existing context already exists
+ * then this context is used otherwise a context is managed for the duration of the {@link #execute(SessionContext)}
+ * method.
+ *
+ * @param lifeCycle the life cycle
+ * @return a value
+ */
+ public final V executeWith(ChromatticLifeCycle lifeCycle)
+ {
+ SessionContext context = lifeCycle.getContext(true);
+ if (context == null)
+ {
+ context = lifeCycle.openContext();
+ try
+ {
+ return execute(context);
+ }
+ finally
+ {
+ lifeCycle.closeContext(context, true);
+ }
+ }
+ else
+ {
+ return execute(context);
+ }
+ }
+
+ /**
+ * Implementor must provide the task logic here.
+ *
+ * @param context the context
+ * @return a value
+ */
+ protected abstract V execute(SessionContext context);
+
+}
Modified: portal/trunk/component/web/pom.xml
===================================================================
--- portal/trunk/component/web/pom.xml 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/component/web/pom.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -112,6 +112,13 @@
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.apt</artifactId>
+ <version>${version.chromattic}</version>
+ <scope>compile</scope>
+ </dependency>
+
<dependency>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-federation</artifactId>
Added: portal/trunk/component/web/src/main/java/conf/autologin-nodetypes.xml
===================================================================
--- portal/trunk/component/web/src/main/java/conf/autologin-nodetypes.xml (rev 0)
+++ portal/trunk/component/web/src/main/java/conf/autologin-nodetypes.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -0,0 +1,56 @@
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="lgn:tokencontainer" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="lgn:tokenentry" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>lgn:tokenentry</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="lgn:tokenentry" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="username" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="password" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="expiration" requiredType="Date" autoCreated="true" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java 2009-12-05 22:04:13 UTC (rev 945)
@@ -61,8 +61,8 @@
String rememberme = req.getParameter("rememberme");
if ("true".equals(rememberme))
{
- boolean isRememeber = "true".equals(req.getParameter(InitiateLoginServlet.COOKIE_NAME));
- if (isRememeber)
+ boolean isRemember = "true".equals(req.getParameter(InitiateLoginServlet.COOKIE_NAME));
+ if (isRemember)
{
//Create token
AbstractTokenService tokenService = AbstractTokenService.getInstance(CookieTokenService.class);
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/web/security/Credentials.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/security/Credentials.java 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/web/security/Credentials.java 2009-12-05 22:04:13 UTC (rev 945)
@@ -28,6 +28,8 @@
public class Credentials
{
+
+
/** . */
private final String username;
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java 2009-12-05 22:04:13 UTC (rev 945)
@@ -26,6 +26,7 @@
import org.exoplatform.management.annotations.ManagedName;
import org.exoplatform.management.jmx.annotations.NameTemplate;
import org.exoplatform.management.jmx.annotations.Property;
+import org.exoplatform.web.login.InitiateLoginServlet;
import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.Token;
import org.exoplatform.web.security.TokenStore;
@@ -37,20 +38,17 @@
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.RepositoryException;
-
/**
* Created by The eXo Platform SAS Author : liem.nguyen ncliam(a)gmail.com Jun 5,
* 2009
*/
@Managed
-@NameTemplate({@Property(key = "service", value = "auth_token"), @Property(key = "name", value = "{Name}")})
-@ManagedDescription("Token Service")
+@NameTemplate({@Property(key = "service", value = "TokenStore"), @Property(key = "name", value = "{Name}")})
+@ManagedDescription("Token Store Service")
public abstract class AbstractTokenService implements Startable, TokenStore
{
- protected final String SERVICE_CONFIG = "service.configuration";
+ protected static final String SERVICE_CONFIG = "service.configuration";
protected static final int DELAY_TIME = 600;
@@ -78,14 +76,7 @@
{
public void run()
{
- try
- {
- service.cleanExpiredTokens();
- }
- catch (RepositoryException re)
- {
- System.out.println("Error occur when delete expired cookie token");
- }
+ service.cleanExpiredTokens();
}
}, 0, DELAY_TIME, TimeUnit.SECONDS);
@@ -96,11 +87,10 @@
// do nothing
}
- @SuppressWarnings("unchecked")
public static <T extends AbstractTokenService> T getInstance(Class<T> classType)
{
PortalContainer container = PortalContainer.getInstance();
- return (T)container.getComponentInstanceOfType(classType);
+ return classType.cast(container.getComponentInstanceOfType(classType));
}
public Credentials validateToken(String tokenKey, boolean remove)
@@ -144,7 +134,7 @@
@Managed
@ManagedDescription("Clean all tokens are expired")
- public void cleanExpiredTokens() throws PathNotFoundException, RepositoryException
+ public void cleanExpiredTokens()
{
String[] ids = getAllTokens();
for (String s : ids)
@@ -174,11 +164,11 @@
@Managed
@ManagedDescription("get a token by id")
- public abstract Token getToken(String id) throws PathNotFoundException, RepositoryException;
+ public abstract Token getToken(String id);
@Managed
@ManagedDescription("Delete a token by id")
- public abstract Token deleteToken(String id) throws PathNotFoundException, RepositoryException;
+ public abstract Token deleteToken(String id);
@Managed
@ManagedDescription("The list of all tokens")
@@ -203,4 +193,9 @@
return configValue * multiply;
}
}
+
+ protected String nextTokenId()
+ {
+ return InitiateLoginServlet.COOKIE_NAME + random.nextInt();
+ }
}
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java 2009-12-05 22:04:13 UTC (rev 945)
@@ -19,22 +19,18 @@
package org.exoplatform.web.security.security;
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
+import org.exoplatform.commons.chromattic.ChromatticManager;
+import org.exoplatform.commons.chromattic.ContextualTask;
+import org.exoplatform.commons.chromattic.SessionContext;
import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.services.jcr.ext.common.SessionProvider;
-import org.exoplatform.services.jcr.ext.registry.RegistryEntry;
-import org.exoplatform.services.jcr.ext.registry.RegistryService;
-import org.exoplatform.web.login.InitiateLoginServlet;
import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.Token;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
-import javax.jcr.NodeIterator;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.RepositoryException;
-
/**
* Created by The eXo Platform SAS Author : liem.nguyen ncliam(a)gmail.com Jun 5,
* 2009
@@ -42,15 +38,22 @@
public class CookieTokenService extends AbstractTokenService
{
- private RegistryService regService_;
+ /** . */
+ private ChromatticManager chromatticManager;
- public CookieTokenService(InitParams initParams, RegistryService rService)
+ /** . */
+ private ChromatticLifeCycle chromatticLifeCycle;
+
+ public CookieTokenService(InitParams initParams, ChromatticManager chromatticManager)
{
super(initParams);
- regService_ = rService;
+
+ //
+ this.chromatticManager = chromatticManager;
+ this.chromatticLifeCycle = chromatticManager.getLifeCycle("autologin");
}
- public String createToken(Credentials credentials)
+ public String createToken(final Credentials credentials)
{
if (validityMillis < 0)
{
@@ -60,163 +63,117 @@
{
throw new NullPointerException();
}
- String tokenId = InitiateLoginServlet.COOKIE_NAME + random.nextInt();
- long expirationTimeMillis = System.currentTimeMillis() + validityMillis;
- this.saveToken(tokenId, new Token(expirationTimeMillis, credentials));
- return tokenId;
+ return new TokenTask<String>() {
+ @Override
+ protected String execute()
+ {
+ String tokenId = nextTokenId();
+ long expirationTimeMillis = System.currentTimeMillis() + validityMillis;
+ Token token = new Token(expirationTimeMillis, credentials);
+ TokenContainer container = getTokenContainer();
+ container.saveToken(tokenId, token.getPayload(), new Date(token.getExpirationTimeMillis()));
+ return tokenId;
+ }
+ }.executeWith(chromatticLifeCycle);
}
@Override
- public Token getToken(String id) throws PathNotFoundException, RepositoryException
+ public Token getToken(final String id)
{
- String entryPath = getServiceRegistryPath() + "/" + id;
- SessionProvider sessionProvider = SessionProvider.createSystemProvider();
- try
- {
- RegistryEntry entry = regService_.getEntry(sessionProvider, entryPath);
- return toToken(entry.getDocument());
- }
- finally
- {
- sessionProvider.close();
- }
+ return new TokenTask<Token>() {
+ @Override
+ protected Token execute()
+ {
+ return getTokenContainer().getToken(id);
+ }
+ }.executeWith(chromatticLifeCycle);
}
@Override
- public Token deleteToken(String id) throws PathNotFoundException, RepositoryException
+ public Token deleteToken(final String id)
{
- Token data = getToken(id);
- if (data == null)
- return null;
- String entryPath = getServiceRegistryPath() + "/" + id;
- SessionProvider sessionProvider = SessionProvider.createSystemProvider();
- try
- {
- regService_.removeEntry(sessionProvider, entryPath);
- return data;
- }
- finally
- {
- sessionProvider.close();
- }
+ return new TokenTask<Token>() {
+ @Override
+ protected Token execute()
+ {
+ return getTokenContainer().removeToken(id);
+ }
+ }.executeWith(chromatticLifeCycle);
}
- private void saveToken(String tokenId, Token token)
+ @Override
+ public String[] getAllTokens()
{
- if (tokenId == null || tokenId.length() == 0 || token == null)
- {
- return;
- }
- SessionProvider sessionProvider = SessionProvider.createSystemProvider();
- String servicePath = getServiceRegistryPath();
- String entryPath = servicePath + "/" + tokenId;
- RegistryEntry entry;
- try
- {
- try
+ return new TokenTask<String[]>() {
+ @Override
+ protected String[] execute()
{
- entry = regService_.getEntry(sessionProvider, entryPath);
+ TokenContainer container = getTokenContainer();
+ Collection<TokenEntry> tokens = container.getAllTokens();
+ String[] ids = new String[tokens.size()];
+ int count = 0;
+ for (TokenEntry token : tokens)
+ {
+ ids[count++] = token.getId();
+ }
+ return ids;
}
- catch (PathNotFoundException e)
- {
- entry = new RegistryEntry(tokenId);
- regService_.createEntry(sessionProvider, servicePath, entry);
- }
- Document doc = entry.getDocument();
- map(doc, token);
- regService_.recreateEntry(sessionProvider, servicePath, entry);
- }
- catch (Exception e)
- {
- }
- finally
- {
- sessionProvider.close();
- }
+ }.executeWith(chromatticLifeCycle);
}
- private Token toToken(Document document)
+ @Override
+ public long getNumberTokens() throws Exception
{
- Element root = document.getDocumentElement();
- String userName = root.getAttribute(Token.USERNAME);
- String password = root.getAttribute(Token.PASSWORD);
- long time = Long.parseLong(root.getAttribute(Token.EXPIRE_MILI));
- Credentials payload = new Credentials(userName, password);
- return new Token(time, payload);
+ return new TokenTask<Long>() {
+ @Override
+ protected Long execute()
+ {
+ TokenContainer container = getTokenContainer();
+ Collection<TokenEntry> tokens = container.getAllTokens();
+ return (long)tokens.size();
+ }
+ }.executeWith(chromatticLifeCycle);
}
- private void map(Document document, Token token)
+ /**
+ * Wraps token store logic conveniently.
+ *
+ * @param <V> the return type
+ */
+ private abstract class TokenTask<V> extends ContextualTask<V>
{
- Element root = document.getDocumentElement();
- prepareXmlNamespace(root);
- root.setAttribute(Token.EXPIRE_MILI, "" + token.getExpirationTimeMillis());
- root.setAttribute(Token.USERNAME, token.getPayload().getUsername());
- root.setAttribute(Token.PASSWORD, token.getPayload().getPassword());
- }
- private void prepareXmlNamespace(Element element)
- {
- setXmlNameSpace(element, "xmlns:exo", "http://www.exoplatform.com/jcr/exo/1.0");
- setXmlNameSpace(element, "xmlns:jcr", "http://www.jcp.org/jcr/1.0");
- }
+ /** . */
+ private SessionContext context;
- private void setXmlNameSpace(Element element, String key, String value)
- {
- String xmlns = element.getAttribute(key);
- if (xmlns == null || xmlns.trim().length() < 1)
- {
- element.setAttribute(key, value);
+ protected final TokenContainer getTokenContainer() {
+ SessionContext ctx = chromatticLifeCycle.getContext();
+ ChromatticSession session = ctx.getSession();
+ TokenContainer container = session.findByPath(TokenContainer.class, "autologin");
+ if (container == null)
+ {
+ container = session.insert(TokenContainer.class, "autologin");
+ }
+ return container;
}
- }
- private String getServiceRegistryPath()
- {
- return RegistryService.EXO_SERVICES + "/" + name;
- }
-
- @Override
- public String[] getAllTokens()
- {
- SessionProvider sessionProvider = SessionProvider.createSystemProvider();
- try
+ @Override
+ protected V execute(SessionContext context)
{
- javax.jcr.Node regNode = regService_.getRegistry(sessionProvider).getNode();
- NodeIterator itr = regNode.getNode(getServiceRegistryPath()).getNodes();
- ArrayList<String> list = new ArrayList<String>();
- while (itr.hasNext())
+ this.context = context;
+
+ //
+ try
{
- javax.jcr.Node node = itr.nextNode();
- list.add(node.getName());
+ return execute();
}
- return list.toArray(new String[]{});
+ finally
+ {
+ this.context = null;
+ }
}
- catch (RepositoryException e)
- {
- return null;
- }
- finally
- {
- sessionProvider.close();
- }
- }
- @Override
- public long getNumberTokens() throws Exception
- {
- SessionProvider sessionProvider = SessionProvider.createSystemProvider();
- try
- {
- javax.jcr.Node regNode = regService_.getRegistry(sessionProvider).getNode();
- NodeIterator itr = regNode.getNode(getServiceRegistryPath()).getNodes();
- return itr.getSize();
- }
- catch (Exception ex)
- {
- return 0;
- }
- finally
- {
- sessionProvider.close();
- }
+ protected abstract V execute();
+
}
}
Added: portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TokenContainer.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TokenContainer.java (rev 0)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TokenContainer.java 2009-12-05 22:04:13 UTC (rev 945)
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.web.security.security;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToMany;
+import org.exoplatform.web.security.Credentials;
+import org.exoplatform.web.security.Token;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = "lgn:tokencontainer")
+public abstract class TokenContainer
+{
+
+ @Create
+ protected abstract TokenEntry createToken();
+
+ @OneToMany
+ protected abstract Map<String, TokenEntry> getTokens();
+
+ public Collection<TokenEntry> getAllTokens()
+ {
+ return getTokens().values();
+ }
+
+ public Token getToken(String tokenId)
+ {
+ Map<String, TokenEntry> tokens = getTokens();
+ TokenEntry entry = tokens.get(tokenId);
+ return entry != null ? entry.getToken() : null;
+ }
+
+ public Token removeToken(String tokenId)
+ {
+ Map<String, TokenEntry> tokens = getTokens();
+ TokenEntry entry = tokens.get(tokenId);
+ if (entry != null)
+ {
+ Token token = entry.getToken();
+ entry.remove();
+ return token;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public Token saveToken(String tokenId, Credentials credentials, Date expirationTime)
+ {
+ Map<String, TokenEntry> tokens = getTokens();
+ TokenEntry entry = tokens.get(tokenId);
+ if (entry == null)
+ {
+ entry = createToken();
+ tokens.put(tokenId, entry);
+ entry.setUserName(credentials.getUsername());
+ entry.setPassword(credentials.getPassword());
+ }
+ entry.setExpirationTime(expirationTime);
+ return entry.getToken();
+ }
+
+}
Added: portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TokenEntry.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TokenEntry.java (rev 0)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TokenEntry.java 2009-12-05 22:04:13 UTC (rev 945)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.web.security.security;
+
+import org.chromattic.api.annotations.Destroy;
+import org.chromattic.api.annotations.Name;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.Property;
+import org.exoplatform.web.security.Credentials;
+import org.exoplatform.web.security.Token;
+
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = "lgn:tokenentry")
+public abstract class TokenEntry
+{
+
+ @Name
+ public abstract String getId();
+
+ @Property(name = "username")
+ public abstract String getUserName();
+
+ public abstract void setUserName(String userName);
+
+ @Property(name = "password")
+ public abstract String getPassword();
+
+ public abstract void setPassword(String password);
+
+ @Property(name = "expiration")
+ public abstract Date getExpirationTime();
+
+ public abstract void setExpirationTime(Date expirationTime);
+
+ @Destroy
+ public abstract void remove();
+
+ public Token getToken()
+ {
+ return new Token(
+ getExpirationTime().getTime(),
+ new Credentials(getUserName(), getPassword()));
+ }
+
+}
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java 2009-12-05 22:04:13 UTC (rev 945)
@@ -20,15 +20,11 @@
package org.exoplatform.web.security.security;
import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.web.login.InitiateLoginServlet;
import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.Token;
import java.util.concurrent.ConcurrentHashMap;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.RepositoryException;
-
/**
* Created by The eXo Platform SAS Author : liem.nguyen ncliam(a)gmail.com Jun 5,
* 2009
@@ -53,20 +49,20 @@
{
throw new NullPointerException();
}
- String tokenId = InitiateLoginServlet.COOKIE_NAME + random.nextInt();
+ String tokenId = nextTokenId();
long expirationTimeMillis = System.currentTimeMillis() + validityMillis;
tokens.put(tokenId, new Token(expirationTimeMillis, credentials));
return tokenId;
}
@Override
- public Token getToken(String id) throws PathNotFoundException, RepositoryException
+ public Token getToken(String id)
{
return tokens.get(id);
}
@Override
- public Token deleteToken(String id) throws PathNotFoundException, RepositoryException
+ public Token deleteToken(String id)
{
Token token = tokens.get(id);
tokens.remove(id);
Added: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/autologin-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/autologin-configuration.xml (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/autologin-configuration.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+
+<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>
+ <key>org.exoplatform.web.security.security.CookieTokenService</key>
+ <type>org.exoplatform.web.security.security.CookieTokenService</type>
+ <init-params>
+ <values-param>
+ <name>service.configuration</name>
+ <value>jcr-token</value>
+ <value>7</value>
+ <value>DAY</value>
+ </values-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.web.security.security.TransientTokenService</key>
+ <type>org.exoplatform.web.security.security.TransientTokenService</type>
+ <init-params>
+ <values-param>
+ <name>service.configuration</name>
+ <value>memory-token</value>
+ <value>1</value>
+ <value>MINUTE</value>
+ </values-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
+ <component-plugin>
+ <name>chromattic</name>
+ <set-method>addLifeCycle</set-method>
+ <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>autologin</value>
+ </value-param>
+ <value-param>
+ <name>workspace-name</name>
+ <value>portal-work</value>
+ </value-param>
+ <values-param>
+ <name>entities</name>
+ <value>org.exoplatform.web.security.security.TokenContainer</value>
+ <value>org.exoplatform.web.security.security.TokenEntry</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -37,34 +37,6 @@
</properties-param>
</init-params>
</component>
-
- <!-- ********************* CONFIGURE TOKEN SERVICE ************************* -->
- <component>
- <key>org.exoplatform.web.security.security.CookieTokenService</key>
- <type>org.exoplatform.web.security.security.CookieTokenService</type>
- <init-params>
- <values-param>
- <name>service.configuration</name>
- <value>jcr-token</value>
- <value>7</value>
- <value>DAY</value>
- </values-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.web.security.security.TransientTokenService</key>
- <type>org.exoplatform.web.security.security.TransientTokenService</type>
- <init-params>
- <values-param>
- <name>service.configuration</name>
- <value>memory-token</value>
- <value>1</value>
- <value>MINUTE</value>
- </values-param>
- </init-params>
- </component>
- <!-- ********************* END CONFIGURE TOKEN SERVICE ************************* -->
<component>
<key>org.exoplatform.services.resources.LocaleConfigService</key>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/security-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/security-configuration.xml 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/security-configuration.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -38,4 +38,55 @@
</value-param>
</init-params>
</component>
+
+ <component>
+ <key>org.exoplatform.web.security.security.CookieTokenService</key>
+ <type>org.exoplatform.web.security.security.CookieTokenService</type>
+ <init-params>
+ <values-param>
+ <name>service.configuration</name>
+ <value>jcr-token</value>
+ <value>7</value>
+ <value>DAY</value>
+ </values-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.web.security.security.TransientTokenService</key>
+ <type>org.exoplatform.web.security.security.TransientTokenService</type>
+ <init-params>
+ <values-param>
+ <name>service.configuration</name>
+ <value>memory-token</value>
+ <value>1</value>
+ <value>MINUTE</value>
+ </values-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
+ <component-plugin>
+ <name>chromattic</name>
+ <set-method>addLifeCycle</set-method>
+ <type>org.exoplatform.portal.pom.config.MOPChromatticLifeCycle</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>token</value>
+ </value-param>
+ <value-param>
+ <name>workspace-name</name>
+ <value>portal-work</value>
+ </value-param>
+ <values-param>
+ <name>entities</name>
+ <value>org.exoplatform.web.security.security.TokenContainer</value>
+ <value>org.exoplatform.web.security.security.TokenEntry</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
</configuration>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -28,6 +28,7 @@
<import>war:/conf/common/portlet-container-configuration.xml</import>
<import>war:/conf/common/wsrp-configuration.xml</import>
<import>war:/conf/common/logs-configuration.xml</import>
+ <import>war:/conf/common/autologin-configuration.xml</import>
<import>war:/conf/database/database-configuration.xml</import>
<import>war:/conf/jcr/jcr-configuration.xml</import>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -106,6 +106,8 @@
<name>namespaces</name>
<property name="dc" value="http://purl.org/dc/elements/1.1/"/>
<property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
+ <property name="app" value="http://www.gatein.org/jcr/application-registry/1.0/"/>
+ <property name="lgn" value="http://www.gatein.org/jcr/autologin/1.0/"/>
</properties-param>
</init-params>
</component-plugin>
@@ -119,11 +121,13 @@
<description>Node types configuration file</description>
<value>jar:/conf/ext-nodetypes-config.xml</value>
<value>jar:/conf/organization-nodetypes.xml</value>
- <value>jar:/conf/mop-nodetypes.xml</value>
- <value>jar:/conf/portal/portal-nodetypes.xml</value>
+ <value>jar:/conf/mop-nodetypes.xml</value>
+ <value>jar:/conf/application-nodetypes.xml</value>
+ <value>jar:/conf/content-nodetypes.xml</value>
+ <value>jar:/conf/autologin-nodetypes.xml</value>
</values-param>
</init-params>
</component-plugin>
</external-component-plugins>
-
+
</configuration>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -57,7 +57,7 @@
</properties-param>
</init-params>
</component>
-
+
<component>
<key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
<type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
@@ -106,7 +106,8 @@
<name>namespaces</name>
<property name="dc" value="http://purl.org/dc/elements/1.1/"/>
<property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
- <property name="app" value="http://www.gatein.org/jcr/app/1.0/"/>
+ <property name="app" value="http://www.gatein.org/jcr/application-registry/1.0/"/>
+ <property name="lgn" value="http://www.gatein.org/jcr/autologin/1.0/"/>
</properties-param>
</init-params>
</component-plugin>
@@ -123,8 +124,10 @@
<value>jar:/conf/mop-nodetypes.xml</value>
<value>jar:/conf/application-nodetypes.xml</value>
<value>jar:/conf/content-nodetypes.xml</value>
+ <value>jar:/conf/autologin-nodetypes.xml</value>
</values-param>
</init-params>
</component-plugin>
</external-component-plugins>
+
</configuration>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -1,17 +1,17 @@
<!--
Copyright (C) 2009 eXo Platform SAS.
-
+
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
@@ -20,17 +20,19 @@
-->
<repository-service default-repository="repository">
- <repositories>
+ <repositories>
<repository name="repository" system-workspace="system" default-workspace="portal-system">
- <security-domain>gatein-domain</security-domain>
- <access-control>optional</access-control>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="system">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="${dialect}"/>
+ <security-domain>gatein-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+
+ <!-- System -->
+ <workspaces>
+ <workspace name="system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
@@ -47,37 +49,39 @@
</value-storage>
</value-storages>
</container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="../temp/jcrlucenedb/system${container.name.suffix}"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/system${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- <workspace name="portal-system">
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/system${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/system${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+
+ <!-- Portal system data -->
+ <workspace name="portal-system">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="${dialect}"/>
+ <property name="dialect" value="hsqldb"/>
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
@@ -94,12 +98,61 @@
</value-storage>
</value-storages>
</container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/portal-system${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/portal-system${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+
+ <!-- Portal work data -->
+ <workspace name="portal-work">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/portal-work${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="portal-work" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/portal-work${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
<cache enabled="true">
<properties>
<property name="max-size" value="20000"/>
@@ -108,19 +161,20 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="../temp/jcrlucenedb/portal-system${container.name.suffix}"/>
+ <property name="index-dir" value="../temp/jcrlucenedb/portal-work${container.name.suffix}"/>
</properties>
</query-handler>
<lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/portal-system${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/portal-work${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
</workspace>
- </workspaces>
+
+ </workspaces>
</repository>
</repositories>
</repository-service>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -20,60 +20,15 @@
-->
<repository-service default-repository="repository">
- <repositories>
+ <repositories>
<repository name="repository" system-workspace="system" default-workspace="portal-system">
- <security-domain>gatein-domain</security-domain>
- <access-control>optional</access-control>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="system">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="hsqldb"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/system${container.name.suffix}"/>
- </properties>
- <value-storages>
- <value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="../temp/values/system${container.name.suffix}"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="../temp/jcrlucenedb/system${container.name.suffix}"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/system${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- <workspace name="portal-system">
+ <security-domain>gatein-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+
+ <!-- System -->
+ <workspaces>
+ <workspace name="system">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcexo${container.name.suffix}"/>
@@ -81,6 +36,55 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/system${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/system${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/system${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/system${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+
+ <!-- Portal system data -->
+ <workspace name="portal-system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
<property name="swap-directory" value="../temp/swap/portal-system${container.name.suffix}"/>
</properties>
<value-storages>
@@ -94,12 +98,61 @@
</value-storage>
</value-storages>
</container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/portal-system${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/portal-system${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+
+ <!-- Portal work data -->
+ <workspace name="portal-work">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/portal-work${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="portal-work" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/portal-work${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
<cache enabled="true">
<properties>
<property name="max-size" value="20000"/>
@@ -108,19 +161,20 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="../temp/jcrlucenedb/portal-system${container.name.suffix}"/>
+ <property name="index-dir" value="../temp/jcrlucenedb/portal-work${container.name.suffix}"/>
</properties>
</query-handler>
<lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/portal-system${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/portal-work${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
</workspace>
- </workspaces>
+
+ </workspaces>
</repository>
</repositories>
</repository-service>
Modified: portal/trunk/webui/core/pom.xml
===================================================================
--- portal/trunk/webui/core/pom.xml 2009-12-05 22:01:42 UTC (rev 944)
+++ portal/trunk/webui/core/pom.xml 2009-12-05 22:04:13 UTC (rev 945)
@@ -68,6 +68,15 @@
</execution>
</executions>
</plugin>
+
+ <!-- -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArgument>-proc:none</compilerArgument>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
15 years
gatein SVN: r944 - in components/sso/trunk: packaging/opensso and 1 other directory.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-12-05 17:01:42 -0500 (Sat, 05 Dec 2009)
New Revision: 944
Modified:
components/sso/trunk/gatein-opensso-plugin/
components/sso/trunk/packaging/opensso/
Log:
svn ignore
Property changes on: components/sso/trunk/gatein-opensso-plugin
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: components/sso/trunk/packaging/opensso
___________________________________________________________________
Name: svn:ignore
+ target
15 years