JBoss Portal SVN: r13227 - in modules/identity/trunk/sso/src: test/java/org/jboss/portal/test/identity/sso and 1 other directory.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-04-17 17:46:06 -0400 (Fri, 17 Apr 2009)
New Revision: 13227
Modified:
modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLogoutValve.java
modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/JOSSOTestCase.java
Log:
JBEPP-33 - no validation for cookie value with SSO
Modified: modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLogoutValve.java
===================================================================
--- modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLogoutValve.java 2009-04-17 06:02:23 UTC (rev 13226)
+++ modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLogoutValve.java 2009-04-17 21:46:06 UTC (rev 13227)
@@ -26,7 +26,6 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.Cookie;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
@@ -47,77 +46,15 @@
{
HttpServletRequest httpRequest = (HttpServletRequest) request;
request.setAttribute("ssoEnabled", "true");
-
- Cookie jossoPortalCookie = this.findJOSSOPortalLogoutCookie(httpRequest);
- if(jossoPortalCookie != null)
- {
- String referer = jossoPortalCookie.getValue();
-
- if(referer != null && referer.trim().length() > 0)
- {
- //Delete this cookie
- jossoPortalCookie = new Cookie("JOSSO_PORTAL_LOGOUT", "");
- jossoPortalCookie.setMaxAge(0); //setting the value to 0 should delete this cookie from the browser
- response.addCookie(jossoPortalCookie);
-
- //This form of redirect is needed instead of sendRedirect
- //otherwise the JBOSS_PORTAL_LOGOUT cookie cleanup does not happen
- StringBuffer buffer = new StringBuffer();
- buffer.append("<html>"+"\n");
- buffer.append("<head>"+"\n");
- buffer.append("</head>"+"\n");
- buffer.append("<body onload=\"setTimeout('document.form1.submit()',1000);\">"+"\n");
- buffer.append("<form name=\"form1\" action=\""+referer+"\" method=\"post\">"+"\n");
- buffer.append("</form>"+"\n");
- buffer.append("</body>"+"\n");
- buffer.append("</html>"+"\n");
-
- response.getOutputStream().write(buffer.toString().getBytes());
- response.getOutputStream().flush();
-
- return;
- }
- }
-
- // continue processing the request
+
+ //Logout not activated, Continue processing the request through the system
this.getNext().invoke(request, response);
+ //Check if Logout was activated...If so, perform a JOSSO logout
if(request.getAttribute("org.jboss.portal.logout") != null)
{
- String jossoLogout = httpRequest.getContextPath() + "/josso_logout/";
-
- Cookie cookie = new Cookie("JOSSO_PORTAL_LOGOUT",httpRequest.getHeader("Referer"));
- cookie.setMaxAge(-1); //setting the value so that cookie expires when broser is closed
- response.addCookie(cookie);
-
+ String jossoLogout = httpRequest.getContextPath() + "/josso_logout/";
response.sendRedirect(jossoLogout);
}
- }
-
- /**
- *
- * @param request
- * @return
- */
- private Cookie findJOSSOPortalLogoutCookie(HttpServletRequest request)
- {
- Cookie cookie = null;
-
- Cookie[] cookies = request.getCookies();
- if(cookies != null)
- {
- for(int i=0; i<cookies.length; i++)
- {
- Cookie cour = cookies[i];
-
- if(cour.getName().equals("JOSSO_PORTAL_LOGOUT"))
- {
- cookie = cour;
- break;
- }
- }
- }
-
- return cookie;
- }
+ }
}
Modified: modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/JOSSOTestCase.java
===================================================================
--- modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/JOSSOTestCase.java 2009-04-17 06:02:23 UTC (rev 13226)
+++ modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/JOSSOTestCase.java 2009-04-17 21:46:06 UTC (rev 13227)
@@ -32,7 +32,6 @@
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.protocol.Protocol;
import junit.framework.TestCase;
@@ -58,13 +57,10 @@
*
*/
protected void setUp() throws Exception
- {
- //SSL setup
- Protocol.registerProtocol("https",new Protocol("https", new EasySSLProtocolSocketFactory(), 443));
-
- this.firstPortal = "http://josso-01/portal";
- this.secondPortal = "http://josso-02/portal";
- this.sameHostSecondPortal = "http://josso-01/portal2";
+ {
+ this.firstPortal = "http://josso-01:8080/portal";
+ this.secondPortal = "http://josso-02:8080/portal";
+ this.sameHostSecondPortal = "http://josso-01:8080/portal2";
this.jossoServer = "josso-01";
this.userLoggedInIndicator = "Logged in as:";
this.username = "user";
@@ -203,7 +199,7 @@
{
this.sameHostSecondPortal = sameHostSecondPortal;
}
-
+ //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
/**
* This tests the scenario when the two portals are deployed on separate hosts/servers
*
@@ -211,29 +207,28 @@
*/
public void testMultiHostDeployment() throws Exception
{
- Cookie ssoCookie = null;
String firstPortalFinalResponse = null;
String secondPortalFinalResponse = null;
//Load the main portal page on firstPortalContext
String firstContextPortalUrl = this.firstPortal;
- WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
- TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
+ WebConversation firstPortalConversation = this.startConversation(firstContextPortalUrl);
+ TestCase.assertFalse(this.isUserLoggedIn(firstPortalConversation.getResponse()));
//Click the Login link on the firstPortalContext
String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
- this.sendGet(firstContextLoginUrl, portalConversation);
+ this.sendGet(firstContextLoginUrl, firstPortalConversation, false);
//Navigate to a secured resource on the portal
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- String portalToJOSSO = portalConversation.getRedirectLocation();
- this.sendGet(portalToJOSSO, portalConversation);
+ TestCase.assertNotNull(firstPortalConversation.getRedirectLocation());
+ TestCase.assertEquals(firstPortalConversation.getStatusCode(), 302);
+ String portalToJOSSO = firstPortalConversation.getRedirectLocation();
+ this.sendGet(portalToJOSSO, firstPortalConversation, false);
//When authentication is triggered, move over to the JOSSO server establishing an SSO session with JOSSO
- String jossoLocation = portalConversation.getRedirectLocation();
- WebConversation ssoConversation = this.startConversation(jossoLocation);
- String response = ssoConversation.getResponse();
+ String jossoLocation = firstPortalConversation.getRedirectLocation();
+ WebConversation gatewayConversation = this.startConversation(jossoLocation);
+ String response = gatewayConversation.getResponse();
//Extract the josso post action value
int searchIndex = response.indexOf("action=\"")+9;
@@ -245,43 +240,46 @@
postParams.put("josso_username", this.username);
postParams.put("josso_password", this.password);
postParams.put("josso_cmd", "login");
- this.sendPost("http:"+ this.jossoServer +"/"+action,postParams, ssoConversation);
-
- //Go back to the Portal since login has succeeded, starting with assertion on the JOSSO Agent installed on the Portal
- String assertUrl = ssoConversation.getRedirectLocation();
- this.sendGet(assertUrl, portalConversation);
-
+ this.sendPost("http://"+ this.jossoServer +":8080/"+action,postParams, gatewayConversation);
+ String assertUrl = gatewayConversation.getRedirectLocation();
+ this.sendGet(assertUrl, firstPortalConversation, false);
+
//Now go back to the original Portal resource requested. This time user should have an authenticated session established
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- TestCase.assertTrue(portalConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
- TestCase.assertNotNull(portalConversation.getSSOCookie());
- String goBack = portalConversation.getRedirectLocation();
- ssoCookie = ssoConversation.getSSOCookie();
- this.sendGet(goBack, portalConversation);
- firstPortalFinalResponse = portalConversation.getResponse();
+ TestCase.assertNotNull(firstPortalConversation.getRedirectLocation());
+ TestCase.assertEquals(firstPortalConversation.getStatusCode(), 302);
+ TestCase.assertTrue(firstPortalConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
+ TestCase.assertNotNull(firstPortalConversation.getSSOCookie());
+ String goBack = firstPortalConversation.getRedirectLocation();
+ this.sendGet(goBack, firstPortalConversation, false);
+ firstPortalFinalResponse = firstPortalConversation.getResponse();
TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
+
//Load the main portal page on secondPortalContext
String secondContextPortalUrl = this.secondPortal;
- portalConversation = this.startConversation(secondContextPortalUrl);
+ WebConversation secondPortalConversation = this.startConversation(secondContextPortalUrl);
//Click the Login Link on the secondPortalContext
String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
- this.sendGet(secondContextLoginUrl, portalConversation);
+ this.sendGet(secondContextLoginUrl, secondPortalConversation, false);
//Perform re-direct to the JOSSO Server but this time sending in the JOSSO cookie
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- portalToJOSSO = portalConversation.getRedirectLocation();
- this.sendGet(portalToJOSSO, portalConversation);
+ TestCase.assertNotNull(secondPortalConversation.getRedirectLocation());
+ TestCase.assertEquals(secondPortalConversation.getStatusCode(), 302);
+ portalToJOSSO = secondPortalConversation.getRedirectLocation();
+ this.sendGet(portalToJOSSO, secondPortalConversation, false);
//Assert the redirect and it should be to the JOSSO Server, but this time
//It should end up with an Authenticated session back to the secondPortalContext
- jossoLocation = portalConversation.getRedirectLocation();
- ssoConversation = this.startConversation(jossoLocation,ssoCookie);
- secondPortalFinalResponse = ssoConversation.getResponse();
+ jossoLocation = secondPortalConversation.getRedirectLocation();
+ this.sendGet(jossoLocation, gatewayConversation, false);
+ assertUrl = gatewayConversation.getRedirectLocation();
+ this.sendGet(assertUrl, secondPortalConversation, true);
+
+
+ //Assert that automatic login occurred
+ secondPortalFinalResponse = secondPortalConversation.getResponse();
TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
//Assert and make sure its the same user logged into both Portals
@@ -380,13 +378,7 @@
TestCase.assertEquals(secondPortalUser, this.username);
TestCase.assertEquals(firstPortalUser, secondPortalUser);
}*/
-
- /**
- *
- * @param portalUrl
- * @return
- * @throws Exception
- */
+ //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
private WebConversation startConversation(String portalUrl) throws Exception
{
WebConversation conversation = null;
@@ -405,7 +397,7 @@
{
if(cookies[i].getName().equals("JSESSIONID"))
{
- conversation.setSessionId(cookies[i].getValue());
+ conversation.setSessionCookie(cookies[i]);
}
}
@@ -422,67 +414,14 @@
}
return conversation;
- }
-
- /**
- *
- * @param portalUrl
- * @return
- * @throws Exception
- */
- private WebConversation startConversation(String portalUrl, Cookie ssoCookie) throws Exception
+ }
+
+ private void sendGet(String portalUrl,WebConversation conversation, boolean followRedirects) throws Exception
{
- WebConversation conversation = null;
-
- HttpClient httpClient = new HttpClient();
- GetMethod getMethod = new GetMethod(portalUrl);
-
- //Set ssoCookie to be sent in
- getMethod.setRequestHeader("Cookie",ssoCookie.getName()+"="+ssoCookie.getValue());
-
- try
- {
- conversation = new WebConversation();
-
- int statusCode = httpClient.executeMethod(getMethod);
- String response = getMethod.getResponseBodyAsString();
-
- Cookie[] cookies = httpClient.getState().getCookies();
- for(int i=0;i<cookies.length;i++)
- {
- if(cookies[i].getName().equals("JSESSIONID"))
- {
- conversation.setSessionId(cookies[i].getValue());
- }
- }
-
- conversation.setClient(httpClient);
- conversation.setStatusCode(statusCode);
- conversation.setResponse(response);
- }
- finally
- {
- if(getMethod != null)
- {
- getMethod.releaseConnection();
- }
- }
-
- return conversation;
- }
-
- /**
- *
- * @param portalUrl
- * @param conversation
- * @throws Exception
- */
- private void sendGet(String portalUrl,WebConversation conversation) throws Exception
- {
HttpClient httpClient = conversation.getClient();
GetMethod getMethod = new GetMethod(portalUrl);
- getMethod.setFollowRedirects(false);
+ getMethod.setFollowRedirects(followRedirects);
try
{
int statusCode = httpClient.executeMethod(getMethod);
@@ -494,7 +433,7 @@
{
if(cookies[i].getName().equals("JSESSIONID"))
{
- conversation.setSessionId(cookies[i].getValue());
+ conversation.setSessionCookie(cookies[i]);
}
if(cookies[i].getName().equals("JOSSO_SESSIONID"))
{
@@ -520,15 +459,7 @@
}
}
}
-
-
- /**
- *
- * @param url
- * @param parameters
- * @param conversation
- * @throws Exception
- */
+
private void sendPost(String url,Map parameters,WebConversation conversation) throws Exception
{
HttpClient httpClient = conversation.getClient();
@@ -557,7 +488,7 @@
{
if(cookies[i].getName().equals("JSESSIONID"))
{
- conversation.setSessionId(cookies[i].getValue());
+ conversation.setSessionCookie(cookies[i]);
}
if(cookies[i].getName().equals("JOSSO_SESSIONID"))
{
@@ -583,12 +514,7 @@
}
}
}
-
- /**
- *
- * @param response
- * @return
- */
+
private boolean isUserLoggedIn(String response)
{
boolean isUserLoggedIn = false;
@@ -597,12 +523,7 @@
return isUserLoggedIn;
}
-
- /**
- *
- * @param response
- * @return
- */
+
private String extractLoggedInUser(String response)
{
String loggedInUser = null;
@@ -614,23 +535,18 @@
return loggedInUser;
}
-
- /**
- *
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
+
private static class WebConversation
{
/**
*
*/
- private HttpClient client = null;
- private String sessionId = null;
+ private HttpClient client = null;
private int statusCode = 0;
private String response = null;
private String redirectLocation = null;
private Cookie ssoCookie = null;
+ private Cookie sessionCookie = null;
/**
*
@@ -679,16 +595,6 @@
this.statusCode = statusCode;
}
- public String getSessionId()
- {
- return sessionId;
- }
-
- public void setSessionId(String sessionId)
- {
- this.sessionId = sessionId;
- }
-
public String getRedirectLocation()
{
return redirectLocation;
@@ -708,5 +614,20 @@
{
this.ssoCookie = ssoCookie;
}
+
+ public String getSessionId()
+ {
+ return this.sessionCookie.getValue();
+ }
+
+ public void setSessionCookie(Cookie sessionCookie)
+ {
+ this.sessionCookie = sessionCookie;
+ }
+
+ public Cookie getSessionCookie()
+ {
+ return this.sessionCookie;
+ }
}
}
15 years, 2 months
JBoss Portal SVN: r13226 - docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-04-17 02:02:23 -0400 (Fri, 17 Apr 2009)
New Revision: 13226
Modified:
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/sso.xml
Log:
updating josso integration doc for the updated 1.8 version
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/sso.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/sso.xml 2009-04-17 03:25:33 UTC (rev 13225)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/sso.xml 2009-04-17 06:02:23 UTC (rev 13226)
@@ -269,7 +269,7 @@
</sect1>
<sect1>
<title><trademark class="trade">Java</trademark> Open Single Sign-On (JOSSO)</title>
- <para>JBoss Portal enables seamless integration with JOSSO server. More details on JOSSO can be found
+ <para>JBoss Portal enables seamless integration with JOSSO server version 1.8. More details on JOSSO can be found
<ulink url="http://www.josso.org/">here</ulink></para>
<note>The steps below assume that JOSS server and JBoss Portal will be deployed on the same JBoss Application Server instance.
JOSSO will be configured to leverage identity services exposed by JBoss Portal to perform authentication. Procedure may be
@@ -299,44 +299,100 @@
</listitem>
<listitem>
Edit <emphasis>$JBOSS_HOME/server/default/config/josso-agent-config.xml</emphasis> and mapping for portal web application:
+ <programlisting>
+ <![CDATA[
+.........
+<configuration>
+ <agent:agent-configuration>
+ <agent:partner-apps>
+ <agent:partner-app id="jboss_portal" context="/portal"/>
+ </agent:partner-apps>
+ </agent:agent-configuration>
+<configuration>
+...........
+ ]]>
+ </programlisting>
+ Complete config file can look as follows:
<programlisting>
<![CDATA[
-<partner-apps>
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ 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:jb42="urn:org:josso:agent:jboss42"
+ xmlns:agent="urn:org:josso:agent:core"
+ xmlns:protocol="urn:org:josso:protocol:client"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ urn:org:josso:agent:jboss42 http://www.josso.org/schema/josso-jboss42-agent.xsd
+ urn:org:josso:agent:core http://www.josso.org/schema/josso-agent.xsd
+ urn:org:josso:protocol:client http://www.josso.org/schema/josso-protocol-client.xsd">
- <partner-app>
- <context>/portal</context>
- </partner-app>
+ <jb42:agent name="josso-jboss42-agent" sessionAccessMinInterval="1000" >
- ...
+ <!-- Gateway LOGIN and LOGOUT URLs -->
+ <gatewayLoginUrl>http://josso-01:8080/josso/signon/login.do</gatewayLoginUrl>
+ <gatewayLogoutUrl>http://josso-01:8080/josso/signon/logout.do</gatewayLogoutUrl>
- </partner-apps>
+ <!-- Gateway service locator -->
+ <gatewayServiceLocator>
+ <!-- Other properties for ws-service-locator :
+ username, password, servicesWebContext, transportSecurity
+ -->
+ <protocol:ws-service-locator endpoint="josso-01:8080" />
+ </gatewayServiceLocator>
+
+ <configuration>
+ <agent:agent-configuration>
+
+ <!-- ============================================================================= -->
+ <!-- -->
+ <!-- JOSSO Parnter application definicions : -->
+ <!-- -->
+ <!-- Configure all web applications that should be a josso partner application -->
+ <!-- within this server. -->
+ <!-- For each partner application you have to define the proper web-context. -->
+ <!-- ============================================================================= -->
+ <agent:partner-apps>
+ <agent:partner-app id="jboss_portal" context="/portal"/>
+
+ </agent:partner-apps>
+ </agent:agent-configuration>
+ </configuration>
+ <!-- Only useful when configuring multiple security domains -->
+ <!-- You can configure your own parameter builder to send parameters to your SecurityDomainMatcher -->
+ <!--
+ <parametersBuilders>
+ <agent:vhost-parameters-builder/>
+ <agent:appctx-parameters-builder/>
+ </parametersBuilders>
+ -->
+
+ </jb42:agent>
+
+</s:beans>
]]>
</programlisting>
- Complete config file can look as follows:
- <programlisting>
- <![CDATA[
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<agent>
- <class>org.josso.jb4.agent.JBossCatalinaSSOAgent</class>
- <gatewayLoginUrl>http://localhost:8080/josso/signon/login.do</gatewayLoginUrl>
- <gatewayLogoutUrl>http://localhost:8080/josso/signon/logout.do</gatewayLogoutUrl>
- <service-locator>
- <class>org.josso.gateway.WebserviceGatewayServiceLocator</class>
- <endpoint>localhost:8080</endpoint>
- </service-locator>
- <partner-apps>
- <partner-app>
- <context>/partnerapp</context>
- </partner-app>
- <partner-app>
- <context>/portal</context>
- </partner-app>
- </partner-apps>
-</agent>
- ]]>
- </programlisting>
</listitem>
<listitem>
Edit <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/login.jsp</emphasis> and
@@ -367,65 +423,155 @@
This will expose a special service in JBoss Portal that can be leveraged by JOSSO Credential and Identity Stores if the server is deployed on the same
application server instance.
</listitem>
- <listitem>
- Edit <emphasis>$JBOSS_HOME/server/default/deploy/josso.ear/josso.war/WEB-INF/classes/josso-gateway-config.xml</emphasis> and configure following elements:
- <itemizedlist>
- <listitem>
- <emphasis>Credential Store: </emphasis>
- <programlisting>
+ <listitem>
+ Activate <emphasis>JAAS based Login Module</emphasis> by configuring the following:
+ <itemizedlist>
+ <listitem>
+ <emphasis>$JBOSS_HOME/server/default/deploy/conf/login-config.xml</emphasis>
+<programlisting>
<![CDATA[
-<!-- Basic Authentication Scheme -->
-<authentication-scheme>
- <name>basic-authentication</name>
- <class>org.josso.auth.scheme.BindUsernamePasswordAuthScheme</class>
+<application-policy name="josso">
+ <authentication>
+ <login-module code="org.jboss.portal.identity.sso.josso.JOSSOLoginModule" flag="required">
+ <module-option name="debug">true</module-option>
+ </login-module>
+ </authentication>
+</application-policy>
+ ]]>
+ </programlisting>
+ </listitem>
+ <listitem>
+ <emphasis>$JBOSS_HOME/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/jboss-web.xml</emphasis>
+ <programlisting>
+ <![CDATA[
+<jboss-web>
+<security-domain>java:jaas/josso</security-domain>
+.........
+ ]]>
+ </programlisting>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ Register the JBoss Portal Identity and Credential Store by configuring the following:
+ <itemizedlist>
+ <listitem>
+ Add the file<emphasis>$JBOSS_HOME/server/default/deploy/conf/josso-gateway-portal-stores.xml</emphasis>
+ <programlisting>
+ <![CDATA[
+<s:beans xmlns:s="http://www.springframework.org/schema/beans"
+ xmlns:portal-istore="urn:org:jboss:portal:josso:identitystore"
+ 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: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. -->
+ <!-- ===================================================================== -->
+ <portal-istore:portal-store id="josso-identity-store" s:scope="singleton"/>
- <!-- ================================================= -->
- <!-- JBoss Portal Credential Store -->
- <!-- ================================================= -->
- <credential-store>
- <class>org.jboss.portal.identity.sso.josso.JOSSOIdentityStore</class>
- </credential-store>
+ <!-- ===================================================================== -->
+ <!-- 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"/>
-
- <!-- ================================================= -->
- <!-- Credential Store Key adapter -->
- <!-- ================================================= -->
- <credential-store-key-adapter>
- <class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
- </credential-store-key-adapter>
-
-</authentication-scheme>
+ <!-- ===================================================================== -->
+ <!-- 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>
]]>
</programlisting>
- </listitem>
- <listitem>
- <emphasis>SSO Identity Store: </emphasis>
- <programlisting>
+ </listitem>
+ <listitem>
+ Register the Portal Identity Store with the file <emphasis>$JBOSS_HOME/server/default/deploy/conf/josso-gateway-config.xml</emphasis>
+ <programlisting>
<![CDATA[
-<sso-identity-manager>
+............
+<!-- Identity, Session and Assertion Stores configuration -->
+ <s:import resource="josso-gateway-portal-stores.xml" />
+ <!--
+ <s:import resource="josso-gateway-memory-stores.xml" />
+ <s:import resource="josso-gateway-db-stores.xml" />
+ <s:import resource="josso-gateway-ldap-stores.xml" />
+ -->
+............
+ ]]>
+ </programlisting>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ Enable BIND Authentication Scheme by configuring the following:
+ <itemizedlist>
+ <listitem>
+ Uncomment the BIND Authentication Scheme in <emphasis>$JBOSS_HOME/server/default/deploy/conf/josso-gateway-auth.xml</emphasis>
+ <programlisting>
+ <![CDATA[
+............
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- BIND Authentication Scheme (normally LDAP) -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- Requires a be a bindalble credential store ! -->
+ <!-- name attribute is important and must not be changed -->
+ <bind-authscheme:bind-auth-scheme
+ id="josso-bind-authentication"
+ name="basic-authentication"
+ hashAlgorithm="MD5"
+ hashEncoding="HEX"
+ ignorePasswordCase="false"
+ ignoreUserCase="false">
- <class>org.josso.gateway.identity.service.SSOIdentityManagerImpl</class>
- <!-- ================================================= -->
- <!-- JBoss Portal Credential Store -->
- <!-- ================================================= -->
- <sso-identity-store>
- <class>org.jboss.portal.identity.sso.josso.JOSSOIdentityStore</class>
- </sso-identity-store>
+ <bind-authscheme:credentialStore>
+ <s:ref bean="josso-identity-store"/>
+ </bind-authscheme:credentialStore>
- <!-- ================================================= -->
- <!-- Identity Store Key adapter -->
- <!-- ================================================= -->
- <sso-identity-store-key-adapter>
- <class>org.josso.gateway.identity.service.store.SimpleIdentityStoreKeyAdapter</class>
- </sso-identity-store-key-adapter>
+ <bind-authscheme:credentialStoreKeyAdapter>
+ <s:ref bean="josso-simple-key-adapter"/>
+ </bind-authscheme:credentialStoreKeyAdapter>
-</sso-identity-manager>
+ </bind-authscheme:bind-auth-scheme>
+............
]]>
</programlisting>
- </listitem>
- </itemizedlist>
- </listitem>
+ </listitem>
+ <listitem>
+ Register BIND Authentication Scheme with the JOSSO Authenticator in <emphasis>$JBOSS_HOME/server/default/deploy/conf/josso-gateway-config.xml</emphasis>
+ <programlisting>
+ <![CDATA[
+............
+<!-- ===================================================================== -->
+ <!-- SSO Authenticator, all authentication schemes must be configured here -->
+ <!-- ===================================================================== -->
+ <def-auth:authenticator id="josso-authenticator">
+ <def-auth:schemes>
+ <s:ref bean="josso-bind-authentication"/>
+ <!--
+ <s:ref bean="josso-basic-authentication"/>
+ <s:ref bean="josso-strong-authentication"/>
+ <s:ref bean="josso-rememberme-authentication"/>
+ -->
+ <!-- Others like NTLM and BIND go here -->
+ <!--
+ <s:ref bean="josso-bind-authentication"/>
+ -->
+ </def-auth:schemes>
+ </def-auth:authenticator>
+............
+ ]]>
+ </programlisting>
+ </listitem>
+ </itemizedlist>
+ </listitem>
</orderedlist>
</para>
<para>
15 years, 2 months
JBoss Portal SVN: r13225 - in modules/identity/trunk: sso and 12 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-04-16 23:25:33 -0400 (Thu, 16 Apr 2009)
New Revision: 13225
Added:
modules/identity/trunk/sso/src/main/config/
modules/identity/trunk/sso/src/main/config/josso/
modules/identity/trunk/sso/src/main/config/josso/conf/
modules/identity/trunk/sso/src/main/config/josso/conf/josso-agent-config.xml
modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-auth.xml
modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-config.xml
modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-portal-stores.xml
modules/identity/trunk/sso/src/main/config/josso/conf/login-config.xml
modules/identity/trunk/sso/src/main/config/josso/jboss-portal/
modules/identity/trunk/sso/src/main/config/josso/jboss-portal/context.xml
modules/identity/trunk/sso/src/main/config/josso/jboss-portal/jboss-web.xml
modules/identity/trunk/sso/src/main/config/josso/jboss-portal/login.jsp
modules/identity/trunk/sso/src/main/config/josso/sar/
modules/identity/trunk/sso/src/main/config/josso/sar/META-INF/
modules/identity/trunk/sso/src/main/config/josso/sar/META-INF/jboss-service.xml
modules/identity/trunk/sso/src/test/resources/log4j.properties
Removed:
modules/identity/trunk/sso/src/etc/josso/
modules/identity/trunk/sso/src/resources/portal-josso-sso-sar/
Modified:
modules/identity/trunk/build/pom.xml
modules/identity/trunk/sso/build.xml
modules/identity/trunk/sso/pom.xml
modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOIdentityStore.java
modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLoginModule.java
modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLogoutValve.java
modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/EasySSLProtocolSocketFactory.java
modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/EasyX509TrustManager.java
modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/JOSSOTestCase.java
Log:
first taste of success with the latest josso upgrade. josso version, 1.8......phew
Modified: modules/identity/trunk/build/pom.xml
===================================================================
--- modules/identity/trunk/build/pom.xml 2009-04-16 09:05:50 UTC (rev 13224)
+++ modules/identity/trunk/build/pom.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -46,11 +46,15 @@
<version.antlr>2.7.7</version.antlr>
<version.dom4j>1.6.1</version.dom4j>
<version.asm>1.5.3</version.asm>
- <version.josso>1.5</version.josso>
+ <version.josso>1.8.0</version.josso>
<version.cas>3.0.7</version.cas>
<version.opensso>20070905-nightly</version.opensso>
<version.spring>2.0.6</version.spring>
-
+ <version.xbean>3.4.3</version.xbean>
+ <version.commons-configuration>1.2</version.commons-configuration>
+ <version.commons-discovery>0.4</version.commons-discovery>
+ <version.xmldb>20021220</version.xmldb>
+ <version.axis>1.4</version.axis>
</properties>
@@ -76,6 +80,22 @@
<enabled>false</enabled>
</releases>
</repository>
+
+ <repository>
+ <id>josso-m2-repo</id>
+ <name>JOSSO Maven2 Repository</name>
+ <url>http://repository.josso.org</url>
+
+ <releases>
+ <checksumPolicy>fail</checksumPolicy>
+ <enabled>true</enabled>
+ </releases>
+
+ <snapshots>
+ <checksumPolicy>fail</checksumPolicy>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
</repositories>
@@ -265,26 +285,36 @@
<version>${version.asm}</version>
</dependency>
<dependency>
- <groupId>josso</groupId>
- <artifactId>josso</artifactId>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-core</artifactId>
<version>${version.josso}</version>
</dependency>
<dependency>
- <groupId>josso</groupId>
+ <groupId>org.josso</groupId>
<artifactId>josso-common</artifactId>
<version>${version.josso}</version>
</dependency>
<dependency>
- <groupId>josso</groupId>
- <artifactId>josso-jboss4-plugin</artifactId>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-agent</artifactId>
<version>${version.josso}</version>
</dependency>
<dependency>
- <groupId>josso</groupId>
- <artifactId>josso-tomcat55-plugin</artifactId>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-basic-authscheme</artifactId>
<version>${version.josso}</version>
</dependency>
<dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-jboss42-agent</artifactId>
+ <version>${version.josso}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-tomcat55-agent</artifactId>
+ <version>${version.josso}</version>
+ </dependency>
+ <dependency>
<groupId>ja-sig-cas</groupId>
<artifactId>cas-server</artifactId>
<version>${version.cas}</version>
@@ -309,7 +339,37 @@
<artifactId>spring</artifactId>
<version>${version.spring}</version>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring</artifactId>
+ <version>${version.xbean}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>${version.commons-configuration}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-discovery</groupId>
+ <artifactId>commons-discovery</artifactId>
+ <version>${version.commons-discovery}</version>
+ </dependency>
+ <dependency>
+ <groupId>xmldb</groupId>
+ <artifactId>xmldb-common</artifactId>
+ <version>${version.xmldb}</version>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis</artifactId>
+ <version>${version.axis}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: modules/identity/trunk/sso/build.xml
===================================================================
--- modules/identity/trunk/sso/build.xml 2009-04-16 09:05:50 UTC (rev 13224)
+++ modules/identity/trunk/sso/build.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -81,51 +81,31 @@
It also deploys any custom configuration/dependencies into the JOSSO war file which is the
JOSSO Authentication Server
-->
- <target name="install-josso">
- <!-- portal-josso sar file setup -->
+ <target name="install-josso">
+ <!-- core jboss portal installation -->
<jar destfile="target/portal-josso.sar">
<fileset dir="src/resources/portal-josso-sso-sar"/>
<fileset dir="target" includes="identity-sso-*-SNAPSHOT.jar"/>
</jar>
- <copy todir="${jboss.home}/server/${josso.deploy.dir}" overwrite="true">
+ <copy todir="${jboss.home}/server/${josso.deploy.dir}/jboss-portal.sar" overwrite="true">
<fileset file="target/portal-josso.sar"/>
</copy>
-
- <!-- core josso integration with JBoss AS setup -->
- <copy todir="${jboss.home}/server/${josso.deploy.dir}/../conf" overwrite="true">
- <fileset dir="src/etc/josso" includes="josso-agent-config.xml, josso-config.xml, login-config.xml"/>
- </copy>
- <copy todir="${jboss.home}/server/${josso.deploy.dir}/jbossweb-tomcat55.sar" overwrite="true">
- <fileset dir="src/etc/josso" includes="server.xml"/>
- <fileset file="${josso.jar}"/>
- <fileset file="${josso-common.jar}"/>
- <fileset file="${josso-jboss4-plugin.jar}"/>
- <fileset file="${josso-tomcat55-plugin.jar}"/>
- <fileset file="${commons-configuration.jar}"/>
- <fileset file="${xmldb-common.jar}"/>
- <fileset file="${axis.jar}"/>
- <fileset file="${commons-discovery.jar}"/>
+ <copy todir="${jboss.home}/server/${josso.deploy.dir}/jboss-portal.sar/portal-server.war" overwrite="true">
+ <fileset dir="src/etc/josso/jboss-portal" includes="login.jsp"/>
</copy>
+ <copy todir="${jboss.home}/server/${josso.deploy.dir}/jboss-portal.sar/portal-server.war/WEB-INF" overwrite="true">
+ <fileset dir="src/etc/josso/jboss-portal" includes="context.xml, jboss-web.xml"/>
+ </copy>
- <!-- jboss portal integration with the josso authentication server -->
- <copy todir="${jboss.home}/server/${josso.deploy.dir}/josso.war/WEB-INF/classes" overwrite="true">
- <fileset dir="src/etc/josso" includes="josso-gateway-config.xml"/>
- </copy>
+ <!-- jboss portal integration with the josso authentication server -->
<copy tofile="${jboss.home}/server/${josso.deploy.dir}/josso.war/WEB-INF/lib/portal-identity-sso-lib.jar" overwrite="true">
<fileset dir="target" includes="identity-sso-*-SNAPSHOT.jar"/>
- </copy>
+ </copy>
- <!-- core jboss portal changes -->
- <copy todir="${jboss.home}/server/${josso.deploy.dir}/jboss-portal.sar/portal-server.war" overwrite="true">
- <fileset dir="src/etc/josso" includes="login.jsp, error.jsp"/>
- </copy>
- <copy todir="${jboss.home}/server/${josso.deploy.dir}/jboss-portal.sar/portal-server.war/WEB-INF" overwrite="true">
- <fileset dir="src/etc/josso" includes="context.xml"/>
- </copy>
- <!-- add portal-identity-sso-lib.jar to jboss portal -->
- <copy tofile="${jboss.home}/server/${josso.deploy.dir}/jboss-portal.sar/lib/portal-identity-sso-lib.jar" overwrite="true">
- <fileset dir="target" includes="identity-sso-*-SNAPSHOT.jar"/>
- </copy>
+ <!-- josso AS installation related -->
+ <copy todir="${jboss.home}/server/${josso.deploy.dir}/conf" overwrite="true">
+ <fileset dir="src/etc/josso/conf"/>
+ </copy>
</target>
<!-- ================================================================== -->
Modified: modules/identity/trunk/sso/pom.xml
===================================================================
--- modules/identity/trunk/sso/pom.xml 2009-04-16 09:05:50 UTC (rev 13224)
+++ modules/identity/trunk/sso/pom.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -9,8 +9,12 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>identity-sso</artifactId>
<packaging>jar</packaging>
- <name>JBoss Portal Identity SSO Integration</name>
+ <name>JBoss Portal Identity SSO Integration</name>
+ <properties>
+ <josso.deploy.dir>josso-01</josso.deploy.dir>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.jboss.portal.identity</groupId>
@@ -18,22 +22,30 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>josso</groupId>
- <artifactId>josso</artifactId>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-core</artifactId>
</dependency>
<dependency>
- <groupId>josso</groupId>
+ <groupId>org.josso</groupId>
<artifactId>josso-common</artifactId>
</dependency>
<dependency>
- <groupId>josso</groupId>
- <artifactId>josso-tomcat55-plugin</artifactId>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-agent</artifactId>
</dependency>
<dependency>
- <groupId>josso</groupId>
- <artifactId>josso-jboss4-plugin</artifactId>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-basic-authscheme</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-jboss42-agent</artifactId>
</dependency>
<dependency>
+ <groupId>org.josso</groupId>
+ <artifactId>josso-tomcat55-agent</artifactId>
+ </dependency>
+ <dependency>
<groupId>ja-sig-cas</groupId>
<artifactId>cas-server</artifactId>
</dependency>
@@ -52,86 +64,184 @@
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
- <version>1.2</version>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
- <version>0.4</version>
</dependency>
<dependency>
<groupId>xmldb</groupId>
<artifactId>xmldb-common</artifactId>
- <version>20021220</version>
</dependency>
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
- <version>1.4</version>
- </dependency>
+ </dependency>
+
+ <!-- test dependency -->
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-mc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>portal-test</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-common</artifactId>
+ </dependency>
</dependencies>
<build>
<plugins>
- <plugin>
+ <plugin>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>maven-xbean-plugin</artifactId>
+ <version>${version.xbean}</version>
+ <executions>
+ <execution>
+ <configuration>
+ <namespace>urn:org:jboss:portal:josso:identitystore</namespace>
+ </configuration>
+ <goals>
+ <goal>mapping</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>josso-dev</id>
+ <build>
+ <plugins>
+ <plugin>
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
- <artifactId>maven-antrun-extended-plugin</artifactId>
- <version>1.13</version>
- <executions>
- <!--
- Development time task for installing CAS into your local Portal setup
- -->
- <!--
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <executions>
<execution>
- <id>install-cas</id>
+ <id>deploy-josso</id>
<phase>install</phase>
<configuration>
<tasks>
- <property name="jboss.home" value="/home/soshah/appServers/jboss-4.2.1.GA"/>
- <property name="cas.deploy.dir" value="cas-01/deploy"/>
- <property name="cas.client.jar" value="${settings.localRepository}/ja-sig-cas/cas-client/${version.cas}/cas-client-${version.cas}.jar"/>
- <ant antfile="${basedir}/build.xml">
- <target name="install-cas"/>
- </ant>
+ <property environment="env"/>
+
+ <!--If properties are not in command line check if they are set in env-->
+ <condition property="JBOSS_HOME" value="${env.JBOSS_HOME}">
+ <and>
+ <isset property="env.JBOSS_HOME"/>
+ <not>
+ <isset property="JBOSS_HOME"/>
+ </not>
+ </and>
+ </condition>
+
+ <fail message="Please set the environment variable JBOSS_HOME or specify it using -DJBOSS_HOME">
+ <condition>
+ <and>
+ <not>
+ <isset property="JBOSS_HOME"/>
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+ <!-- core jboss portal installation -->
+ <jar destfile="${project.build.directory}/portal-josso.sar">
+ <fileset dir="${basedir}/src/main/config/josso/sar"/>
+ <fileset dir="${project.build.directory}" includes="identity-sso-*-SNAPSHOT.jar"/>
+ </jar>
+ <copy todir="${JBOSS_HOME}/server/${josso.deploy.dir}/deploy/jboss-portal.sar" overwrite="true">
+ <fileset file="${project.build.directory}/portal-josso.sar"/>
+ </copy>
+ <copy todir="${JBOSS_HOME}/server/${josso.deploy.dir}/deploy/jboss-portal.sar/portal-server.war" overwrite="true">
+ <fileset dir="${basedir}/src/main/config/josso/jboss-portal" includes="login.jsp"/>
+ </copy>
+ <copy todir="${JBOSS_HOME}/server/${josso.deploy.dir}/deploy/jboss-portal.sar/portal-server.war/WEB-INF" overwrite="true">
+ <fileset dir="${basedir}/src/main/config/josso/jboss-portal" includes="context.xml, jboss-web.xml"/>
+ </copy>
+
+ <!-- jboss portal integration with the josso authentication server -->
+ <copy tofile="${JBOSS_HOME}/server/${josso.deploy.dir}/deploy/josso.war/WEB-INF/lib/portal-identity-sso-lib.jar" overwrite="true">
+ <fileset dir="${project.build.directory}" includes="identity-sso-*-SNAPSHOT.jar"/>
+ </copy>
+
+ <!-- josso AS installation related -->
+ <copy todir="${JBOSS_HOME}/server/${josso.deploy.dir}/conf" overwrite="true">
+ <fileset dir="${basedir}/src/main/config/josso/conf"/>
+ </copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
- </execution>
- -->
- <!--
- Development time task for installing JOSSO into your local Portal setup
- -->
- <!--
- <execution>
- <id>install-josso</id>
- <phase>install</phase>
- <configuration>
- <tasks>
- <property name="jboss.home" value="/home/soshah/appServers/jboss-4.0.5.GA"/>
- <property name="josso.deploy.dir" value="josso-01/deploy"/>
- <property name="josso.jar" value="${settings.localRepository}/josso/josso/${version.josso}/josso-${version.josso}.jar"/>
- <property name="josso-common.jar" value="${settings.localRepository}/josso/josso-common/${version.josso}/josso-common-${version.josso}.jar"/>
- <property name="josso-tomcat55-plugin.jar" value="${settings.localRepository}/josso/josso-tomcat55-plugin/${version.josso}/josso-tomcat55-plugin-${version.josso}.jar"/>
- <property name="josso-jboss4-plugin.jar" value="${settings.localRepository}/josso/josso-jboss4-plugin/${version.josso}/josso-jboss4-plugin-${version.josso}.jar"/>
- <property name="commons-configuration.jar" value="${settings.localRepository}/commons-configuration/commons-configuration/1.2/commons-configuration-1.2.jar"/>
- <property name="commons-discovery.jar" value="${settings.localRepository}/commons-discovery/commons-discovery/0.4/commons-discovery-0.4.jar"/>
- <property name="xmldb-common.jar" value="${settings.localRepository}/xmldb/xmldb-common/20021220/xmldb-common-20021220.jar"/>
- <property name="axis.jar" value="${settings.localRepository}/axis/axis/1.4/axis-1.4.jar"/>
- <ant antfile="${basedir}/build.xml">
- <target name="install-josso"/>
- </ant>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- -->
+ </execution>
</executions>
- </plugin>
- </plugins>
- </build>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>josso-integration-test</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <includes>
+ <include>**/JOSSOTestCase.java</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+
+ <profile>
+ <id>cas-dev</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>deploy-cas</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+ <property name="JBOSS_HOME" value="/home/soshah/appServers/jboss-4.2.1.GA"/>
+ <property name="cas.deploy.dir" value="cas-01/deploy"/>
+ <property name="cas.client.jar" value="${settings.localRepository}/ja-sig-cas/cas-client/${version.cas}/cas-client-${version.cas}.jar"/>
+ <ant antfile="${basedir}/build.xml">
+ <target name="install-cas"/>
+ </ant>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
Added: modules/identity/trunk/sso/src/main/config/josso/conf/josso-agent-config.xml
===================================================================
--- modules/identity/trunk/sso/src/main/config/josso/conf/josso-agent-config.xml (rev 0)
+++ modules/identity/trunk/sso/src/main/config/josso/conf/josso-agent-config.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ 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:jb42="urn:org:josso:agent:jboss42"
+ xmlns:agent="urn:org:josso:agent:core"
+ xmlns:protocol="urn:org:josso:protocol:client"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ urn:org:josso:agent:jboss42 http://www.josso.org/schema/josso-jboss42-agent.xsd
+ urn:org:josso:agent:core http://www.josso.org/schema/josso-agent.xsd
+ urn:org:josso:protocol:client http://www.josso.org/schema/josso-protocol-client.xsd">
+
+ <jb42:agent name="josso-jboss42-agent" sessionAccessMinInterval="1000" >
+
+ <!-- Gateway LOGIN and LOGOUT URLs -->
+ <gatewayLoginUrl>http://localhost:8080/josso/signon/login.do</gatewayLoginUrl>
+ <gatewayLogoutUrl>http://localhost:8080/josso/signon/logout.do</gatewayLogoutUrl>
+
+ <!-- Gateway service locator -->
+ <gatewayServiceLocator>
+ <!-- Other properties for ws-service-locator :
+ username, password, servicesWebContext, transportSecurity
+ -->
+ <protocol:ws-service-locator endpoint="localhost:8080" />
+ </gatewayServiceLocator>
+
+ <configuration>
+ <agent:agent-configuration>
+
+ <!-- ============================================================================= -->
+ <!-- -->
+ <!-- JOSSO Parnter application definicions : -->
+ <!-- -->
+ <!-- Configure all web applications that should be a josso partner application -->
+ <!-- within this server. -->
+ <!-- For each partner application you have to define the proper web-context. -->
+ <!-- ============================================================================= -->
+
+ <agent:partner-apps>
+ <agent:partner-app id="jboss_portal" context="/portal"/>
+
+ <!-- Simple definition of a partner application -->
+ <!--
+ <agent:partner-app id="MySimplePartnerApp" context="/simple-partnerapp"/>
+ -->
+
+ <!--
+ <agent:partner-app id="MyPartnerApp1" context="/partnerapp" >
+ -->
+
+ <!-- The vhost is an ooptional feature:
+ Specify the Host/Virtual Host where this application is runnig
+ This is useful when configuring multiple security domains. -->
+ <!-- vhost>localhost</vhost--> <!-- You can configure this as a 'partner-app' element attribute as well -->
+
+ <!-- This is an optional feature :
+ You can reference any web resource collection that should not be subject to SSO protection.
+ The SSO agent will not provide identity nor demand authentication to requests matching the
+ security constraint associated to this web resource collections.
+ In order to work, the security constraint must not contain auth-constraints declarations.
+ See sample web.xml file from josso partnerapp.
+ -->
+ <!--
+ <ignore-web-resource-collections>public-resources,img-resources</ignore-web-resource-collections>
+ -->
+
+ <!-- In addition to the standard JEE security, JOSSO can propagate the security context using
+ alternative mechanisms, such as custom http headers, request attributes and cookies, thus making it available
+ to applications which do not rely on JEE security APIs. -->
+ <!--
+ <security-context-propagation>
+ <agent:security-context-propagation-config
+ binding="HTTP_HEADERS"
+ userPlaceHolder="currentLoginName"
+ rolesPlaceHolder="currentUserRoles"/>
+ </security-context-propagation>
+ -->
+ <!--
+ </agent:partner-app>
+ -->
+
+ </agent:partner-apps>
+
+ </agent:agent-configuration>
+ </configuration>
+
+ <!-- Only useful when configuring multiple security domains -->
+ <!-- You can configure your own parameter builder to send parameters to your SecurityDomainMatcher -->
+ <!--
+ <parametersBuilders>
+ <agent:vhost-parameters-builder/>
+ <agent:appctx-parameters-builder/>
+ </parametersBuilders>
+ -->
+
+ </jb42:agent>
+
+</s:beans>
Added: modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-auth.xml
===================================================================
--- modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-auth.xml (rev 0)
+++ modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-auth.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -0,0 +1,133 @@
+<?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: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:rememberme-authscheme="urn:org:josso:rememberme:authscheme"
+ 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:strong:authscheme http://www.josso.org/schema/josso-strong-authscheme.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:rememberme:authscheme http://www.josso.org/schema/josso-rememberme-authscheme.xsd
+ ">
+
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- Basic Authentication Scheme -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <basic-authscheme:basic-auth-scheme
+ id="josso-basic-authentication"
+ hashAlgorithm="MD5"
+ hashEncoding="HEX"
+ ignorePasswordCase="false"
+ ignoreUserCase="false">
+
+ <basic-authscheme:credentialStore>
+ <s:ref bean="josso-identity-store"/>
+ </basic-authscheme:credentialStore>
+
+ <basic-authscheme:credentialStoreKeyAdapter>
+ <s:ref bean="josso-simple-key-adapter"/>
+ </basic-authscheme:credentialStoreKeyAdapter>
+
+ </basic-authscheme:basic-auth-scheme>
+
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- Strong Authentication Scheme -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <strong-authscheme:strong-auth-scheme
+ id="josso-strong-authentication">
+
+ <strong-authscheme:credentialStore>
+ <s:ref bean="josso-identity-store"/>
+ </strong-authscheme:credentialStore>
+
+ <strong-authscheme:credentialStoreKeyAdapter>
+ <s:ref bean="josso-simple-key-adapter"/>
+ </strong-authscheme:credentialStoreKeyAdapter>
+
+ </strong-authscheme:strong-auth-scheme>
+
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- Rememberme Authentication Scheme -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <rememberme-authscheme:rememberme-auth-scheme
+ id="josso-rememberme-authentication" >
+
+ <rememberme-authscheme:credentialStore>
+ <s:ref bean="josso-identity-store"/>
+ </rememberme-authscheme:credentialStore>
+
+ <rememberme-authscheme:credentialStoreKeyAdapter>
+ <s:ref bean="josso-simple-key-adapter"/>
+ </rememberme-authscheme:credentialStoreKeyAdapter>
+
+ </rememberme-authscheme:rememberme-auth-scheme>
+
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- BIND Authentication Scheme (normally LDAP) -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- Requires a be a bindalble credential store ! -->
+ <!-- name attribute is important and must not be changed -->
+ <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>
+
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- NTLM Authentication Scheme -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <ntlm-authscheme:ntlm-auth-scheme
+ id="josso-ntlm-authentication">
+
+ <ntlm-authscheme:credentialStore>
+ <s:ref bean="josso-identity-store"/>
+ </ntlm-authscheme:credentialStore>
+
+ <ntlm-authscheme:credentialStoreKeyAdapter>
+ <s:ref bean="josso-simple-key-adapter"/>
+ </ntlm-authscheme:credentialStoreKeyAdapter>
+ </ntlm-authscheme:ntlm-auth-scheme>
+
+
+</s:beans>
\ No newline at end of file
Added: modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-config.xml
===================================================================
--- modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-config.xml (rev 0)
+++ modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-config.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -0,0 +1,315 @@
+<?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 -->
+ <s:import resource="josso-gateway-portal-stores.xml" />
+ <!--
+ <s:import resource="josso-gateway-memory-stores.xml" />
+ <s:import resource="josso-gateway-db-stores.xml" />
+ <s:import resource="josso-gateway-ldap-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-bind-authentication"/>
+ <!--
+ <s:ref bean="josso-basic-authentication"/>
+ <s:ref bean="josso-strong-authentication"/>
+ <s:ref bean="josso-rememberme-authentication"/>
+ -->
+ <!-- Others like NTLM and BIND go here -->
+ <!--
+ <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: modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-portal-stores.xml
===================================================================
--- modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-portal-stores.xml (rev 0)
+++ modules/identity/trunk/sso/src/main/config/josso/conf/josso-gateway-portal-stores.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -0,0 +1,52 @@
+<?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:portal-istore="urn:org:jboss:portal:josso:identitystore"
+ 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: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. -->
+ <!-- ===================================================================== -->
+ <portal-istore:portal-store id="josso-identity-store" s:scope="singleton"/>
+
+ <!-- ===================================================================== -->
+ <!-- JOSSO Session Store, the id is very important because it is -->
+ <!-- referenced by the session manager and who knows where else -->
+ <!-- ===================================================================== -->
+ <memory-sstore:memory-store id="josso-session-store"/>
+
+ <!-- ===================================================================== -->
+ <!-- JOSSO Assertion Store, the id is very important because it is -->
+ <!-- referenced by the assertion manager and who knows where elese -->
+ <!-- ===================================================================== -->
+ <memory-astore:memory-store id="josso-assertion-store"/>
+</s:beans>
Added: modules/identity/trunk/sso/src/main/config/josso/conf/login-config.xml
===================================================================
--- modules/identity/trunk/sso/src/main/config/josso/conf/login-config.xml (rev 0)
+++ modules/identity/trunk/sso/src/main/config/josso/conf/login-config.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?><!-- The XML based JAAS login configuration read by the
+org.jboss.security.auth.login.XMLLoginConfig mbean. Add
+an application-policy element for each security domain.
+
+The outline of the application-policy is:
+<application-policy name="security-domain-name">
+ <authentication>
+ <login-module code="login.module1.class.name" flag="control_flag">
+ <module-option name = "option1-name">option1-value</module-option>
+ <module-option name = "option2-name">option2-value</module-option>
+ ...
+ </login-module>
+
+ <login-module code="login.module2.class.name" flag="control_flag">
+ ...
+ </login-module>
+ ...
+ </authentication>
+</application-policy>
+
+$Revision: 64598 $
+--><policy>
+ <!-- Used by clients within the application server VM such as
+ mbeans and servlets that access EJBs.
+ -->
+ <application-policy name="client-login">
+ <authentication>
+ <login-module code="org.jboss.security.ClientLoginModule" flag="required">
+ <!-- Any existing security context will be restored on logout -->
+ <module-option name="restore-login-identity">true</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- Security domain for JBossMQ -->
+ <application-policy name="jbossmq">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
+ <module-option name="unauthenticatedIdentity">guest</module-option>
+ <module-option name="dsJndiName">java:/DefaultDS</module-option>
+ <module-option name="principalsQuery">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option>
+ <module-option name="rolesQuery">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- Security domain for JBossMQ when using file-state-service.xml
+ <application-policy name = "jbossmq">
+ <authentication>
+ <login-module code = "org.jboss.mq.sm.file.DynamicLoginModule"
+ flag = "required">
+ <module-option name = "unauthenticatedIdentity">guest</module-option>
+ <module-option name = "sm.objectname">jboss.mq:service=StateManager</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+ -->
+
+ <!-- Security domains for testing new jca framework -->
+ <application-policy name="HsqlDbRealm">
+ <authentication>
+ <login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule" flag="required">
+ <module-option name="principal">sa</module-option>
+ <module-option name="userName">sa</module-option>
+ <module-option name="password"/>
+ <module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <application-policy name="JmsXARealm">
+ <authentication>
+ <login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule" flag="required">
+ <module-option name="principal">guest</module-option>
+ <module-option name="userName">guest</module-option>
+ <module-option name="password">guest</module-option>
+ <module-option name="managedConnectionFactoryName">jboss.jca:service=TxCM,name=JmsXA</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- A template configuration for the jmx-console web application. This
+ defaults to the UsersRolesLoginModule the same as other and should be
+ changed to a stronger authentication mechanism as required.
+ -->
+ <application-policy name="jmx-console">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
+ <module-option name="usersProperties">props/jmx-console-users.properties</module-option>
+ <module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- A template configuration for the web-console web application. This
+ defaults to the UsersRolesLoginModule the same as other and should be
+ changed to a stronger authentication mechanism as required.
+ -->
+ <application-policy name="web-console">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
+ <module-option name="usersProperties">web-console-users.properties</module-option>
+ <module-option name="rolesProperties">web-console-roles.properties</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!--
+ A template configuration for the JBossWS security domain.
+ This defaults to the UsersRolesLoginModule the same as other and should be
+ changed to a stronger authentication mechanism as required.
+ -->
+ <application-policy name="JBossWS">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
+ <module-option name="usersProperties">props/jbossws-users.properties</module-option>
+ <module-option name="rolesProperties">props/jbossws-roles.properties</module-option>
+ <module-option name="unauthenticatedIdentity">anonymous</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- The default login configuration used by any security domain that
+ does not have a application-policy entry with a matching name
+ -->
+ <application-policy name="other">
+ <!-- A simple server login module, which can be used when the number
+ of users is relatively small. It uses two properties files:
+ users.properties, which holds users (key) and their password (value).
+ roles.properties, which holds users (key) and a comma-separated list of
+ their roles (value).
+ The unauthenticatedIdentity property defines the name of the principal
+ that will be used when a null username and password are presented as is
+ the case for an unuathenticated web client or MDB. If you want to
+ allow such users to be authenticated add the property, e.g.,
+ unauthenticatedIdentity="nobody"
+ -->
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required"/>
+ </authentication>
+ </application-policy>
+
+<!-- ================================================== -->
+ <!-- JOSSO JAAS Login Configuration, automatially generated by JOSSO Installer-->
+ <application-policy name="josso"> <authentication>
+ <login-module code="org.jboss.portal.identity.sso.josso.JOSSOLoginModule" flag="required">
+ <module-option name="debug">true</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+ <!-- ================================================== -->
+</policy>
\ No newline at end of file
Added: modules/identity/trunk/sso/src/main/config/josso/jboss-portal/context.xml
===================================================================
--- modules/identity/trunk/sso/src/main/config/josso/jboss-portal/context.xml (rev 0)
+++ modules/identity/trunk/sso/src/main/config/josso/jboss-portal/context.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<Context>
+ <Valve className="org.jboss.portal.identity.sso.josso.JOSSOLogoutValve"/>
+</Context>
Added: modules/identity/trunk/sso/src/main/config/josso/jboss-portal/jboss-web.xml
===================================================================
--- modules/identity/trunk/sso/src/main/config/josso/jboss-portal/jboss-web.xml (rev 0)
+++ modules/identity/trunk/sso/src/main/config/josso/jboss-portal/jboss-web.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<jboss-web>
+ <security-domain>java:jaas/josso</security-domain>
+ <context-root>/portal</context-root>
+ <replication-config>
+ <replication-trigger>SET</replication-trigger>
+ </replication-config>
+ <resource-ref>
+ <res-ref-name>jdbc/PortalDS</res-ref-name>
+ <jndi-name>java:PortalDS</jndi-name>
+ </resource-ref>
+</jboss-web>
Added: modules/identity/trunk/sso/src/main/config/josso/jboss-portal/login.jsp
===================================================================
--- modules/identity/trunk/sso/src/main/config/josso/jboss-portal/login.jsp (rev 0)
+++ modules/identity/trunk/sso/src/main/config/josso/jboss-portal/login.jsp 2009-04-17 03:25:33 UTC (rev 13225)
@@ -0,0 +1,168 @@
+<%--
+ ~ Copyright (c) 2004-2006, Novascope S.A. and the JOSSO team
+ ~ All rights reserved.
+ ~ Redistribution and use in source and binary forms, with or
+ ~ without modification, are permitted provided that the following
+ ~ conditions are met:
+ ~
+ ~ * Redistributions of source code must retain the above copyright
+ ~ notice, this list of conditions and the following disclaimer.
+ ~
+ ~ * Redistributions in binary form must reproduce the above copyright
+ ~ notice, this list of conditions and the following disclaimer in
+ ~ the documentation and/or other materials provided with the
+ ~ distribution.
+ ~
+ ~ * Neither the name of the JOSSO team nor the names of its
+ ~ contributors may be used to endorse or promote products derived
+ ~ from this software without specific prior written permission.
+ ~
+ ~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ ~ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ ~ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ ~ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ ~ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ ~ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ ~ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ ~ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ ~ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ~ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ ~ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ ~ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ ~ POSSIBILITY OF SUCH DAMAGE.
+ --%>
+<%@page contentType="text/html; charset=iso-8859-1" language="java" session="true" %>
+<%
+ response.sendRedirect(request.getContextPath() + "/josso_login/");
+%>
+
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+<%--
+
+<%@ page pageEncoding="utf-8" %>
+<%@page import="org.jboss.portal.identity.UserStatus" %>
+<%@page import="org.jboss.portal.server.ParameterSanitizer" %>
+<%@page import="java.util.ResourceBundle" %>
+
+<%
+ ResourceBundle rb = ResourceBundle.getBundle("Resource", request.getLocale());
+ // todo: use ParameterValidation.sanitize after 2.7.1
+ String loginheight = request.getParameter("loginheight");
+ boolean paramPresent = loginheight != null;
+ loginheight = ParameterSanitizer.sanitizeFromPattern(loginheight, ParameterSanitizer.CSS_DISTANCE, "300px");
+%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title><%= rb.getString("LOGIN_TITLE") %>
+ </title>
+ <style type="text/css">
+ /* <![CDATA[ */
+ body {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ padding-top: <%=loginheight%>;
+ }
+
+ /* ]]> */
+ </style>
+
+ <script>
+ function setFocusOnLoginForm()
+ {
+ try
+ {
+ document.loginform.j_username.focus();
+ }
+ catch (e)
+ {
+ }
+ }
+ </script>
+
+ <link rel="stylesheet" href="/portal-core/css/login.css" type="text/css"/>
+</head>
+<body onload="setFocusOnLoginForm();">
+
+<div class="login-container">
+
+
+ <div class="login-header">
+ <h2><%= rb.getString("LOGIN_TITLE") %>
+ </h2>
+ </div>
+ <div class="login-content">
+
+ <div class="error-message"
+ style="<%=(request.getAttribute(!UserStatus.OK.equals("org.jboss.portal.userStatus") ? "" : "display:none"))%>;">
+ <%
+
+ if (UserStatus.DISABLE.equals(request.getAttribute("org.jboss.portal.userStatus")))
+ {
+ out.println(rb.getString("ACCOUNT_DISABLED"));
+ }
+ else if (UserStatus.WRONGPASSWORD.equals(request.getAttribute("org.jboss.portal.userStatus")) || UserStatus.UNEXISTING.equals(request.getAttribute("org.jboss.portal.userStatus")))
+ {
+ out.println(rb.getString("ACCOUNT_INEXISTING_OR_WRONG_PASSWORD"));
+ }
+ else if (UserStatus.NOTASSIGNEDTOROLE.equals(request.getAttribute("org.jboss.portal.userStatus")))
+ {
+ out.println(rb.getString("ACCOUNT_NOTASSIGNEDTOROLE"));
+ }
+ %>
+ </div>
+ <form method="post" action="<%= response.encodeURL("j_security_check") %>" name="loginform" id="loginForm"
+ target="_parent">
+ <div class="form-field">
+ <label for="j_username"><%= rb.getString("LOGIN_USERNAME") %>
+ </label>
+ <input type="text" name="j_username" id="j_username" value=""/>
+ </div>
+ <div class="form-field">
+ <label for="j_password"><%= rb.getString("LOGIN_PASSWORD") %>
+ </label>
+ <input type="password" name="j_password" id="j_password" value=""/>
+ </div>
+ <br class="clear"/>
+
+ <div class="button-container">
+ <br class="clear"/>
+ <input style="<%=paramPresent ? "" : "display:none"%>;" type="button" name="cancel"
+ value="<%= rb.getString("LOGIN_CANCEL") %>" class="cancel-button"
+ onclick="window.parent.hideContentModal('login-modal');"/>
+ <br class="clear"/>
+ <input style="<%=paramPresent ? "" : "right:10px"%>;" type="submit" name="login"
+ value="<%= rb.getString("LOGIN_SUBMIT") %>" class="login-button"/>
+ </div>
+ <br class="clear"/>
+ </form>
+
+ </div>
+</div>
+</body>
+</html>
+--%>
Added: modules/identity/trunk/sso/src/main/config/josso/sar/META-INF/jboss-service.xml
===================================================================
--- modules/identity/trunk/sso/src/main/config/josso/sar/META-INF/jboss-service.xml (rev 0)
+++ modules/identity/trunk/sso/src/main/config/josso/sar/META-INF/jboss-service.xml 2009-04-17 03:25:33 UTC (rev 13225)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+ <mbean
+ code="org.jboss.portal.identity.sso.josso.JOSSOIdentityServiceImpl"
+ name="portal:service=Module,type=JOSSOIdentityService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends>portal:service=Module,type=IdentityServiceController</depends>
+ </mbean>
+</server>
\ No newline at end of file
Modified: modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOIdentityStore.java
===================================================================
--- modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOIdentityStore.java 2009-04-16 09:05:50 UTC (rev 13224)
+++ modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOIdentityStore.java 2009-04-17 03:25:33 UTC (rev 13225)
@@ -30,6 +30,7 @@
import org.jboss.mx.util.MBeanProxy;
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.portal.identity.sso.josso.JOSSOIdentityService;
+
import org.josso.gateway.SSONameValuePair;
import org.josso.gateway.identity.exceptions.NoSuchUserException;
import org.josso.gateway.identity.exceptions.SSOIdentityException;
@@ -37,22 +38,27 @@
import org.josso.gateway.identity.service.BaseRoleImpl;
import org.josso.gateway.identity.service.BaseUser;
import org.josso.gateway.identity.service.BaseUserImpl;
-import org.josso.gateway.identity.service.store.IdentityStore;
import org.josso.gateway.identity.service.store.UserKey;
import org.josso.gateway.identity.service.store.SimpleUserKey;
+import org.josso.gateway.identity.service.store.IdentityStore;
+
import org.josso.auth.Credential;
import org.josso.auth.CredentialKey;
-import org.josso.auth.BindableCredentialStore;
-import org.josso.auth.exceptions.SSOAuthenticationException;
+import org.josso.auth.CredentialProvider;
import org.josso.auth.scheme.AuthenticationScheme;
import org.josso.auth.scheme.UsernameCredential;
import org.josso.auth.scheme.PasswordCredential;
+import org.josso.auth.BindableCredentialStore;
+import org.josso.auth.exceptions.SSOAuthenticationException;
+
/**
+ * @org.apache.xbean.XBean element="portal-store"
+ *
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
*/
-public class JOSSOIdentityStore implements IdentityStore, BindableCredentialStore
+public class JOSSOIdentityStore implements IdentityStore,BindableCredentialStore
{
/**
*
@@ -81,6 +87,9 @@
MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
this.portalIdentityService = (JOSSOIdentityService)
MBeanProxy.get(JOSSOIdentityService.class,new ObjectName("portal:service=Module,type=JOSSOIdentityService"),mbeanServer);
+ log.info("-------------------------------------------------------------------");
+ log.info("JBoss Portal JOSSO Identity Store successfully started.............");
+ log.info("-------------------------------------------------------------------");
}
catch(Exception e)
{
@@ -91,18 +100,34 @@
throw new RuntimeException("JOSSOIdentityStore registration failed....");
}
}
- //-----IdentityStore implementation--------------------------------------------------------------------------------------------------
- /**
- *
- */
- public BaseRole[] findRolesByUserKey(UserKey userKey)
- throws SSOIdentityException
- {
+
+ public void setAuthenticationScheme(AuthenticationScheme authenticationScheme)
+ {
if(this.portalIdentityService == null)
{
throw new IllegalStateException("JOSSOIdentityStore not properly registered with the JOSSO system..");
}
+ this.authenticationScheme = authenticationScheme;
+ }
+ //----------------IdentityStore implementation------------------------------------------------------------------------------------------------------------------------
+ public boolean userExists(UserKey userKey) throws SSOIdentityException
+ {
+ if(this.portalIdentityService == null)
+ {
+ throw new IllegalStateException("JOSSOIdentityStore not properly registered with the JOSSO system..");
+ }
+
+ return this.portalIdentityService.exists(userKey.toString());
+ }
+
+ public BaseRole[] findRolesByUserKey(UserKey userKey) throws SSOIdentityException
+ {
+ if(this.portalIdentityService == null)
+ {
+ throw new IllegalStateException("JOSSOIdentityStore not properly registered with the JOSSO system..");
+ }
+
//Get the role information from the Portal Identity System
String[] userRoles = this.portalIdentityService.getUserRoles(userKey.toString());
@@ -113,17 +138,12 @@
roles[i] = new BaseRoleImpl(userRoles[i]);
}
-
return roles;
}
- /**
- *
- */
- public BaseUser loadUser(UserKey userKey) throws NoSuchUserException,
- SSOIdentityException
- {
- if(this.portalIdentityService == null)
+ public BaseUser loadUser(UserKey userKey) throws NoSuchUserException, SSOIdentityException
+ {
+ if(this.portalIdentityService == null)
{
throw new IllegalStateException("JOSSOIdentityStore not properly registered with the JOSSO system..");
}
@@ -134,58 +154,25 @@
user.addProperty("password", "");
return user;
- }
-
- /**
- *
- */
- public boolean userExists(UserKey userKey) throws SSOIdentityException
- {
- if(this.portalIdentityService == null)
+ }
+ //---------------CredentialStore implementation----------------------------------------------------------------------------------------------------------------------
+ public Credential[] loadCredentials(CredentialKey credentialKey, CredentialProvider credentialProvider) throws SSOIdentityException
+ {
+ if(this.portalIdentityService == null)
{
throw new IllegalStateException("JOSSOIdentityStore not properly registered with the JOSSO system..");
}
- return this.portalIdentityService.exists(userKey.toString());
- }
- //---------BindableCredentialStore implementation---------------------------------------------------------------------------------------------
- /**
- *
- */
- public Credential[] loadCredentials(CredentialKey credentialKey) throws SSOIdentityException
- {
- if(this.portalIdentityService == null)
- {
- throw new IllegalStateException("JOSSOIdentityStore not properly registered with the JOSSO system..");
- }
-
//Get the User corresponding to this credentialKey
BaseUser user = this.loadUser((SimpleUserKey)credentialKey);
SSONameValuePair[] properties = user.getProperties();
String password = properties[0].getValue();
return new Credential[]{new UsernameCredential(user.getName()), new PasswordCredential(password)};
- }
+ }
- /**
- *
- */
public boolean bind(String username, String password) throws SSOAuthenticationException
{
return this.portalIdentityService.authenticate(username, password);
}
-
-
- /**
- *
- */
- public void setAuthenticationScheme(AuthenticationScheme authenticationScheme)
- {
- if(this.portalIdentityService == null)
- {
- throw new IllegalStateException("JOSSOIdentityStore not properly registered with the JOSSO system..");
- }
-
- this.authenticationScheme = authenticationScheme;
- }
}
Modified: modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLoginModule.java
===================================================================
--- modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLoginModule.java 2009-04-16 09:05:50 UTC (rev 13224)
+++ modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLoginModule.java 2009-04-17 03:25:33 UTC (rev 13225)
@@ -36,10 +36,7 @@
import org.apache.log4j.Logger;
import org.josso.gateway.identity.SSORole;
-import org.josso.gateway.identity.SSOUser;
import org.josso.gateway.identity.service.BaseRoleImpl;
-import org.josso.gateway.identity.service.BaseUserImpl;
-import org.josso.tc55.agent.jaas.SSOGatewayLoginModule;
import javax.security.auth.Subject;
import javax.security.auth.callback.CallbackHandler;
@@ -50,6 +47,8 @@
import java.util.Map;
import java.util.Set;
+import org.josso.jb42.agent.JBossSSOGatewayLoginModule;
+
/**
* SSOGatewayLogin Module for JBoss.
* <p>
@@ -83,70 +82,20 @@
* @version CVS $Id: JBossSSOGatewayLoginModule.java 338 2006-02-09 16:53:07Z sgonzalez $
*/
-public class JOSSOLoginModule extends SSOGatewayLoginModule {
+public class JOSSOLoginModule extends JBossSSOGatewayLoginModule
+{
private static final Logger logger = Logger.getLogger(JOSSOLoginModule .class);
-
+
private Subject _savedSubject;
-
- /** the principal to use when user is not authenticated **/
- protected SSOUser _unauthenticatedIdentity;
-
-
- /**
- * Initialize this LoginModule .
- * Save the received Subject to change it when commit() gets invoked.
- *
- * @param subject the Subject to be authenticated.
- *
- * @param callbackHandler a CallbackHandler for communicating
- * with the end user (prompting for user names and
- * passwords, for example).
- *
- * @param sharedState shared LoginModule state.
- *
- * @param options options specified in the login Configuration
- * for this particular LoginModule.
- */
+
public void initialize(Subject subject, CallbackHandler callbackHandler,
- Map sharedState, Map options) {
-
- _savedSubject = subject;
- super.initialize(subject, callbackHandler, sharedState, options);
- // Check for unauthenticatedIdentity option.
- String name = (String) options.get("unauthenticatedIdentity");
- if( name != null )
- {
- try
- {
- _unauthenticatedIdentity = createIdentity(name);
- logger.debug("Saw unauthenticatedIdentity="+name);
- }
- catch(Exception e)
- {
- logger.warn("Failed to create custom unauthenticatedIdentity", e);
- }
- }
+ Map sharedState, Map options)
+ {
+ super.initialize(subject, callbackHandler, sharedState, options);
+ this._savedSubject = subject;
}
- /**
- * This method supports the unauthenticatedIdentity property used by JBoss.
- */
- public boolean login() throws LoginException {
-
- if (!super.login()) {
- // We have an unauthenticated user, use configured Principal
- if (_unauthenticatedIdentity != null) {
- logger.debug("Authenticated as unauthenticatedIdentity : " + _unauthenticatedIdentity);
- _ssoUserPrincipal = _unauthenticatedIdentity;
- _succeeded = true;
- return true;
- }
- }
-
- return true;
- }
-
/*
* This method is called if the LoginContext's overall authentication succeeded.
*
@@ -159,55 +108,22 @@
* @return true if this LoginModule's own login and commit
* attempts succeeded, or false otherwise.
*/
- public boolean commit() throws LoginException {
- boolean rc = false;
- // HashMap setsMap = new HashMap();
-
- rc = super.commit();
-
+ public boolean commit() throws LoginException
+ {
+ boolean rc = super.commit();
+
+
Set ssoRolePrincipals = _savedSubject.getPrincipals(SSORole.class);
Group targetGrp = new BaseRoleImpl("Roles");
Iterator i = ssoRolePrincipals.iterator();
Set cour = new java.util.HashSet();
- while (i.hasNext()) {
- Principal p = (Principal)i.next();
-
- targetGrp.addMember(p); // Add user role to "Roles" group
-
+ while (i.hasNext())
+ {
+ Principal p = (Principal)i.next();
//super hack to make the Subject work properly with the Portal Authorization Engine
((BaseRoleImpl)p).addMember(this.createIdentity(p.getName()));
}
- // Add the "Roles" group to the Subject so that JBoss can fetch user roles.
- _savedSubject.getPrincipals().removeAll(ssoRolePrincipals);
- _savedSubject.getPrincipals().add(targetGrp);
-
- /*Set ssoUserPrincipals = _savedSubject.getPrincipals(SSOUser.class);
- Group callerPrincipal = new BaseRoleImpl("CallerPrincipal");
- Iterator j = ssoUserPrincipals.iterator();
- if (j.hasNext()) {
- Principal user = (Principal) j.next();
- callerPrincipal.addMember(user);
- }
-
- // Add the "CallerPrincipal" group to the Subject so that JBoss can fetch user.
- _savedSubject.getPrincipals().add(callerPrincipal);*/
-
- return rc;
+
+ return rc;
}
-
- protected SSOUser createIdentity(String username) {
- return new BaseUserImpl(username);
- }
-
- protected SSORole[] getRoleSets() throws LoginException {
- if (_ssoUserPrincipal == _unauthenticatedIdentity) {
- // Using unauthenticatedIdentity ..
- if(logger.isDebugEnabled())
- logger.debug("Using unauthenticatedIdentity " + _ssoUserPrincipal + ", returning no roles.");
-
- return new SSORole[0];
- }
- return super.getRoleSets();
- }
-
}
Modified: modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLogoutValve.java
===================================================================
--- modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLogoutValve.java 2009-04-16 09:05:50 UTC (rev 13224)
+++ modules/identity/trunk/sso/src/main/java/org/jboss/portal/identity/sso/josso/JOSSOLogoutValve.java 2009-04-17 03:25:33 UTC (rev 13225)
@@ -83,8 +83,8 @@
this.getNext().invoke(request, response);
if(request.getAttribute("org.jboss.portal.logout") != null)
- {
- String jossoLogout = httpRequest.getContextPath() + org.josso.agent.Constants.JOSSO_LOGOUT_URI;
+ {
+ String jossoLogout = httpRequest.getContextPath() + "/josso_logout/";
Cookie cookie = new Cookie("JOSSO_PORTAL_LOGOUT",httpRequest.getHeader("Referer"));
cookie.setMaxAge(-1); //setting the value so that cookie expires when broser is closed
Modified: modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/EasySSLProtocolSocketFactory.java
===================================================================
--- modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/EasySSLProtocolSocketFactory.java 2009-04-16 09:05:50 UTC (rev 13224)
+++ modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/EasySSLProtocolSocketFactory.java 2009-04-17 03:25:33 UTC (rev 13225)
@@ -1,233 +1,233 @@
-///*
-// * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java,v 1.7 2004/06/11 19:26:27 olegk Exp $
-// * $Revision$
-// * $Date$
-// *
-// * ====================================================================
-// *
-// * Licensed to the Apache Software Foundation (ASF) under one or more
-// * contributor license agreements. See the NOTICE file distributed with
-// * this work for additional information regarding copyright ownership.
-// * The ASF licenses this file to You under the Apache License, Version 2.0
-// * (the "License"); you may not use this file except in compliance with
-// * the License. You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0
-// *
-// * Unless required by applicable law or agreed to in writing, software
-// * distributed under the License is distributed on an "AS IS" BASIS,
-// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// * See the License for the specific language governing permissions and
-// * limitations under the License.
-// * ====================================================================
-// *
-// * This software consists of voluntary contributions made by many
-// * individuals on behalf of the Apache Software Foundation. For more
-// * information on the Apache Software Foundation, please see
-// * <http://www.apache.org/>.
-// *
-// */
-//
-//package org.jboss.portal.test.identity.sso;
-//
-//import java.io.IOException;
-//import java.net.InetAddress;
-//import java.net.InetSocketAddress;
-//import java.net.Socket;
-//import java.net.SocketAddress;
-//import java.net.UnknownHostException;
-//
-//import org.apache.commons.httpclient.ConnectTimeoutException;
-//import org.apache.commons.httpclient.HttpClientError;
-//import org.apache.commons.httpclient.params.HttpConnectionParams;
-//import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
-//
-//import javax.net.SocketFactory;
-//import javax.net.ssl.SSLContext;
-//import javax.net.ssl.TrustManager;
-//
-///**
-// * <p>
-// * EasySSLProtocolSocketFactory can be used to creats SSL {@link Socket}s that
-// * accept self-signed certificates.
-// * </p>
-// * <p>
-// * This socket factory SHOULD NOT be used for productive systems due to security
-// * reasons, unless it is a concious decision and you are perfectly aware of
-// * security implications of accepting self-signed certificates
-// * </p>
-// *
-// * <p>
-// * Example of using custom protocol socket factory for a specific host:
-// *
-// * <pre>
-// * Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(),
-// * 443);
-// * HttpClient client = new HttpClient();
-// * client.getHostConfiguration().setHost("localhost", 443, easyhttps);
-// * // use relative url only
-// * GetMethod httpget = new GetMethod("/");
-// * client.executeMethod(httpget);
-// * </pre>
-// *
-// * </p>
-// * <p>
-// * Example of using custom protocol socket factory per default instead of the
-// * standard one:
-// *
-// * <pre>
-// * Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(),
-// * 443);
-// * Protocol.registerProtocol("https", easyhttps);
-// * HttpClient client = new HttpClient();
-// * GetMethod httpget = new GetMethod("https://localhost/");
-// * client.executeMethod(httpget);
-// * </pre>
-// *
-// * </p>
-// *
-// * @author <a href="mailto:oleg -at- ural.ru">Oleg Kalnichevski</a>
-// *
-// * <p>
-// * DISCLAIMER: HttpClient developers DO NOT actively support this component. The
-// * component is provided as a reference material, which may be inappropriate for
-// * use without additional customization.
-// * </p>
-// */
-//
-//public class EasySSLProtocolSocketFactory implements
-// SecureProtocolSocketFactory
-//{
-//
-// private SSLContext sslcontext = null;
-//
-// /**
-// * Constructor for EasySSLProtocolSocketFactory.
-// */
-// public EasySSLProtocolSocketFactory()
-// {
-// super();
-// }
-//
-// private static SSLContext createEasySSLContext()
-// {
-// try
-// {
-// SSLContext context = SSLContext.getInstance("SSL");
-// context.init(null, new TrustManager[]
-// { new EasyX509TrustManager(null) }, null);
-// return context;
-// }
-// catch (Exception e)
-// {
-// throw new HttpClientError(e.toString());
-// }
-// }
-//
-// private SSLContext getSSLContext()
-// {
-// if (this.sslcontext == null)
-// {
-// this.sslcontext = createEasySSLContext();
-// }
-// return this.sslcontext;
-// }
-//
-// /**
-// * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int)
-// */
-// public Socket createSocket(String host, int port, InetAddress clientHost,
-// int clientPort) throws IOException, UnknownHostException
-// {
-//
-// return getSSLContext().getSocketFactory().createSocket(host, port,
-// clientHost, clientPort);
-// }
-//
-// /**
-// * Attempts to get a new socket connection to the given host within the given
-// * time limit.
-// * <p>
-// * To circumvent the limitations of older JREs that do not support connect
-// * timeout a controller thread is executed. The controller thread attempts to
-// * create a new socket within the given limit of time. If socket constructor
-// * does not return until the timeout expires, the controller terminates and
-// * throws an {@link ConnectTimeoutException}
-// * </p>
-// *
-// * @param host
-// * the host name/IP
-// * @param port
-// * the port on the host
-// * @param clientHost
-// * the local host name/IP to bind the socket to
-// * @param clientPort
-// * the port on the local machine
-// * @param params
-// * {@link HttpConnectionParams Http connection parameters}
-// *
-// * @return Socket a new socket
-// *
-// * @throws IOException
-// * if an I/O error occurs while creating the socket
-// * @throws UnknownHostException
-// * if the IP address of the host cannot be determined
-// */
-// public Socket createSocket(final String host, final int port,
-// final InetAddress localAddress, final int localPort,
-// final HttpConnectionParams params) throws IOException,
-// UnknownHostException, ConnectTimeoutException
-// {
-// if (params == null)
-// {
-// throw new IllegalArgumentException("Parameters may not be null");
-// }
-// int timeout = params.getConnectionTimeout();
-// SocketFactory socketfactory = getSSLContext().getSocketFactory();
-// if (timeout == 0)
-// {
-// return socketfactory.createSocket(host, port, localAddress, localPort);
-// }
-// else
-// {
-// Socket socket = socketfactory.createSocket();
-// SocketAddress localaddr = new InetSocketAddress(localAddress,
-// localPort);
-// SocketAddress remoteaddr = new InetSocketAddress(host, port);
-// socket.bind(localaddr);
-// socket.connect(remoteaddr, timeout);
-// return socket;
-// }
-// }
-//
-// /**
-// * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int)
-// */
-// public Socket createSocket(String host, int port) throws IOException,
-// UnknownHostException
-// {
-// return getSSLContext().getSocketFactory().createSocket(host, port);
-// }
-//
-// /**
-// * @see SecureProtocolSocketFactory#createSocket(java.net.Socket,java.lang.String,int,boolean)
-// */
-// public Socket createSocket(Socket socket, String host, int port,
-// boolean autoClose) throws IOException, UnknownHostException
-// {
-// return getSSLContext().getSocketFactory().createSocket(socket, host,
-// port, autoClose);
-// }
-//
-// public boolean equals(Object obj)
-// {
-// return ((obj != null) && obj.getClass().equals(
-// EasySSLProtocolSocketFactory.class));
-// }
-//
-// public int hashCode()
-// {
-// return EasySSLProtocolSocketFactory.class.hashCode();
-// }
-//
-//}
+/*
+ * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commonshttpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java,v 1.7 2004/06/11 19:26:27 olegk Exp $
+ * $Revision$
+ * $Date$
+ *
+ * ====================================================================
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http:www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http:www.apache.org/>.
+ *
+ */
+
+package org.jboss.portal.test.identity.sso;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+
+import org.apache.commons.httpclient.ConnectTimeoutException;
+import org.apache.commons.httpclient.HttpClientError;
+import org.apache.commons.httpclient.params.HttpConnectionParams;
+import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
+
+import javax.net.SocketFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+
+/**
+ * <p>
+ * EasySSLProtocolSocketFactory can be used to creats SSL {@link Socket}s that
+ * accept self-signed certificates.
+ * </p>
+ * <p>
+ * This socket factory SHOULD NOT be used for productive systems due to security
+ * reasons, unless it is a concious decision and you are perfectly aware of
+ * security implications of accepting self-signed certificates
+ * </p>
+ *
+ * <p>
+ * Example of using custom protocol socket factory for a specific host:
+ *
+ * <pre>
+ * Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(),
+ * 443);
+ * HttpClient client = new HttpClient();
+ * client.getHostConfiguration().setHost("localhost", 443, easyhttps);
+ * use relative url only
+ * GetMethod httpget = new GetMethod("/");
+ * client.executeMethod(httpget);
+ * </pre>
+ *
+ * </p>
+ * <p>
+ * Example of using custom protocol socket factory per default instead of the
+ * standard one:
+ *
+ * <pre>
+ * Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(),
+ * 443);
+ * Protocol.registerProtocol("https", easyhttps);
+ * HttpClient client = new HttpClient();
+ * GetMethod httpget = new GetMethod("https:localhost/");
+ * client.executeMethod(httpget);
+ * </pre>
+ *
+ * </p>
+ *
+ * @author <a href="mailto:oleg -at- ural.ru">Oleg Kalnichevski</a>
+ *
+ * <p>
+ * DISCLAIMER: HttpClient developers DO NOT actively support this component. The
+ * component is provided as a reference material, which may be inappropriate for
+ * use without additional customization.
+ * </p>
+ */
+
+public class EasySSLProtocolSocketFactory implements
+ SecureProtocolSocketFactory
+{
+
+ private SSLContext sslcontext = null;
+
+ /**
+ * Constructor for EasySSLProtocolSocketFactory.
+ */
+ public EasySSLProtocolSocketFactory()
+ {
+ super();
+ }
+
+ private static SSLContext createEasySSLContext()
+ {
+ try
+ {
+ SSLContext context = SSLContext.getInstance("SSL");
+ context.init(null, new TrustManager[]
+ { new EasyX509TrustManager(null) }, null);
+ return context;
+ }
+ catch (Exception e)
+ {
+ throw new HttpClientError(e.toString());
+ }
+ }
+
+ private SSLContext getSSLContext()
+ {
+ if (this.sslcontext == null)
+ {
+ this.sslcontext = createEasySSLContext();
+ }
+ return this.sslcontext;
+ }
+
+ /**
+ * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int)
+ */
+ public Socket createSocket(String host, int port, InetAddress clientHost,
+ int clientPort) throws IOException, UnknownHostException
+ {
+
+ return getSSLContext().getSocketFactory().createSocket(host, port,
+ clientHost, clientPort);
+ }
+
+ /**
+ * Attempts to get a new socket connection to the given host within the given
+ * time limit.
+ * <p>
+ * To circumvent the limitations of older JREs that do not support connect
+ * timeout a controller thread is executed. The controller thread attempts to
+ * create a new socket within the given limit of time. If socket constructor
+ * does not return until the timeout expires, the controller terminates and
+ * throws an {@link ConnectTimeoutException}
+ * </p>
+ *
+ * @param host
+ * the host name/IP
+ * @param port
+ * the port on the host
+ * @param clientHost
+ * the local host name/IP to bind the socket to
+ * @param clientPort
+ * the port on the local machine
+ * @param params
+ * {@link HttpConnectionParams Http connection parameters}
+ *
+ * @return Socket a new socket
+ *
+ * @throws IOException
+ * if an I/O error occurs while creating the socket
+ * @throws UnknownHostException
+ * if the IP address of the host cannot be determined
+ */
+ public Socket createSocket(final String host, final int port,
+ final InetAddress localAddress, final int localPort,
+ final HttpConnectionParams params) throws IOException,
+ UnknownHostException, ConnectTimeoutException
+ {
+ if (params == null)
+ {
+ throw new IllegalArgumentException("Parameters may not be null");
+ }
+ int timeout = params.getConnectionTimeout();
+ SocketFactory socketfactory = getSSLContext().getSocketFactory();
+ if (timeout == 0)
+ {
+ return socketfactory.createSocket(host, port, localAddress, localPort);
+ }
+ else
+ {
+ Socket socket = socketfactory.createSocket();
+ SocketAddress localaddr = new InetSocketAddress(localAddress,
+ localPort);
+ SocketAddress remoteaddr = new InetSocketAddress(host, port);
+ socket.bind(localaddr);
+ socket.connect(remoteaddr, timeout);
+ return socket;
+ }
+ }
+
+ /**
+ * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int)
+ */
+ public Socket createSocket(String host, int port) throws IOException,
+ UnknownHostException
+ {
+ return getSSLContext().getSocketFactory().createSocket(host, port);
+ }
+
+ /**
+ * @see SecureProtocolSocketFactory#createSocket(java.net.Socket,java.lang.String,int,boolean)
+ */
+ public Socket createSocket(Socket socket, String host, int port,
+ boolean autoClose) throws IOException, UnknownHostException
+ {
+ return getSSLContext().getSocketFactory().createSocket(socket, host,
+ port, autoClose);
+ }
+
+ public boolean equals(Object obj)
+ {
+ return ((obj != null) && obj.getClass().equals(
+ EasySSLProtocolSocketFactory.class));
+ }
+
+ public int hashCode()
+ {
+ return EasySSLProtocolSocketFactory.class.hashCode();
+ }
+
+}
Modified: modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/EasyX509TrustManager.java
===================================================================
--- modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/EasyX509TrustManager.java 2009-04-16 09:05:50 UTC (rev 13224)
+++ modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/EasyX509TrustManager.java 2009-04-17 03:25:33 UTC (rev 13225)
@@ -1,109 +1,109 @@
-///*
-//* ====================================================================
-//*
-//* Licensed to the Apache Software Foundation (ASF) under one or more
-//* contributor license agreements. See the NOTICE file distributed with
-//* this work for additional information regarding copyright ownership.
-//* The ASF licenses this file to You under the Apache License, Version 2.0
-//* (the "License"); you may not use this file except in compliance with
-//* the License. You may obtain a copy of the License at
-//*
-//* http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing, software
-//* distributed under the License is distributed on an "AS IS" BASIS,
-//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//* See the License for the specific language governing permissions and
-//* limitations under the License.
-//* ====================================================================
-//*
-//* This software consists of voluntary contributions made by many
-//* individuals on behalf of the Apache Software Foundation. For more
-//* information on the Apache Software Foundation, please see
-//* <http://www.apache.org/>.
-//*
-//*/
-//
-//package org.jboss.portal.test.identity.sso;
-//
-//import java.security.KeyStore;
-//import java.security.KeyStoreException;
-//import java.security.NoSuchAlgorithmException;
-//import java.security.cert.CertificateException;
-//import java.security.cert.X509Certificate;
-//
-//import javax.net.ssl.TrustManagerFactory;
-//import javax.net.ssl.TrustManager;
-//import javax.net.ssl.X509TrustManager;
-//
-///**
-//* <p>
-//* EasyX509TrustManager unlike default {@link X509TrustManager} accepts
-//* self-signed certificates.
-//* </p>
-//* <p>
-//* This trust manager SHOULD NOT be used for productive systems
-//* due to security reasons, unless it is a concious decision and
-//* you are perfectly aware of security implications of accepting
-//* self-signed certificates
-//* </p>
-//*
-//* @author <a href="mailto:adrian.sutton@ephox.com">Adrian Sutton</a>
-//* @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
-//*
-//* <p>
-//* DISCLAIMER: HttpClient developers DO NOT actively support this component.
-//* The component is provided as a reference material, which may be inappropriate
-//* for use without additional customization.
-//* </p>
-//*/
-//
-//public class EasyX509TrustManager implements X509TrustManager
-//{
-// private X509TrustManager standardTrustManager = null;
-//
-// /**
-// * Constructor for EasyX509TrustManager.
-// */
-// public EasyX509TrustManager(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException {
-// super();
-// TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
-// factory.init(keystore);
-// TrustManager[] trustmanagers = factory.getTrustManagers();
-// if (trustmanagers.length == 0) {
-// throw new NoSuchAlgorithmException("no trust manager found");
-// }
-// this.standardTrustManager = (X509TrustManager)trustmanagers[0];
-// }
-//
-// /**
-// * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],String authType)
-// */
-// public void checkClientTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
-// standardTrustManager.checkClientTrusted(certificates,authType);
-// }
-//
-// /**
-// * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[],String authType)
-// */
-// public void checkServerTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
-// /*if ((certificates != null) && LOG.isDebugEnabled()) {
-// LOG.debug("Server certificate chain:");
-// for (int i = 0; i < certificates.length; i++) {
-// LOG.debug("X509Certificate[" + i + "]=" + certificates[i]);
-// }
-// }*/
-// if ((certificates != null) && (certificates.length == 1)) {
-// certificates[0].checkValidity();
-// } else {
-// standardTrustManager.checkServerTrusted(certificates,authType);
-// }
-// }
-//
-// /**
-// * @see javax.net.ssl.X509TrustManager#getAcceptedIssuers()
-// */
-// public X509Certificate[] getAcceptedIssuers() {
-// return this.standardTrustManager.getAcceptedIssuers();
-// }
-//}
\ No newline at end of file
+/*
+* ====================================================================
+*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http:www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ====================================================================
+*
+* This software consists of voluntary contributions made by many
+* individuals on behalf of the Apache Software Foundation. For more
+* information on the Apache Software Foundation, please see
+* <http:www.apache.org/>.
+*
+*/
+
+package org.jboss.portal.test.identity.sso;
+
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+/**
+* <p>
+* EasyX509TrustManager unlike default {@link X509TrustManager} accepts
+* self-signed certificates.
+* </p>
+* <p>
+* This trust manager SHOULD NOT be used for productive systems
+* due to security reasons, unless it is a concious decision and
+* you are perfectly aware of security implications of accepting
+* self-signed certificates
+* </p>
+*
+* @author <a href="mailto:adrian.sutton@ephox.com">Adrian Sutton</a>
+* @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
+*
+* <p>
+* DISCLAIMER: HttpClient developers DO NOT actively support this component.
+* The component is provided as a reference material, which may be inappropriate
+* for use without additional customization.
+* </p>
+*/
+
+public class EasyX509TrustManager implements X509TrustManager
+{
+ private X509TrustManager standardTrustManager = null;
+
+ /**
+ * Constructor for EasyX509TrustManager.
+ */
+ public EasyX509TrustManager(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException {
+ super();
+ TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+ factory.init(keystore);
+ TrustManager[] trustmanagers = factory.getTrustManagers();
+ if (trustmanagers.length == 0) {
+ throw new NoSuchAlgorithmException("no trust manager found");
+ }
+ this.standardTrustManager = (X509TrustManager)trustmanagers[0];
+ }
+
+ /**
+ * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],String authType)
+ */
+ public void checkClientTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
+ standardTrustManager.checkClientTrusted(certificates,authType);
+ }
+
+ /**
+ * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[],String authType)
+ */
+ public void checkServerTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
+ /*if ((certificates != null) && LOG.isDebugEnabled()) {
+ LOG.debug("Server certificate chain:");
+ for (int i = 0; i < certificates.length; i++) {
+ LOG.debug("X509Certificate[" + i + "]=" + certificates[i]);
+ }
+ }*/
+ if ((certificates != null) && (certificates.length == 1)) {
+ certificates[0].checkValidity();
+ } else {
+ standardTrustManager.checkServerTrusted(certificates,authType);
+ }
+ }
+
+ /**
+ * @see javax.net.ssl.X509TrustManager#getAcceptedIssuers()
+ */
+ public X509Certificate[] getAcceptedIssuers() {
+ return this.standardTrustManager.getAcceptedIssuers();
+ }
+}
\ No newline at end of file
Modified: modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/JOSSOTestCase.java
===================================================================
--- modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/JOSSOTestCase.java 2009-04-16 09:05:50 UTC (rev 13224)
+++ modules/identity/trunk/sso/src/test/java/org/jboss/portal/test/identity/sso/JOSSOTestCase.java 2009-04-17 03:25:33 UTC (rev 13225)
@@ -1,726 +1,712 @@
-///******************************************************************************
-// * JBoss, a division of Red Hat *
-// * Copyright 2006, Red Hat Middleware, LLC, and individual *
-// * contributors as indicated by the @authors tag. See the *
-// * copyright.txt in the distribution for a full listing of *
-// * individual contributors. *
-// * *
-// * This is free software; you can redistribute it and/or modify it *
-// * under the terms of the GNU Lesser General Public License as *
-// * published by the Free Software Foundation; either version 2.1 of *
-// * the License, or (at your option) any later version. *
-// * *
-// * This software is distributed in the hope that it will be useful, *
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of *
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
-// * Lesser General Public License for more details. *
-// * *
-// * You should have received a copy of the GNU Lesser General Public *
-// * License along with this software; if not, write to the Free *
-// * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
-// * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
-// ******************************************************************************/
-//package org.jboss.portal.test.identity.sso;
-//
-//import java.util.Map;
-//import java.util.Set;
-//import java.util.Iterator;
-//import java.util.HashMap;
-//
-//import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-//
-//import org.apache.commons.httpclient.HttpClient;
-//import org.apache.commons.httpclient.Cookie;
-//import org.apache.commons.httpclient.NameValuePair;
-//import org.apache.commons.httpclient.methods.GetMethod;
-//import org.apache.commons.httpclient.methods.PostMethod;
-//import org.apache.commons.httpclient.protocol.Protocol;
-//
-//import junit.framework.TestCase;
-//
-///**
-// * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
-// *
-// */
-//public class JOSSOTestCase extends TestCase
-//{
-// /**
-// *
-// */
-// private String firstPortal = null;
-// private String secondPortal = null;
-// private String sameHostSecondPortal = null;
-// private String jossoServer = null;
-// private String userLoggedInIndicator = null;
-// private String username = null;
-// private String password = null;
-//
-// /**
-// *
-// */
-// protected TestRuntimeContext runtimeContext = null;
-//
-// /**
-// *
-// */
-// protected void setUp() throws Exception
-// {
-// super.setUp();
-//
-// this.runtimeContext = new TestRuntimeContext("org/jboss/portal/test/identity/sso-beans.xml");
-//
-// this.runtimeContext.addBean("JOSSOConfig", this);
-// this.runtimeContext.addBean("CASConfig", new CASTestCase());
-//
-// this.runtimeContext.start();
-//
-// //SSL setup
-// Protocol.registerProtocol("https",new Protocol("https", new EasySSLProtocolSocketFactory(), 443));
-// }
-//
-// /**
-// *
-// */
-// protected void tearDown() throws Exception
-// {
-// super.tearDown();
-//
-// //Service stoppage
-// this.runtimeContext.stop();
-//
-// //Data cleanup
-// this.runtimeContext = null;
-// }
-//
-// /**
-// *
-// * @return
-// */
-// public String getUserLoggedInIndicator()
-// {
-// return userLoggedInIndicator;
-// }
-//
-// /**
-// *
-// * @param userLoggedInIndicator
-// */
-// public void setUserLoggedInIndicator(String userLoggedInIndicator)
-// {
-// this.userLoggedInIndicator = userLoggedInIndicator;
-// }
-//
-// /**
-// *
-// * @return
-// */
-// public String getPassword()
-// {
-// return password;
-// }
-//
-// /**
-// *
-// * @param password
-// */
-// public void setPassword(String password)
-// {
-// this.password = password;
-// }
-//
-// /**
-// *
-// * @return
-// */
-// public String getUsername()
-// {
-// return username;
-// }
-//
-// /**
-// *
-// * @param username
-// */
-// public void setUsername(String username)
-// {
-// this.username = username;
-// }
-//
-// /**
-// *
-// * @return
-// */
-// public String getFirstPortal()
-// {
-// return firstPortal;
-// }
-//
-// /**
-// *
-// * @param firstPortal
-// */
-// public void setFirstPortal(String firstPortal)
-// {
-// this.firstPortal = firstPortal;
-// }
-//
-// /**
-// *
-// * @return
-// */
-// public String getSecondPortal()
-// {
-// return secondPortal;
-// }
-//
-// /**
-// *
-// * @param secondPortal
-// */
-// public void setSecondPortal(String secondPortal)
-// {
-// this.secondPortal = secondPortal;
-// }
-//
-// /**
-// *
-// * @return
-// */
-// public String getJossoServer()
-// {
-// return jossoServer;
-// }
-//
-// /**
-// *
-// * @param jossoServer
-// */
-// public void setJossoServer(String jossoServer)
-// {
-// this.jossoServer = jossoServer;
-// }
-//
-// /**
-// *
-// * @return
-// */
-// public String getSameHostSecondPortal()
-// {
-// return sameHostSecondPortal;
-// }
-//
-// /**
-// *
-// * @param sameHostSecondPortal
-// */
-// public void setSameHostSecondPortal(String sameHostSecondPortal)
-// {
-// this.sameHostSecondPortal = sameHostSecondPortal;
-// }
-//
-// /**
-// * This tests the scenario when the two portals are deployed on separate hosts/servers
-// *
-// * @throws Exception
-// */
-// public void testMultiHostDeployment() throws Exception
-// {
-// Cookie ssoCookie = null;
-// String firstPortalFinalResponse = null;
-// String secondPortalFinalResponse = null;
-//
-// //Load the main portal page on firstPortalContext
-// String firstContextPortalUrl = this.firstPortal;
-// WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
-// TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
-//
-// //Click the Login link on the firstPortalContext
-// String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
-// this.sendGet(firstContextLoginUrl, portalConversation);
-//
-// //Navigate to a secured resource on the portal
-// TestCase.assertNotNull(portalConversation.getRedirectLocation());
-// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
-// String portalToJOSSO = portalConversation.getRedirectLocation();
-// this.sendGet(portalToJOSSO, portalConversation);
-//
-// //When authentication is triggered, move over to the JOSSO server establishing an SSO session with JOSSO
-// String jossoLocation = portalConversation.getRedirectLocation();
-// WebConversation ssoConversation = this.startConversation(jossoLocation);
-// String response = ssoConversation.getResponse();
-//
-// //Extract the josso post action value
-// int searchIndex = response.indexOf("action=\"")+9;
-// int endIndex = response.indexOf('"', searchIndex);
-// String action = response.substring(searchIndex,endIndex);
-//
-// //Perform HTTP Post based authentication with the JOSSO Server
-// Map postParams = new HashMap();
-// postParams.put("josso_username", this.username);
-// postParams.put("josso_password", this.password);
-// postParams.put("josso_cmd", "login");
-// this.sendPost("http://"+ this.jossoServer +"/"+action,postParams, ssoConversation);
-//
-// //Go back to the Portal since login has succeeded, starting with assertion on the JOSSO Agent installed on the Portal
-// String assertUrl = ssoConversation.getRedirectLocation();
-// this.sendGet(assertUrl, portalConversation);
-//
-// //Now go back to the original Portal resource requested. This time user should have an authenticated session established
-// TestCase.assertNotNull(portalConversation.getRedirectLocation());
-// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
-// TestCase.assertTrue(portalConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
-// TestCase.assertNotNull(portalConversation.getSSOCookie());
-// String goBack = portalConversation.getRedirectLocation();
-// ssoCookie = ssoConversation.getSSOCookie();
-// this.sendGet(goBack, portalConversation);
-// firstPortalFinalResponse = portalConversation.getResponse();
-// TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
-//
-// //Load the main portal page on secondPortalContext
-// String secondContextPortalUrl = this.secondPortal;
-// portalConversation = this.startConversation(secondContextPortalUrl);
-//
-// //Click the Login Link on the secondPortalContext
-// String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
-// this.sendGet(secondContextLoginUrl, portalConversation);
-//
-// //Perform re-direct to the JOSSO Server but this time sending in the JOSSO cookie
-// TestCase.assertNotNull(portalConversation.getRedirectLocation());
-// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
-// portalToJOSSO = portalConversation.getRedirectLocation();
-// this.sendGet(portalToJOSSO, portalConversation);
-//
-//
-// //Assert the redirect and it should be to the JOSSO Server, but this time
-// //It should end up with an Authenticated session back to the secondPortalContext
-// jossoLocation = portalConversation.getRedirectLocation();
-// ssoConversation = this.startConversation(jossoLocation,ssoCookie);
-// secondPortalFinalResponse = ssoConversation.getResponse();
-// TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
-//
-// //Assert and make sure its the same user logged into both Portals
-// String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
-// String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
-// TestCase.assertEquals(firstPortalUser, this.username);
-// TestCase.assertEquals(secondPortalUser, this.username);
-// TestCase.assertEquals(firstPortalUser, secondPortalUser);
-// }
-//
-// /**
-// * This tests the scenario where the two portals are deployed within the same host/server but under
-// * different web contexts
-// *
-// * @throws Exception
-// */
-// public void testSameHostDeployment() throws Exception
-// {
-// Cookie ssoCookie = null;
-// String firstPortalFinalResponse = null;
-// String secondPortalFinalResponse = null;
-//
-// //Load the main portal page on firstPortalContext
-// String firstContextPortalUrl = this.firstPortal;
-// WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
-// TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
-//
-// //Click the Login link on the firstPortalContext
-// String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
-// this.sendGet(firstContextLoginUrl, portalConversation);
-//
-// //Navigate to a secured resource on the portal
-// TestCase.assertNotNull(portalConversation.getRedirectLocation());
-// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
-// String portalToJOSSO = portalConversation.getRedirectLocation();
-// this.sendGet(portalToJOSSO, portalConversation);
-//
-// //When authentication is triggered, move over to the JOSSO server establishing an SSO session with JOSSO
-// String jossoLocation = portalConversation.getRedirectLocation();
-// WebConversation ssoConversation = this.startConversation(jossoLocation);
-// String response = ssoConversation.getResponse();
-//
-// //Extract the josso post action value
-// int searchIndex = response.indexOf("action=\"")+9;
-// int endIndex = response.indexOf('"', searchIndex);
-// String action = response.substring(searchIndex,endIndex);
-//
-// //Perform HTTP Post based authentication with the JOSSO Server
-// Map postParams = new HashMap();
-// postParams.put("josso_username", this.username);
-// postParams.put("josso_password", this.password);
-// postParams.put("josso_cmd", "login");
-// this.sendPost("http://"+ this.jossoServer +"/"+action,postParams, ssoConversation);
-//
-// //Go back to the Portal since login has succeeded, starting with assertion on the JOSSO Agent installed on the Portal
-// String assertUrl = ssoConversation.getRedirectLocation();
-// this.sendGet(assertUrl, portalConversation);
-//
-// //Now go back to the original Portal resource requested. This time user should have an authenticated session established
-// TestCase.assertNotNull(portalConversation.getRedirectLocation());
-// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
-// TestCase.assertTrue(portalConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
-// TestCase.assertNotNull(portalConversation.getSSOCookie());
-// String goBack = portalConversation.getRedirectLocation();
-// ssoCookie = ssoConversation.getSSOCookie();
-// this.sendGet(goBack, portalConversation);
-// firstPortalFinalResponse = portalConversation.getResponse();
-// TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
-//
-// //Load the main portal page on secondPortalContext
-// String secondContextPortalUrl = this.sameHostSecondPortal;
-// portalConversation = this.startConversation(secondContextPortalUrl);
-//
-// //Click the Login Link on the secondPortalContext
-// String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
-// this.sendGet(secondContextLoginUrl, portalConversation);
-//
-// //Perform re-direct to the JOSSO Server but this time sending in the JOSSO cookie
-// TestCase.assertNotNull(portalConversation.getRedirectLocation());
-// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
-// portalToJOSSO = portalConversation.getRedirectLocation();
-// this.sendGet(portalToJOSSO, portalConversation);
-//
-//
-// //Assert the redirect and it should be to the JOSSO Server, but this time
-// //It should end up with an Authenticated session back to the secondPortalContext
-// jossoLocation = portalConversation.getRedirectLocation();
-// ssoConversation = this.startConversation(jossoLocation,ssoCookie);
-// secondPortalFinalResponse = ssoConversation.getResponse();
-// TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
-//
-// //Assert and make sure its the same user logged into both Portals
-// String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
-// String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
-// TestCase.assertEquals(firstPortalUser, this.username);
-// TestCase.assertEquals(secondPortalUser, this.username);
-// TestCase.assertEquals(firstPortalUser, secondPortalUser);
-// }
-//
-// /**
-// *
-// * @param portalUrl
-// * @return
-// * @throws Exception
-// */
-// private WebConversation startConversation(String portalUrl) throws Exception
-// {
-// WebConversation conversation = null;
-//
-// HttpClient httpClient = new HttpClient();
-// GetMethod getMethod = new GetMethod(portalUrl);
-// try
-// {
-// conversation = new WebConversation();
-//
-// int statusCode = httpClient.executeMethod(getMethod);
-// String response = getMethod.getResponseBodyAsString();
-//
-// Cookie[] cookies = httpClient.getState().getCookies();
-// for(int i=0;i<cookies.length;i++)
-// {
-// if(cookies[i].getName().equals("JSESSIONID"))
-// {
-// conversation.setSessionId(cookies[i].getValue());
-// }
-// }
-//
-// conversation.setClient(httpClient);
-// conversation.setStatusCode(statusCode);
-// conversation.setResponse(response);
-// }
-// finally
-// {
-// if(getMethod != null)
-// {
-// getMethod.releaseConnection();
-// }
-// }
-//
-// return conversation;
-// }
-//
-// /**
-// *
-// * @param portalUrl
-// * @return
-// * @throws Exception
-// */
-// private WebConversation startConversation(String portalUrl, Cookie ssoCookie) throws Exception
-// {
-// WebConversation conversation = null;
-//
-// HttpClient httpClient = new HttpClient();
-// GetMethod getMethod = new GetMethod(portalUrl);
-//
-// //Set ssoCookie to be sent in
-// getMethod.setRequestHeader("Cookie",ssoCookie.getName()+"="+ssoCookie.getValue());
-//
-// try
-// {
-// conversation = new WebConversation();
-//
-// int statusCode = httpClient.executeMethod(getMethod);
-// String response = getMethod.getResponseBodyAsString();
-//
-// Cookie[] cookies = httpClient.getState().getCookies();
-// for(int i=0;i<cookies.length;i++)
-// {
-// if(cookies[i].getName().equals("JSESSIONID"))
-// {
-// conversation.setSessionId(cookies[i].getValue());
-// }
-// }
-//
-// conversation.setClient(httpClient);
-// conversation.setStatusCode(statusCode);
-// conversation.setResponse(response);
-// }
-// finally
-// {
-// if(getMethod != null)
-// {
-// getMethod.releaseConnection();
-// }
-// }
-//
-// return conversation;
-// }
-//
-// /**
-// *
-// * @param portalUrl
-// * @param conversation
-// * @throws Exception
-// */
-// private void sendGet(String portalUrl,WebConversation conversation) throws Exception
-// {
-// HttpClient httpClient = conversation.getClient();
-//
-// GetMethod getMethod = new GetMethod(portalUrl);
-// getMethod.setFollowRedirects(false);
-// try
-// {
-// int statusCode = httpClient.executeMethod(getMethod);
-//
-// String response = getMethod.getResponseBodyAsString();
-//
-// Cookie[] cookies = httpClient.getState().getCookies();
-// for(int i=0;i<cookies.length;i++)
-// {
-// if(cookies[i].getName().equals("JSESSIONID"))
-// {
-// conversation.setSessionId(cookies[i].getValue());
-// }
-// if(cookies[i].getName().equals("JOSSO_SESSIONID"))
-// {
-// conversation.setSSOCookie(cookies[i]);
-// }
-// }
-//
-// conversation.setStatusCode(statusCode);
-// conversation.setResponse(response);
-//
-// if(statusCode == 302)
-// {
-// //Store the redirect location
-// String location = getMethod.getResponseHeader("Location").getValue();
-// conversation.setRedirectLocation(location);
-// }
-// }
-// finally
-// {
-// if(getMethod != null)
-// {
-// getMethod.releaseConnection();
-// }
-// }
-// }
-//
-//
-// /**
-// *
-// * @param url
-// * @param parameters
-// * @param conversation
-// * @throws Exception
-// */
-// private void sendPost(String url,Map parameters,WebConversation conversation) throws Exception
-// {
-// HttpClient httpClient = conversation.getClient();
-//
-// PostMethod postMethod = new PostMethod(url);
-//
-// //Add post parameters
-// Set keySet = parameters.keySet();
-// NameValuePair[] postdata = new NameValuePair[keySet.size()];
-// int index = 0;
-// for(Iterator itr=keySet.iterator();itr.hasNext();)
-// {
-// String name = (String)itr.next();
-// String value = (String)parameters.get(name);
-// postdata[index++] = new NameValuePair(name,value);
-// }
-// postMethod.setRequestBody(postdata);
-// try
-// {
-// int statusCode = httpClient.executeMethod(postMethod);
-//
-// String response = postMethod.getResponseBodyAsString();
-//
-// Cookie[] cookies = httpClient.getState().getCookies();
-// for(int i=0;i<cookies.length;i++)
-// {
-// if(cookies[i].getName().equals("JSESSIONID"))
-// {
-// conversation.setSessionId(cookies[i].getValue());
-// }
-// if(cookies[i].getName().equals("JOSSO_SESSIONID"))
-// {
-// conversation.setSSOCookie(cookies[i]);
-// }
-// }
-//
-// conversation.setStatusCode(statusCode);
-// conversation.setResponse(response);
-//
-// if(statusCode == 302)
-// {
-// //Store the redirect location
-// String location = postMethod.getResponseHeader("Location").getValue();
-// conversation.setRedirectLocation(location);
-// }
-// }
-// finally
-// {
-// if(postMethod != null)
-// {
-// postMethod.releaseConnection();
-// }
-// }
-// }
-//
-// /**
-// *
-// * @param response
-// * @return
-// */
-// private boolean isUserLoggedIn(String response)
-// {
-// boolean isUserLoggedIn = false;
-//
-// isUserLoggedIn = (response.indexOf(this.userLoggedInIndicator) != -1);
-//
-// return isUserLoggedIn;
-// }
-//
-// /**
-// *
-// * @param response
-// * @return
-// */
-// private String extractLoggedInUser(String response)
-// {
-// String loggedInUser = null;
-//
-// int startIndex = response.indexOf(this.userLoggedInIndicator) + this.userLoggedInIndicator.length();
-// int endIndex = response.indexOf("<",startIndex);
-//
-// loggedInUser = response.substring(startIndex,endIndex).trim();
-//
-// return loggedInUser;
-// }
-//
-// /**
-// *
-// * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
-// *
-// */
-// private static class WebConversation
-// {
-// /**
-// *
-// */
-// private HttpClient client = null;
-// private String sessionId = null;
-// private int statusCode = 0;
-// private String response = null;
-// private String redirectLocation = null;
-// private Cookie ssoCookie = null;
-//
-// /**
-// *
-// *
-// */
-// public WebConversation()
-// {
-//
-// }
-//
-// /**
-// *
-// * @return
-// */
-// public HttpClient getClient()
-// {
-// return this.client;
-// }
-//
-// /**
-// *
-// * @param client
-// */
-// public void setClient(HttpClient client)
-// {
-// this.client = client;
-// }
-//
-// public String getResponse()
-// {
-// return response;
-// }
-//
-// public void setResponse(String response)
-// {
-// this.response = response;
-// }
-//
-// public int getStatusCode()
-// {
-// return statusCode;
-// }
-//
-// public void setStatusCode(int statusCode)
-// {
-// this.statusCode = statusCode;
-// }
-//
-// public String getSessionId()
-// {
-// return sessionId;
-// }
-//
-// public void setSessionId(String sessionId)
-// {
-// this.sessionId = sessionId;
-// }
-//
-// public String getRedirectLocation()
-// {
-// return redirectLocation;
-// }
-//
-// public void setRedirectLocation(String redirectLocation)
-// {
-// this.redirectLocation = redirectLocation;
-// }
-//
-// public Cookie getSSOCookie()
-// {
-// return ssoCookie;
-// }
-//
-// public void setSSOCookie(Cookie ssoCookie)
-// {
-// this.ssoCookie = ssoCookie;
-// }
-// }
-//}
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http:www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.identity.sso;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+import java.util.HashMap;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.Cookie;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.protocol.Protocol;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class JOSSOTestCase extends TestCase
+{
+ /**
+ *
+ */
+ private String firstPortal = null;
+ private String secondPortal = null;
+ private String sameHostSecondPortal = null;
+ private String jossoServer = null;
+ private String userLoggedInIndicator = null;
+ private String username = null;
+ private String password = null;
+
+
+ /**
+ *
+ */
+ protected void setUp() throws Exception
+ {
+ //SSL setup
+ Protocol.registerProtocol("https",new Protocol("https", new EasySSLProtocolSocketFactory(), 443));
+
+ this.firstPortal = "http://josso-01/portal";
+ this.secondPortal = "http://josso-02/portal";
+ this.sameHostSecondPortal = "http://josso-01/portal2";
+ this.jossoServer = "josso-01";
+ this.userLoggedInIndicator = "Logged in as:";
+ this.username = "user";
+ this.password = "user";
+ }
+
+ /**
+ *
+ */
+ protected void tearDown() throws Exception
+ {
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getUserLoggedInIndicator()
+ {
+ return userLoggedInIndicator;
+ }
+
+ /**
+ *
+ * @param userLoggedInIndicator
+ */
+ public void setUserLoggedInIndicator(String userLoggedInIndicator)
+ {
+ this.userLoggedInIndicator = userLoggedInIndicator;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getPassword()
+ {
+ return password;
+ }
+
+ /**
+ *
+ * @param password
+ */
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getUsername()
+ {
+ return username;
+ }
+
+ /**
+ *
+ * @param username
+ */
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getFirstPortal()
+ {
+ return firstPortal;
+ }
+
+ /**
+ *
+ * @param firstPortal
+ */
+ public void setFirstPortal(String firstPortal)
+ {
+ this.firstPortal = firstPortal;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getSecondPortal()
+ {
+ return secondPortal;
+ }
+
+ /**
+ *
+ * @param secondPortal
+ */
+ public void setSecondPortal(String secondPortal)
+ {
+ this.secondPortal = secondPortal;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getJossoServer()
+ {
+ return jossoServer;
+ }
+
+ /**
+ *
+ * @param jossoServer
+ */
+ public void setJossoServer(String jossoServer)
+ {
+ this.jossoServer = jossoServer;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getSameHostSecondPortal()
+ {
+ return sameHostSecondPortal;
+ }
+
+ /**
+ *
+ * @param sameHostSecondPortal
+ */
+ public void setSameHostSecondPortal(String sameHostSecondPortal)
+ {
+ this.sameHostSecondPortal = sameHostSecondPortal;
+ }
+
+ /**
+ * This tests the scenario when the two portals are deployed on separate hosts/servers
+ *
+ * @throws Exception
+ */
+ public void testMultiHostDeployment() throws Exception
+ {
+ Cookie ssoCookie = null;
+ String firstPortalFinalResponse = null;
+ String secondPortalFinalResponse = null;
+
+ //Load the main portal page on firstPortalContext
+ String firstContextPortalUrl = this.firstPortal;
+ WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
+ TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
+
+ //Click the Login link on the firstPortalContext
+ String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
+ this.sendGet(firstContextLoginUrl, portalConversation);
+
+ //Navigate to a secured resource on the portal
+ TestCase.assertNotNull(portalConversation.getRedirectLocation());
+ TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+ String portalToJOSSO = portalConversation.getRedirectLocation();
+ this.sendGet(portalToJOSSO, portalConversation);
+
+ //When authentication is triggered, move over to the JOSSO server establishing an SSO session with JOSSO
+ String jossoLocation = portalConversation.getRedirectLocation();
+ WebConversation ssoConversation = this.startConversation(jossoLocation);
+ String response = ssoConversation.getResponse();
+
+ //Extract the josso post action value
+ int searchIndex = response.indexOf("action=\"")+9;
+ int endIndex = response.indexOf('"', searchIndex);
+ String action = response.substring(searchIndex,endIndex);
+
+ //Perform HTTP Post based authentication with the JOSSO Server
+ Map postParams = new HashMap();
+ postParams.put("josso_username", this.username);
+ postParams.put("josso_password", this.password);
+ postParams.put("josso_cmd", "login");
+ this.sendPost("http:"+ this.jossoServer +"/"+action,postParams, ssoConversation);
+
+ //Go back to the Portal since login has succeeded, starting with assertion on the JOSSO Agent installed on the Portal
+ String assertUrl = ssoConversation.getRedirectLocation();
+ this.sendGet(assertUrl, portalConversation);
+
+ //Now go back to the original Portal resource requested. This time user should have an authenticated session established
+ TestCase.assertNotNull(portalConversation.getRedirectLocation());
+ TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+ TestCase.assertTrue(portalConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
+ TestCase.assertNotNull(portalConversation.getSSOCookie());
+ String goBack = portalConversation.getRedirectLocation();
+ ssoCookie = ssoConversation.getSSOCookie();
+ this.sendGet(goBack, portalConversation);
+ firstPortalFinalResponse = portalConversation.getResponse();
+ TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
+
+ //Load the main portal page on secondPortalContext
+ String secondContextPortalUrl = this.secondPortal;
+ portalConversation = this.startConversation(secondContextPortalUrl);
+
+ //Click the Login Link on the secondPortalContext
+ String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
+ this.sendGet(secondContextLoginUrl, portalConversation);
+
+ //Perform re-direct to the JOSSO Server but this time sending in the JOSSO cookie
+ TestCase.assertNotNull(portalConversation.getRedirectLocation());
+ TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+ portalToJOSSO = portalConversation.getRedirectLocation();
+ this.sendGet(portalToJOSSO, portalConversation);
+
+
+ //Assert the redirect and it should be to the JOSSO Server, but this time
+ //It should end up with an Authenticated session back to the secondPortalContext
+ jossoLocation = portalConversation.getRedirectLocation();
+ ssoConversation = this.startConversation(jossoLocation,ssoCookie);
+ secondPortalFinalResponse = ssoConversation.getResponse();
+ TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
+
+ //Assert and make sure its the same user logged into both Portals
+ String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
+ String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
+ TestCase.assertEquals(firstPortalUser, this.username);
+ TestCase.assertEquals(secondPortalUser, this.username);
+ TestCase.assertEquals(firstPortalUser, secondPortalUser);
+ }
+
+ /**
+ * This tests the scenario where the two portals are deployed within the same host/server but under
+ * different web contexts
+ *
+ * @throws Exception
+ */
+ /*public void testSameHostDeployment() throws Exception
+ {
+ Cookie ssoCookie = null;
+ String firstPortalFinalResponse = null;
+ String secondPortalFinalResponse = null;
+
+ //Load the main portal page on firstPortalContext
+ String firstContextPortalUrl = this.firstPortal;
+ WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
+ TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
+
+ //Click the Login link on the firstPortalContext
+ String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
+ this.sendGet(firstContextLoginUrl, portalConversation);
+
+ //Navigate to a secured resource on the portal
+ TestCase.assertNotNull(portalConversation.getRedirectLocation());
+ TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+ String portalToJOSSO = portalConversation.getRedirectLocation();
+ this.sendGet(portalToJOSSO, portalConversation);
+
+ //When authentication is triggered, move over to the JOSSO server establishing an SSO session with JOSSO
+ String jossoLocation = portalConversation.getRedirectLocation();
+ WebConversation ssoConversation = this.startConversation(jossoLocation);
+ String response = ssoConversation.getResponse();
+
+ //Extract the josso post action value
+ int searchIndex = response.indexOf("action=\"")+9;
+ int endIndex = response.indexOf('"', searchIndex);
+ String action = response.substring(searchIndex,endIndex);
+
+ //Perform HTTP Post based authentication with the JOSSO Server
+ Map postParams = new HashMap();
+ postParams.put("josso_username", this.username);
+ postParams.put("josso_password", this.password);
+ postParams.put("josso_cmd", "login");
+ this.sendPost("http:"+ this.jossoServer +"/"+action,postParams, ssoConversation);
+
+ //Go back to the Portal since login has succeeded, starting with assertion on the JOSSO Agent installed on the Portal
+ String assertUrl = ssoConversation.getRedirectLocation();
+ this.sendGet(assertUrl, portalConversation);
+
+ //Now go back to the original Portal resource requested. This time user should have an authenticated session established
+ TestCase.assertNotNull(portalConversation.getRedirectLocation());
+ TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+ TestCase.assertTrue(portalConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
+ TestCase.assertNotNull(portalConversation.getSSOCookie());
+ String goBack = portalConversation.getRedirectLocation();
+ ssoCookie = ssoConversation.getSSOCookie();
+ this.sendGet(goBack, portalConversation);
+ firstPortalFinalResponse = portalConversation.getResponse();
+ TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
+
+ //Load the main portal page on secondPortalContext
+ String secondContextPortalUrl = this.sameHostSecondPortal;
+ portalConversation = this.startConversation(secondContextPortalUrl);
+
+ //Click the Login Link on the secondPortalContext
+ String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
+ this.sendGet(secondContextLoginUrl, portalConversation);
+
+ //Perform re-direct to the JOSSO Server but this time sending in the JOSSO cookie
+ TestCase.assertNotNull(portalConversation.getRedirectLocation());
+ TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+ portalToJOSSO = portalConversation.getRedirectLocation();
+ this.sendGet(portalToJOSSO, portalConversation);
+
+
+ //Assert the redirect and it should be to the JOSSO Server, but this time
+ //It should end up with an Authenticated session back to the secondPortalContext
+ jossoLocation = portalConversation.getRedirectLocation();
+ ssoConversation = this.startConversation(jossoLocation,ssoCookie);
+ secondPortalFinalResponse = ssoConversation.getResponse();
+ TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
+
+ //Assert and make sure its the same user logged into both Portals
+ String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
+ String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
+ TestCase.assertEquals(firstPortalUser, this.username);
+ TestCase.assertEquals(secondPortalUser, this.username);
+ TestCase.assertEquals(firstPortalUser, secondPortalUser);
+ }*/
+
+ /**
+ *
+ * @param portalUrl
+ * @return
+ * @throws Exception
+ */
+ private WebConversation startConversation(String portalUrl) throws Exception
+ {
+ WebConversation conversation = null;
+
+ HttpClient httpClient = new HttpClient();
+ GetMethod getMethod = new GetMethod(portalUrl);
+ try
+ {
+ conversation = new WebConversation();
+
+ int statusCode = httpClient.executeMethod(getMethod);
+ String response = getMethod.getResponseBodyAsString();
+
+ Cookie[] cookies = httpClient.getState().getCookies();
+ for(int i=0;i<cookies.length;i++)
+ {
+ if(cookies[i].getName().equals("JSESSIONID"))
+ {
+ conversation.setSessionId(cookies[i].getValue());
+ }
+ }
+
+ conversation.setClient(httpClient);
+ conversation.setStatusCode(statusCode);
+ conversation.setResponse(response);
+ }
+ finally
+ {
+ if(getMethod != null)
+ {
+ getMethod.releaseConnection();
+ }
+ }
+
+ return conversation;
+ }
+
+ /**
+ *
+ * @param portalUrl
+ * @return
+ * @throws Exception
+ */
+ private WebConversation startConversation(String portalUrl, Cookie ssoCookie) throws Exception
+ {
+ WebConversation conversation = null;
+
+ HttpClient httpClient = new HttpClient();
+ GetMethod getMethod = new GetMethod(portalUrl);
+
+ //Set ssoCookie to be sent in
+ getMethod.setRequestHeader("Cookie",ssoCookie.getName()+"="+ssoCookie.getValue());
+
+ try
+ {
+ conversation = new WebConversation();
+
+ int statusCode = httpClient.executeMethod(getMethod);
+ String response = getMethod.getResponseBodyAsString();
+
+ Cookie[] cookies = httpClient.getState().getCookies();
+ for(int i=0;i<cookies.length;i++)
+ {
+ if(cookies[i].getName().equals("JSESSIONID"))
+ {
+ conversation.setSessionId(cookies[i].getValue());
+ }
+ }
+
+ conversation.setClient(httpClient);
+ conversation.setStatusCode(statusCode);
+ conversation.setResponse(response);
+ }
+ finally
+ {
+ if(getMethod != null)
+ {
+ getMethod.releaseConnection();
+ }
+ }
+
+ return conversation;
+ }
+
+ /**
+ *
+ * @param portalUrl
+ * @param conversation
+ * @throws Exception
+ */
+ private void sendGet(String portalUrl,WebConversation conversation) throws Exception
+ {
+ HttpClient httpClient = conversation.getClient();
+
+ GetMethod getMethod = new GetMethod(portalUrl);
+ getMethod.setFollowRedirects(false);
+ try
+ {
+ int statusCode = httpClient.executeMethod(getMethod);
+
+ String response = getMethod.getResponseBodyAsString();
+
+ Cookie[] cookies = httpClient.getState().getCookies();
+ for(int i=0;i<cookies.length;i++)
+ {
+ if(cookies[i].getName().equals("JSESSIONID"))
+ {
+ conversation.setSessionId(cookies[i].getValue());
+ }
+ if(cookies[i].getName().equals("JOSSO_SESSIONID"))
+ {
+ conversation.setSSOCookie(cookies[i]);
+ }
+ }
+
+ conversation.setStatusCode(statusCode);
+ conversation.setResponse(response);
+
+ if(statusCode == 302)
+ {
+ //Store the redirect location
+ String location = getMethod.getResponseHeader("Location").getValue();
+ conversation.setRedirectLocation(location);
+ }
+ }
+ finally
+ {
+ if(getMethod != null)
+ {
+ getMethod.releaseConnection();
+ }
+ }
+ }
+
+
+ /**
+ *
+ * @param url
+ * @param parameters
+ * @param conversation
+ * @throws Exception
+ */
+ private void sendPost(String url,Map parameters,WebConversation conversation) throws Exception
+ {
+ HttpClient httpClient = conversation.getClient();
+
+ PostMethod postMethod = new PostMethod(url);
+
+ //Add post parameters
+ Set keySet = parameters.keySet();
+ NameValuePair[] postdata = new NameValuePair[keySet.size()];
+ int index = 0;
+ for(Iterator itr=keySet.iterator();itr.hasNext();)
+ {
+ String name = (String)itr.next();
+ String value = (String)parameters.get(name);
+ postdata[index++] = new NameValuePair(name,value);
+ }
+ postMethod.setRequestBody(postdata);
+ try
+ {
+ int statusCode = httpClient.executeMethod(postMethod);
+
+ String response = postMethod.getResponseBodyAsString();
+
+ Cookie[] cookies = httpClient.getState().getCookies();
+ for(int i=0;i<cookies.length;i++)
+ {
+ if(cookies[i].getName().equals("JSESSIONID"))
+ {
+ conversation.setSessionId(cookies[i].getValue());
+ }
+ if(cookies[i].getName().equals("JOSSO_SESSIONID"))
+ {
+ conversation.setSSOCookie(cookies[i]);
+ }
+ }
+
+ conversation.setStatusCode(statusCode);
+ conversation.setResponse(response);
+
+ if(statusCode == 302)
+ {
+ //Store the redirect location
+ String location = postMethod.getResponseHeader("Location").getValue();
+ conversation.setRedirectLocation(location);
+ }
+ }
+ finally
+ {
+ if(postMethod != null)
+ {
+ postMethod.releaseConnection();
+ }
+ }
+ }
+
+ /**
+ *
+ * @param response
+ * @return
+ */
+ private boolean isUserLoggedIn(String response)
+ {
+ boolean isUserLoggedIn = false;
+
+ isUserLoggedIn = (response.indexOf(this.userLoggedInIndicator) != -1);
+
+ return isUserLoggedIn;
+ }
+
+ /**
+ *
+ * @param response
+ * @return
+ */
+ private String extractLoggedInUser(String response)
+ {
+ String loggedInUser = null;
+
+ int startIndex = response.indexOf(this.userLoggedInIndicator) + this.userLoggedInIndicator.length();
+ int endIndex = response.indexOf("<",startIndex);
+
+ loggedInUser = response.substring(startIndex,endIndex).trim();
+
+ return loggedInUser;
+ }
+
+ /**
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+ private static class WebConversation
+ {
+ /**
+ *
+ */
+ private HttpClient client = null;
+ private String sessionId = null;
+ private int statusCode = 0;
+ private String response = null;
+ private String redirectLocation = null;
+ private Cookie ssoCookie = null;
+
+ /**
+ *
+ *
+ */
+ public WebConversation()
+ {
+
+ }
+
+ /**
+ *
+ * @return
+ */
+ public HttpClient getClient()
+ {
+ return this.client;
+ }
+
+ /**
+ *
+ * @param client
+ */
+ public void setClient(HttpClient client)
+ {
+ this.client = client;
+ }
+
+ public String getResponse()
+ {
+ return response;
+ }
+
+ public void setResponse(String response)
+ {
+ this.response = response;
+ }
+
+ public int getStatusCode()
+ {
+ return statusCode;
+ }
+
+ public void setStatusCode(int statusCode)
+ {
+ this.statusCode = statusCode;
+ }
+
+ public String getSessionId()
+ {
+ return sessionId;
+ }
+
+ public void setSessionId(String sessionId)
+ {
+ this.sessionId = sessionId;
+ }
+
+ public String getRedirectLocation()
+ {
+ return redirectLocation;
+ }
+
+ public void setRedirectLocation(String redirectLocation)
+ {
+ this.redirectLocation = redirectLocation;
+ }
+
+ public Cookie getSSOCookie()
+ {
+ return ssoCookie;
+ }
+
+ public void setSSOCookie(Cookie ssoCookie)
+ {
+ this.ssoCookie = ssoCookie;
+ }
+ }
+}
Added: modules/identity/trunk/sso/src/test/resources/log4j.properties
===================================================================
--- modules/identity/trunk/sso/src/test/resources/log4j.properties (rev 0)
+++ modules/identity/trunk/sso/src/test/resources/log4j.properties 2009-04-17 03:25:33 UTC (rev 13225)
@@ -0,0 +1,8 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=INFO, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
15 years, 2 months
JBoss Portal SVN: r13224 - branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-04-16 05:05:50 -0400 (Thu, 16 Apr 2009)
New Revision: 13224
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
Log:
[selenium] - archive upload longer timeout
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-04-15 10:29:25 UTC (rev 13223)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-04-16 09:05:50 UTC (rev 13224)
@@ -15,6 +15,8 @@
private static final Integer ARCHIVE_WAITING = 7000;
private static final int n = 70;
+ private static final String STEP = "20000";
+
/*
* uncomment following lines and set the right path to the workspace in the
* case you want to use this test case locally from eclipse
@@ -41,7 +43,7 @@
logoutIfPossible();
login("admin", "admin");
// timeout hack
- selenium.setSpeed("10000");
+ selenium.setSpeed(STEP);
}
@AfterMethod(groups = { "log" })
15 years, 2 months
JBoss Portal SVN: r13223 - in branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium: portal and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-04-15 06:29:25 -0400 (Wed, 15 Apr 2009)
New Revision: 13223
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
Log:
longer timeouts
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-04-15 03:47:21 UTC (rev 13222)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-04-15 10:29:25 UTC (rev 13223)
@@ -13,8 +13,8 @@
@Test(groups = { "cms_archive_upload" }, enabled = true)
public class CMSArchiveUploadTestCase extends JBossPortalSeleniumTestCase {
- private static final Integer ARCHIVE_WAITING = 5000;
- private static final int n = 50;
+ private static final Integer ARCHIVE_WAITING = 7000;
+ private static final int n = 70;
/*
* uncomment following lines and set the right path to the workspace in the
* case you want to use this test case locally from eclipse
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-04-15 03:47:21 UTC (rev 13222)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-04-15 10:29:25 UTC (rev 13223)
@@ -57,6 +57,7 @@
private final String INP_NET_SEARCH = getProp(casePfx + "inp.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
private final String SUB_NET_SEARCH = getProp(casePfx + "sub.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
+ private long AJAX_WAIT=10000;
/*
* - create a new portal - add couple of page to the portal - add few
* portlets of different kinds (csm, widget, regular portlets) in each page
@@ -217,7 +218,7 @@
selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
try {
- Thread.sleep(5000);
+ Thread.sleep(AJAX_WAIT);
} catch (InterruptedException e) {
e.printStackTrace();
}
@@ -225,14 +226,14 @@
// hack
selenium.select(SEL_PORTLET_TYPE, "label=" + "cms");
try {
- Thread.sleep(5000);
+ Thread.sleep(AJAX_WAIT);
} catch (InterruptedException e) {
e.printStackTrace();
}
selenium.select(SEL_PORTLET_TYPE, "label=" + type);
try {
- Thread.sleep(5000);
+ Thread.sleep(AJAX_WAIT);
} catch (InterruptedException e) {
e.printStackTrace();
}
15 years, 2 months
JBoss Portal SVN: r13222 - branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2009-04-14 23:47:21 -0400 (Tue, 14 Apr 2009)
New Revision: 13222
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
Log:
oops..extra space in string
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-04-15 02:05:12 UTC (rev 13221)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-04-15 03:47:21 UTC (rev 13222)
@@ -182,7 +182,7 @@
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access Denied "), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -201,10 +201,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access Denied "), "Secured resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#1");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access Denied "), "Secured resource is visible.#2");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#2");
logout();
}
15 years, 2 months
JBoss Portal SVN: r13221 - branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2009-04-14 22:05:12 -0400 (Tue, 14 Apr 2009)
New Revision: 13221
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
Log:
fix the assert text for secure test
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-04-14 20:58:47 UTC (rev 13220)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-04-15 02:05:12 UTC (rev 13221)
@@ -118,7 +118,7 @@
public void testSetAdminReadPer() {
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),
"Non secured resource is not visible.#2");
@@ -142,10 +142,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"), "Secured resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#1");
login("user", "user");
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"), "Secured resource is visible.#2");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#2");
logout();
}
@@ -157,7 +157,7 @@
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),
"Non secured resource is not visible.#2");
@@ -182,7 +182,7 @@
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied "), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied "), "Non secured resource is not visible.#1");
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -201,10 +201,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied "), "Secured resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied "), "Secured resource is visible.#1");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied "), "Secured resource is visible.#2");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied "), "Secured resource is visible.#2");
logout();
}
@@ -215,7 +215,7 @@
assignRole("user", "user(a)portal.com", "secRole", "secRoleDisp");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),
"Non secured resource is not visible.#2");
@@ -236,10 +236,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"), "Secured resource is visible after logout.");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible after logout.");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"), "Non secured resource is not visible for the \"user\".");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible for the \"user\".");
logout();
}
@@ -250,7 +250,7 @@
deassignRole("user", "user(a)portal.com", "secRole", "secRoleDisp");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"));
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"));
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
selenium.click(LNK_ADMIN);
@@ -270,11 +270,11 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"));
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"));
login("user", "user");
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"));
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"));
logout();
}
15 years, 2 months
JBoss Portal SVN: r13220 - docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/html-single/Read_Me.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2009-04-14 16:58:47 -0400 (Tue, 14 Apr 2009)
New Revision: 13220
Modified:
docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/html-single/Read_Me/index.html
Log:
update for epp cp01
Modified: docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/html-single/Read_Me/index.html
===================================================================
--- docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/html-single/Read_Me/index.html 2009-04-14 20:53:25 UTC (rev 13219)
+++ docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/html-single/Read_Me/index.html 2009-04-14 20:58:47 UTC (rev 13220)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Release Notes GA</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content=""/><meta name="description" content="These release notes contain important information related to JBoss Enterprise Portal Platform 4.3 that may not be currently available in the Product Manuals. You should read these Release Notes in their entirety before installing JBoss Enterprise Portal Platform 4.3."/></head><body><div class="article" lang="en-US"><div class="titlepage"><div><div class="producttitle"><span class="productname">JBoss Enterprise Portal Platform</span> <span class="productnumber">4.3</span></div><div><h1 id="JBEAP-Release-Notes" class="title">Release Notes GA</h1></div><div><h2 class="subtitle">for Use with JBoss Enterprise Portal Platform 4.3</h2></div><div><h3 class="corpauthor">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Release Notes GA</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content=""/><meta name="description" content="These release notes contain important information related to JBoss Enterprise Portal Platform 4.3 CP01 that may not be currently available in the Product Manuals. You should read these Release Notes in their entirety before installing JBoss Enterprise Portal Platform 4.3 CP01."/></head><body><div class="article" lang="en-US"><div class="titlepage"><div><div class="producttitle"><span class="productname">JBoss Enterprise Portal Platform</span> <span class="productnumber">4.3 CP01</span></div><div><h1 id="JBEAP-Release-Notes" class="title">Release Notes GA</h1></div><div><h2 class="subtitle">for Use with JBoss Enterprise Portal Platform 4.3</h2></div><div><h3 class="corpauthor">
<span class="inlinemediaobject"><object data="Common_Content/images/redhat-logo.svg" type="image/svg+xml"/></span>
</h3></div><div><div class="authorgroup"><h3 class="corpauthor">
Red Hat
@@ -24,10 +24,10 @@
<span class="pob">PO Box 13588</span><span class="city">Research Triangle Park</span>, <span class="state">NC</span> <span class="postcode">27709</span><span class="country">USA</span><br/>
</p></div>
</p></div></div><div><div class="abstract"><h6>Abstract</h6><p>These release notes contain important information related to JBoss
-Enterprise Portal Platform 4.3 that may not be currently available
-in the Product Manuals. You should read these Release Notes in
-their entirety before installing JBoss Enterprise Portal Platform
-4.3.</p></div></div></div><hr/></div><div class="toc"><dl><dt><span class="section"><a href="#Introduction">1. Introduction </a></span></dt><dd><dl><dt><span class="section"><a href="#Overview">1.1. Overview</a></span></dt></dl></dd><dt><span class="section"><a href="#New_Features">2. New Features in JBoss Enterprise Portal Platform 4.3</a></span></dt><dd><dl><dt><span class="section"><a href="#JSR-286">2.1. Portlet 2.0 -JSR 286</a></span></dt></dl></dd><dt><span class="section"><a href="#Component_Versions">3. Component Versions</a></span></dt><dt><span class="section"><a href="#Product-Support-and-License-Links">4. Product Support and License Website Links </a></span></dt><dt><span class="appendix"><a href="#appe-Publican-Revision_History">A. Revision History</a></span></dt></dl></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title" id="Introduction">1. Introduction </h2></div></div></div><p>
+Enterprise Portal Platform 4.3 CP01 that may not be currently
+available in the Product Manuals. You should read these Release
+Notes in their entirety before installing JBoss Enterprise Portal
+Platform 4.3 CP01.</p></div></div></div><hr/></div><div class="toc"><dl><dt><span class="section"><a href="#Introduction">1. Introduction </a></span></dt><dd><dl><dt><span class="section"><a href="#Overview">1.1. Overview</a></span></dt></dl></dd><dt><span class="section"><a href="#New_Features">2. New Features in JBoss Enterprise Portal Platform 4.3</a></span></dt><dd><dl><dt><span class="section"><a href="#JSR-286">2.1. Portlet 2.0 -JSR 286</a></span></dt></dl></dd><dt><span class="section"><a href="#Component_Versions">3. Component Versions</a></span></dt><dt><span class="section"><a href="#Product-Support-and-License-Links">4. Product Support and License Website Links </a></span></dt><dt><span class="appendix"><a href="#appe-Publican-Revision_History">A. Revision History</a></span></dt></dl></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title" id="Introduction">1. Introduction </h2></div></div></div><p>
These release notes contain important information related to JBoss Enterprise Portal Platform 4.3. New features, known problems, resources, and other current issues are addressed here.
</p><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title" id="Overview">1.1. Overview</h3></div></div></div><p>
JBoss Enterprise Portal Platform facilitates the delivery of web-based composite applications and high-performance web presences. Through its agile, reusable framework, customers can minimize the cost and complexity of their web infrastructures. Its use of open standards mitigates the risk of vendor lock-in, ensuring compatibility. As an integral component of JBoss Enterprise Middleware, the large and vibrant JBoss.org developer community fosters its continued innovation and enterprise quality. And it's deployed on JBoss Enterprise Application Platform—the industry’s #1 J2EE-certified application platform ensuring performance, scalability, and a reliable and straightforward path to implementation.
@@ -42,19 +42,19 @@
</p></div></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title" id="New_Features">2. New Features in JBoss Enterprise Portal Platform 4.3</h2></div></div></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title" id="JSR-286">2.1. Portlet 2.0 -JSR 286</h3></div></div></div><p>
The main improvement of the Enterprise Portal Platform is the support of Portlet 2.0 specification which enables Inter Portlet Communication by sharing parameters and event support.
</p></div></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title" id="Component_Versions">3. Component Versions</h2></div></div></div><p>
- This section details the versions of the components which create the Enterprise Portal Platform 4.3 that can be found in release on top of the components delivered by the Enterprise Application Platform 4.3.CP03.
+ This section details the versions of the components which create the Enterprise Portal Platform 4.3 that can be found in release on top of the components delivered by the Enterprise Application Platform 4.3.CP04.
</p><div class="itemizedlist"><ul><li><p>
- Identity Module 1.0.7
+ Identity Module 1.0.8
</p></li><li><p>
- Common Module 1.2.3
+ Common Module 1.2.4
</p></li><li><p>
- Portlet Module 2.0.5
+ Portlet Module 2.0.7
</p></li><li><p>
Web Module 1.2.3
</p></li><li><p>
- CMS Module 1.2.4
+ CMS Module 1.2.5
</p></li><li><p>
- JBoss Portlet Bridge 1.0.B6
+ JBoss Portlet Bridge 1.0.0.CR1
</p></li></ul></div><div class="note"><h2>Note</h2><p>
The Enterprise Portal Platform Server has been redefined for the enterprise market to a level where direct association to a community release can no longer be drawn.
</p></div></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title" id="Product-Support-and-License-Links">4. Product Support and License Website Links </h2></div></div></div><h5 class="formalpara" id="d0e159">Support Processes</h5>
15 years, 2 months
JBoss Portal SVN: r13219 - docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2009-04-14 16:53:25 -0400 (Tue, 14 Apr 2009)
New Revision: 13219
Modified:
docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf/Installation_Guide.pdf
docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf/Reference_Guide.pdf
docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf/Release_Notes_GA.pdf
docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf/Tuning_Guide.pdf
docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf/User_Guide.pdf
Log:
cp01 pdfs
Modified: docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf/Installation_Guide.pdf
===================================================================
(Binary files differ)
Modified: docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf/Reference_Guide.pdf
===================================================================
(Binary files differ)
Modified: docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf/Release_Notes_GA.pdf
===================================================================
(Binary files differ)
Modified: docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf/Tuning_Guide.pdf
===================================================================
(Binary files differ)
Modified: docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/pdf/User_Guide.pdf
===================================================================
(Binary files differ)
15 years, 2 months
JBoss Portal SVN: r13218 - docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/Tuning_Guide/en-US.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2009-04-14 16:46:25 -0400 (Tue, 14 Apr 2009)
New Revision: 13218
Modified:
docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/Tuning_Guide/en-US/Book_Info.xml
Log:
update for epp 4.3 cp01
Modified: docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/Tuning_Guide/en-US/Book_Info.xml
===================================================================
--- docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/Tuning_Guide/en-US/Book_Info.xml 2009-04-14 20:02:10 UTC (rev 13217)
+++ docs/enterprise/tags/Enterprise_Portal_Platform_4_3_GA_CP01/Tuning_Guide/en-US/Book_Info.xml 2009-04-14 20:46:25 UTC (rev 13218)
@@ -7,8 +7,8 @@
<edition>1.0</edition>
<pubsnumber>4</pubsnumber>
<productname>JBoss Enterprise Portal Platform</productname>
- <productnumber>4.3</productnumber>
- <pubdate>Jan, 2009</pubdate>
+ <productnumber>4.3 CP01</productnumber>
+ <pubdate>Apr, 2009</pubdate>
<isbn>N/A</isbn>
<abstract><para>This Installation Guide documents tuning of JBoss Enterprise Portal Platform</para>
</abstract>
15 years, 2 months