Modified: cxf/fediz/trunk/systests/jetty8/pom.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/jetty8/pom.xml?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/jetty8/pom.xml (original) +++ cxf/fediz/trunk/systests/jetty8/pom.xml Thu Mar 28 19:53:35 2013 @@ -17,7 +17,8 @@ specific language governing permissions and limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.cxf.fediz</groupId> @@ -69,16 +70,22 @@ <scope>test</scope> </dependency> <dependency> + <groupId>org.apache.cxf.fediz</groupId> + <artifactId>fediz-jetty</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.apache.cxf.fediz.systests</groupId> <artifactId>systests-tests</artifactId> <version>${project.version}</version> - <type>test-jar</type> + <type>test-jar</type> <scope>test</scope> - </dependency> + </dependency> <dependency> - <groupId>org.apache.cxf.fediz</groupId> - <artifactId>fediz-jetty</artifactId> - <version>${project.version}</version> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + <version>${slf4j.version}</version> <scope>test</scope> </dependency> </dependencies> @@ -123,7 +130,7 @@ </configuration> </execution> </executions> - </plugin> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> @@ -143,6 +150,7 @@ <version>${project.version}</version> <type>war</type> <overWrite>true</overWrite> + <outputDirectory>target/idp/</outputDirectory> </artifactItem> <artifactItem> <groupId>org.apache.cxf.fediz</groupId> @@ -150,6 +158,7 @@ <version>${project.version}</version> <type>war</type> <overWrite>true</overWrite> + <outputDirectory>target/idp/</outputDirectory> </artifactItem> <artifactItem> <groupId>org.apache.cxf.fediz.systests</groupId> @@ -157,6 +166,7 @@ <version>${project.version}</version> <type>war</type> <overWrite>true</overWrite> + <outputDirectory>target/rp/</outputDirectory> </artifactItem> <artifactItem> <groupId>org.apache.cxf.fediz.systests</groupId> @@ -164,10 +174,10 @@ <version>${project.version}</version> <type>war</type> <overWrite>true</overWrite> + <outputDirectory>target/rp/</outputDirectory> </artifactItem> </artifactItems> <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename> - <outputDirectory>target</outputDirectory> <overWriteSnapshots>true</overWriteSnapshots> <overWriteIfNewer>true</overWriteIfNewer> <stripVersion>true</stripVersion>
Modified: cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyPreAuthSpringTest.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyPreAuthSpringTest.java?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyPreAuthSpringTest.java (original) +++ cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyPreAuthSpringTest.java Thu Mar 28 19:53:35 2013 @@ -34,12 +34,11 @@ public class JettyPreAuthSpringTest exte @BeforeClass public static void init() { System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); - System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true"); - System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug"); - System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug"); + System.setProperty("org.apache.commons.logging.simplelog.log.org.springframework.webflow", "debug"); + System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.cxf.fediz", "debug"); idpHttpsPort = System.getProperty("idp.https.port"); Assert.assertNotNull("Property 'idp.https.port' null", idpHttpsPort); Modified: cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyTest.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyTest.java?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyTest.java (original) +++ cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyTest.java Thu Mar 28 19:53:35 2013 @@ -19,7 +19,6 @@ package org.apache.cxf.fediz.integrationtests; - import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; @@ -33,12 +32,11 @@ public class JettyTest extends AbstractT @BeforeClass public static void init() { System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); - System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true"); - System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug"); - System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug"); + System.setProperty("org.apache.commons.logging.simplelog.log.org.springframework.webflow", "debug"); + System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.cxf.fediz", "debug"); idpHttpsPort = System.getProperty("idp.https.port"); Assert.assertNotNull("Property 'idp.https.port' null", idpHttpsPort); @@ -71,6 +69,4 @@ public class JettyTest extends AbstractT public String getServletContextName() { return "fedizhelloworld"; } - - } Modified: cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyUtils.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyUtils.java?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyUtils.java (original) +++ cxf/fediz/trunk/systests/jetty8/src/test/java/org/apache/cxf/fediz/integrationtests/JettyUtils.java Thu Mar 28 19:53:35 2013 @@ -48,6 +48,7 @@ public final class JettyUtils { if (idpServer != null && !idpServer.isStarted()) { try { idpServer.start(); + } catch (Exception e) { e.printStackTrace(); } @@ -57,7 +58,8 @@ public final class JettyUtils { public static void stopIdpServer() { if (idpServer != null && idpServer.isStarted()) { try { - idpServer.stop(); + idpServer.setGracefulShutdown(2000); + idpServer.setStopAtShutdown(true); } catch (Exception e) { e.printStackTrace(); } @@ -90,7 +92,8 @@ public final class JettyUtils { public static void stopRpServer() { if (rpServer != null && rpServer.isStarted()) { try { - rpServer.stop(); + rpServer.setGracefulShutdown(2000); + rpServer.setStopAtShutdown(true); } catch (Exception e) { e.printStackTrace(); } Modified: cxf/fediz/trunk/systests/jetty8/src/test/resources/fediz_config.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/jetty8/src/test/resources/fediz_config.xml?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/jetty8/src/test/resources/fediz_config.xml (original) +++ cxf/fediz/trunk/systests/jetty8/src/test/resources/fediz_config.xml Thu Mar 28 19:53:35 2013 @@ -21,7 +21,7 @@ <protocol xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="federationProtocolType" version="1.0.0"> <realm>urn:org:apache:cxf:fediz:fedizhelloworld</realm> - <issuer>https://localhost:${idp.https.port}/fediz-idp/</issuer> + <issuer>https://localhost:${idp.https.port}/fediz-idp/federation</issuer> <roleDelimiter>,</roleDelimiter> <roleURI>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role</roleURI> <freshness>10</freshness> @@ -47,7 +47,7 @@ <protocol xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="federationProtocolType" version="1.0.0"> <realm>urn:org:apache:cxf:fediz:fedizhelloworld</realm> - <issuer>https://localhost:${idp.https.port}/fediz-idp/</issuer> + <issuer>https://localhost:${idp.https.port}/fediz-idp/federation</issuer> <roleDelimiter>,</roleDelimiter> <roleURI>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role</roleURI> <claimTypesRequested> Modified: cxf/fediz/trunk/systests/jetty8/src/test/resources/idp-server.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/jetty8/src/test/resources/idp-server.xml?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/jetty8/src/test/resources/idp-server.xml (original) +++ cxf/fediz/trunk/systests/jetty8/src/test/resources/idp-server.xml Thu Mar 28 19:53:35 2013 @@ -3,6 +3,13 @@ <Configure id="IdpServer" class="org.eclipse.jetty.server.Server"> + + <Call class="java.lang.System" name="setProperty"> + <Arg>org.apache.jasper.compiler.disablejsr199</Arg> + <Arg>true</Arg> + </Call> + + <Call class="org.eclipse.jetty.util.log.Log" name="getRootLogger"> <Call name="setDebugEnabled"> <Arg type="boolean">true</Arg> @@ -32,14 +39,14 @@ <Item> <New class="org.eclipse.jetty.webapp.WebAppContext"> <Set name="contextPath">/fediz-idp</Set> - <Set name="war">./target/fediz-idp.war</Set> + <Set name="war">./target/idp/fediz-idp.war</Set> <Set name="throwUnavailableOnStartupException">true</Set> </New> </Item> <Item> <New class="org.eclipse.jetty.webapp.WebAppContext"> <Set name="contextPath">/fediz-idp-sts</Set> - <Set name="war">./target/fediz-idp-sts.war</Set> + <Set name="war">./target/idp/fediz-idp-sts.war</Set> <Set name="throwUnavailableOnStartupException">true</Set> </New> </Item> Modified: cxf/fediz/trunk/systests/jetty8/src/test/resources/rp-server.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/jetty8/src/test/resources/rp-server.xml?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/jetty8/src/test/resources/rp-server.xml (original) +++ cxf/fediz/trunk/systests/jetty8/src/test/resources/rp-server.xml Thu Mar 28 19:53:35 2013 @@ -3,73 +3,76 @@ <Configure id="RPServer" class="org.eclipse.jetty.server.Server"> - <Call class="org.eclipse.jetty.util.log.Log" name="getRootLogger"> - <Call name="setDebugEnabled"> - <Arg type="boolean">true</Arg> - </Call> - </Call> + <Call class="org.eclipse.jetty.util.log.Log" name="getRootLogger"> + <Call name="setDebugEnabled"> + <Arg type="boolean">true</Arg> + </Call> + </Call> <Call name="addConnector"> - <Arg> - <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector"> - <Arg> - <New class="org.eclipse.jetty.http.ssl.SslContextFactory"> - <Set name="keyStore">./target/test-classes/server.jks</Set> - <Set name="keyStorePassword">tompass</Set> - <Set name="keyManagerPassword">tompass</Set> - </New> - </Arg> - <Set name="port">${rp.https.port}</Set> - <Set name="maxIdleTime">30000</Set> - </New> - </Arg> - </Call> - + <Arg> + <New + class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector"> + <Arg> + <New class="org.eclipse.jetty.http.ssl.SslContextFactory"> + <Set name="keyStore">./target/test-classes/server.jks + </Set> + <Set name="keyStorePassword">tompass</Set> + <Set name="keyManagerPassword">tompass</Set> + </New> + </Arg> + <Set name="port">${rp.https.port}</Set> + <Set name="maxIdleTime">30000</Set> + </New> + </Arg> + </Call> + <Set name="handler"> <New class="org.eclipse.jetty.server.handler.HandlerList"> <Set name="handlers"> - <Array type="org.eclipse.jetty.server.Handler"> - <Item> - <New class="org.eclipse.jetty.webapp.WebAppContext"> - <Set name="contextPath">/fedizhelloworld</Set> - <Set name="war">./target/systests-simpleWebapp.war</Set> - <Set name="throwUnavailableOnStartupException">true</Set> + <Array type="org.eclipse.jetty.server.Handler"> + <Item> + <New class="org.eclipse.jetty.webapp.WebAppContext"> + <Set name="contextPath">/fedizhelloworld</Set> + <Set name="war">./target/rp/systests-simpleWebapp.war</Set> + <!--Set name="war">./target/jetty/rp/webapps/simpleWebapp</Set>--> + <Set name="throwUnavailableOnStartupException">true</Set> - <Get name="securityHandler"> - <Set name="authenticator"> - <New class="org.apache.cxf.fediz.jetty.FederationAuthenticator"> - <Set name="configFile">./target/test-classes/fediz_config.xml</Set> - </New> - </Set> - </Get> - </New> - </Item> - <Item> - <New class="org.eclipse.jetty.webapp.WebAppContext"> - <Set name="contextPath">/fedizspringhelloworld</Set> - <Set name="war">./target/systests-springPreauthWebapp.war</Set> - <Set name="throwUnavailableOnStartupException">true</Set> + <Get name="securityHandler"> + <Set name="authenticator"> + <New class="org.apache.cxf.fediz.jetty.FederationAuthenticator"> + <Set name="configFile">./target/test-classes/fediz_config.xml</Set> + </New> + </Set> + </Get> + </New> + </Item> + <Item> + <New class="org.eclipse.jetty.webapp.WebAppContext"> + <Set name="contextPath">/fedizspringhelloworld</Set> + <Set name="war">./target/rp/systests-springPreauthWebapp.war</Set> + <Set name="throwUnavailableOnStartupException">true</Set> - <Get name="securityHandler"> - <Set name="authenticator"> - <New class="org.apache.cxf.fediz.jetty.FederationAuthenticator"> - <Set name="configFile">./target/test-classes/fediz_config.xml</Set> - </New> - </Set> - </Get> - </New> - </Item> - </Array> + <Get name="securityHandler"> + <Set name="authenticator"> + <New class="org.apache.cxf.fediz.jetty.FederationAuthenticator"> + <Set name="configFile">./target/test-classes/fediz_config.xml</Set> + </New> + </Set> + </Get> + </New> + </Item> + </Array> </Set> </New> </Set> - + <Call name="addBean"> - <Arg> - <New class="org.apache.cxf.fediz.jetty.FederationLoginService"> - <Set name="name">WSFED</Set> - </New> - </Arg> - </Call> - + <Arg> + <New class="org.apache.cxf.fediz.jetty.FederationLoginService"> + <Set name="name">WSFED</Set> + </New> + </Arg> + </Call> + </Configure> Added: cxf/fediz/trunk/systests/jetty8/src/test/webapps/fediz-idp/WEB-INF/idp-servlet.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/jetty8/src/test/webapps/fediz-idp/WEB-INF/idp-servlet.xml?rev=1462277&view=auto ============================================================================== --- cxf/fediz/trunk/systests/jetty8/src/test/webapps/fediz-idp/WEB-INF/idp-servlet.xml (added) +++ cxf/fediz/trunk/systests/jetty8/src/test/webapps/fediz-idp/WEB-INF/idp-servlet.xml Thu Mar 28 19:53:35 2013 @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:webflow="http://www.springframework.org/schema/webflow-config" + xmlns:p="http://www.springframework.org/schema/p" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd"> + + <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping" + p:flowRegistry-ref="flowRegistry" + p:order="2"> +<!-- <property name="interceptors"> --> +<!-- <ref local="localeChangeInterceptor" /> --> +<!-- </property> --> + </bean> + + <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter" + p:flowExecutor-ref="flowExecutor" /> + + <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry"> + <webflow:flow-execution-attributes> + <webflow:always-redirect-on-pause value="false" /> + </webflow:flow-execution-attributes> + </webflow:flow-executor> + + <webflow:flow-registry id="flowRegistry" flow-builder-services="builder"> + <webflow:flow-location path="/WEB-INF/federation-webflow.xml" id="federation" /> + </webflow:flow-registry> + + <webflow:flow-builder-services id="builder" view-factory-creator="viewFactoryCreator" + expression-parser="expressionParser"/> + + <bean id="expressionParser" class="org.springframework.webflow.expression.WebFlowOgnlExpressionParser" /> + + <bean id="viewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator"> + <property name="viewResolvers"> + <list> + <ref local="viewResolver" /> + </list> + </property> + </bean> + + <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> + <property name="prefix" value="/WEB-INF/"/> + <property name="suffix" value=".jsp"/> + </bean> + + <bean id="stsClientForIdpAction" class="org.apache.cxf.fediz.service.idp.beans.STSClientAction"> + <property name="wsdlLocation" value="https://localhost:${idp.https.port}/fediz-idp-sts/STSService?wsdl"/> + <property name="wsdlEndpoint" value="TransportUT_Port"/> + <property name="appliesTo" value="urn:fediz:idp"/> + <property name="tokenType" value="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"/> + <property name="claimsRequired" value="true"/> + </bean> + + <bean id="stsClientForRpAction" class="org.apache.cxf.fediz.service.idp.beans.STSClientAction"> + <property name="wsdlLocation" value="https://localhost:${idp.https.port}/fediz-idp-sts/STSServiceTransport?wsdl"/> + <property name="wsdlEndpoint" value="Transport_Port"/> + <property name="tokenType" value="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"/> + <property name="claimsRequired" value="true"/> + </bean> + + <bean id="logoutAction" class="org.apache.cxf.fediz.service.idp.beans.LogoutAction" /> + + <bean id="decodeAuthorizationHeaderAction" class="org.apache.cxf.fediz.service.idp.beans.DecodeAuthorizationHeaderAction" /> + + <bean id="initialFlowSetupAction" class="org.apache.cxf.fediz.service.idp.beans.InitialFlowSetupAction" > +<!-- <property name="authSupportType" value="FORM" /> --> +<!-- <property name="authSupportType" value="BASIC" /> --> + <property name="idpName" value="LocalIDP" /> + </bean> + +</beans> Modified: cxf/fediz/trunk/systests/spring/src/test/resources/fediz_config.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/spring/src/test/resources/fediz_config.xml?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/spring/src/test/resources/fediz_config.xml (original) +++ cxf/fediz/trunk/systests/spring/src/test/resources/fediz_config.xml Thu Mar 28 19:53:35 2013 @@ -21,7 +21,7 @@ <protocol xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="federationProtocolType" version="1.0.0"> <realm>urn:org:apache:cxf:fediz:fedizhelloworld</realm> - <issuer>https://localhost:${idp.https.port}/fediz-idp/</issuer> + <issuer>https://localhost:${idp.https.port}/fediz-idp/federation</issuer> <roleDelimiter>,</roleDelimiter> <roleURI>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role</roleURI> <reply>/j_spring_fediz_security_check</reply> @@ -52,7 +52,7 @@ <protocol xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="federationProtocolType" version="1.0.0"> <realm>urn:org:apache:cxf:fediz:fedizhelloworld</realm> - <issuer>https://localhost:${idp.https.port}/fediz-idp/</issuer> + <issuer>https://localhost:${idp.https.port}/fediz-idp/federation</issuer> <roleDelimiter>,</roleDelimiter> <roleURI>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role</roleURI> <reply>/j_spring_fediz_security_check</reply> Modified: cxf/fediz/trunk/systests/spring/src/test/resources/idp-server.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/spring/src/test/resources/idp-server.xml?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/spring/src/test/resources/idp-server.xml (original) +++ cxf/fediz/trunk/systests/spring/src/test/resources/idp-server.xml Thu Mar 28 19:53:35 2013 @@ -1,30 +1,36 @@ <?xml version="1.0"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> - + <Configure id="IdpServer" class="org.eclipse.jetty.server.Server"> - + <Call class="java.lang.System" name="setProperty"> + <Arg>org.apache.jasper.compiler.disablejsr199</Arg> + <Arg>true</Arg> + </Call> + <Call class="org.eclipse.jetty.util.log.Log" name="getRootLogger"> - <Call name="setDebugEnabled"> - <Arg type="boolean">true</Arg> - </Call> + <Call name="setDebugEnabled"> + <Arg type="boolean">true</Arg> + </Call> </Call> - + <Call name="addConnector"> - <Arg> - <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector"> - <Arg> - <New class="org.eclipse.jetty.http.ssl.SslContextFactory"> - <Set name="keyStore">./target/test-classes/server.jks</Set> - <Set name="keyStorePassword">tompass</Set> - <Set name="keyManagerPassword">tompass</Set> - </New> - </Arg> - <Set name="port">${idp.https.port}</Set> - <Set name="maxIdleTime">30000</Set> - </New> - </Arg> - </Call> - + <Arg> + <New + class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector"> + <Arg> + <New class="org.eclipse.jetty.http.ssl.SslContextFactory"> + <Set name="keyStore">./target/test-classes/server.jks + </Set> + <Set name="keyStorePassword">tompass</Set> + <Set name="keyManagerPassword">tompass</Set> + </New> + </Arg> + <Set name="port">${idp.https.port}</Set> + <Set name="maxIdleTime">30000</Set> + </New> + </Arg> + </Call> + <Set name="handler"> <New class="org.eclipse.jetty.server.handler.HandlerList"> <Set name="handlers"> @@ -33,12 +39,14 @@ <New class="org.eclipse.jetty.webapp.WebAppContext"> <Set name="contextPath">/fediz-idp</Set> <Set name="war">./target/fediz-idp.war</Set> + <!--Set name="war">./target/jetty/idp/webapps/fediz-idp</Set--> <Set name="throwUnavailableOnStartupException">true</Set> </New> </Item> <Item> <New class="org.eclipse.jetty.webapp.WebAppContext"> <Set name="contextPath">/fediz-idp-sts</Set> + <!--<Set name="war">./target/jetty/idp/webapps/fediz-idp-sts</Set>--> <Set name="war">./target/fediz-idp-sts.war</Set> <Set name="throwUnavailableOnStartupException">true</Set> </New> @@ -47,5 +55,5 @@ </Set> </New> </Set> - + </Configure> Modified: cxf/fediz/trunk/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java (original) +++ cxf/fediz/trunk/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java Thu Mar 28 19:53:35 2013 @@ -54,15 +54,15 @@ public abstract class AbstractTests { super(); } + public abstract String getServletContextName(); + public abstract String getIdpHttpsPort(); public abstract String getRpHttpsPort(); - - public abstract String getServletContextName(); @org.junit.Test public void testUserAlice() throws Exception { - String url = "https://localhost:" + getRpHttpsPort() + "/" + getServletContextName() + "/secure/fedservlet"; + String url = "https://localhost:" + getRpHttpsPort() + "/fedizhelloworld/secure/fedservlet"; String user = "alice"; String password = "ecila"; String response = sendHttpGet(url, user, password); @@ -81,18 +81,12 @@ public abstract class AbstractTests { claim = ClaimTypes.EMAILADDRESS.toString(); Assert.assertTrue("User " + user + " claim " + claim + " is not '[email protected]'", response.indexOf(claim + "[email protected]") > 0); - - Assert.assertTrue("Login token missing in SecurityTokenThreadLocal", - response.indexOf("loginToken=FOUND{SecurityTokenThreadLocal}") > 0); - - Assert.assertTrue("Login token missing in SecurityTokenThreadLocal", - response.indexOf("loginToken=FOUND{FederationPrincipal}") > 0); } @org.junit.Test public void testUserBob() throws Exception { - String url = "https://localhost:" + getRpHttpsPort() + "/" + getServletContextName() + "/secure/fedservlet"; + String url = "https://localhost:" + getRpHttpsPort() + "/fedizhelloworld/secure/fedservlet"; String user = "bob"; String password = "bob"; String response = sendHttpGet(url, user, password); @@ -111,17 +105,11 @@ public abstract class AbstractTests { claim = ClaimTypes.EMAILADDRESS.toString(); Assert.assertTrue("User " + user + " claim " + claim + " is not '[email protected]'", response.indexOf(claim + "[email protected]") > 0); - - Assert.assertTrue("Login token missing in SecurityTokenThreadLocal", - response.indexOf("loginToken=FOUND{SecurityTokenThreadLocal}") > 0); - - Assert.assertTrue("Login token missing in SecurityTokenThreadLocal", - response.indexOf("loginToken=FOUND{FederationPrincipal}") > 0); } @org.junit.Test public void testUserTed() throws Exception { - String url = "https://localhost:" + getRpHttpsPort() + "/" + getServletContextName() + "/secure/fedservlet"; + String url = "https://localhost:" + getRpHttpsPort() + "/fedizhelloworld/secure/fedservlet"; String user = "ted"; String password = "det"; String response = sendHttpGet(url, user, password); @@ -140,18 +128,11 @@ public abstract class AbstractTests { claim = ClaimTypes.EMAILADDRESS.toString(); Assert.assertTrue("User " + user + " claim " + claim + " is not '[email protected]'", response.indexOf(claim + "[email protected]") > 0); - - Assert.assertTrue("Login token missing in SecurityTokenThreadLocal", - response.indexOf("loginToken=FOUND{SecurityTokenThreadLocal}") > 0); - - Assert.assertTrue("Login token missing in SecurityTokenThreadLocal", - response.indexOf("loginToken=FOUND{FederationPrincipal}") > 0); } @org.junit.Test public void testUserAliceNoAccess() throws Exception { - String url = "https://localhost:" + getRpHttpsPort() + "/" - + getServletContextName() + "/secure/admin/fedservlet"; + String url = "https://localhost:" + getRpHttpsPort() + "/fedizhelloworld/secure/admin/fedservlet"; String user = "alice"; String password = "ecila"; sendHttpGet(url, user, password, 200, 403); @@ -160,8 +141,7 @@ public abstract class AbstractTests { @org.junit.Ignore @org.junit.Test public void testUserAliceWrongPassword() throws Exception { - String url = "https://localhost:" + getRpHttpsPort() + "/" - + getServletContextName() + "/secure/fedservlet"; + String url = "https://localhost:" + getRpHttpsPort() + "/fedizhelloworld/secure/fedservlet"; String user = "alice"; String password = "alice"; //[TODO] Fix IDP return code from 500 to 401 @@ -170,8 +150,7 @@ public abstract class AbstractTests { @org.junit.Test public void testUserTedNoAccess() throws Exception { - String url = "https://localhost:" + getRpHttpsPort() + "/" - + getServletContextName() + "/secure/admin/fedservlet"; + String url = "https://localhost:" + getRpHttpsPort() + "/fedizhelloworld/secure/admin/fedservlet"; String user = "ted"; String password = "det"; sendHttpGet(url, user, password, 200, 403); @@ -183,7 +162,6 @@ public abstract class AbstractTests { private String sendHttpGet(String url, String user, String password, int returnCodeIDP, int returnCodeRP) throws Exception { - System.out.println(">>>User: " + user + " Password: " + password + " URL: " + url); DefaultHttpClient httpclient = new DefaultHttpClient(); try { httpclient.getCredentialsProvider().setCredentials( @@ -212,7 +190,7 @@ public abstract class AbstractTests { HttpResponse response = httpclient.execute(httpget); HttpEntity entity = response.getEntity(); - + System.out.println(response.getStatusLine()); if (entity != null) { System.out.println("Response content length: " + entity.getContentLength()); @@ -234,12 +212,9 @@ public abstract class AbstractTests { httpclient.setRedirectStrategy(new LaxRedirectStrategy()); - Source source = new Source(EntityUtils.toString(entity)); List <NameValuePair> nvps = new ArrayList <NameValuePair>(); FormFields formFields = source.getFormFields(); - System.out.println(formFields.getDebugInfo()); - System.out.println(source.getFormControls().toString()); List<Element> forms = source.getAllElements(HTMLElementName.FORM); Assert.assertEquals("Only one form expected but got " + forms.size(), 1, forms.size()); @@ -247,10 +222,13 @@ public abstract class AbstractTests { Assert.assertNotNull("Form field 'wa' not found", formFields.get("wa")); Assert.assertNotNull("Form field 'wresult' not found", formFields.get("wresult")); - for (FormField formField : formFields) { - nvps.add(new BasicNameValuePair(formField.getName(), formField.getValues().get(0))); - } + for (FormField formField : formFields) { + if (formField.getUserValueCount() != 0) { + nvps.add(new BasicNameValuePair(formField.getName(), + formField.getValues().get(0))); + } + } HttpPost httppost = new HttpPost(postUrl); httppost.setEntity(new UrlEncodedFormEntity(nvps, Consts.UTF_8)); @@ -267,9 +245,6 @@ public abstract class AbstractTests { } return EntityUtils.toString(entity); - } catch (Exception ex) { - ex.printStackTrace(); - throw ex; } finally { // When HttpClient instance is no longer needed, // shut down the connection manager to ensure Modified: cxf/fediz/trunk/systests/tomcat7/pom.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/tomcat7/pom.xml?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/tomcat7/pom.xml (original) +++ cxf/fediz/trunk/systests/tomcat7/pom.xml Thu Mar 28 19:53:35 2013 @@ -77,6 +77,18 @@ <type>test-jar</type> <scope>test</scope> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${slf4j.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + <version>${slf4j.version}</version> + <scope>test</scope> + </dependency> </dependencies> <build> <testResources> @@ -84,10 +96,6 @@ <directory>src/test/resources</directory> <filtering>true</filtering> <includes> - <!-- - <include>**/idp-server.xml</include> - <include>**/rp-server.xml</include> ---> <include>**/fediz_config.xml</include> </includes> </testResource> @@ -95,10 +103,6 @@ <directory>src/test/resources</directory> <filtering>false</filtering> <excludes> - <!-- - <exclude>**/idp-server.xml</exclude> - <exclude>**/rp-server.xml</exclude> ---> <exclude>**/fediz_config.xml</exclude> </excludes> </testResource> @@ -163,7 +167,6 @@ </artifactItem> </artifactItems> <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename> - <outputDirectory>target/webapps</outputDirectory> <overWriteSnapshots>true</overWriteSnapshots> <overWriteIfNewer>true</overWriteIfNewer> <stripVersion>true</stripVersion> Modified: cxf/fediz/trunk/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TomcatTest.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TomcatTest.java?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TomcatTest.java (original) +++ cxf/fediz/trunk/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TomcatTest.java Thu Mar 28 19:53:35 2013 @@ -43,15 +43,11 @@ public class TomcatTest extends Abstract @BeforeClass public static void init() { System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); - System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true"); - System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug"); - System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug"); - - // System.setProperty("idp.https.port", "23617"); - // System.setProperty("rp.https.port", "24617"); + System.setProperty("org.apache.commons.logging.simplelog.log.org.springframework.webflow", "debug"); + System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.cxf.fediz", "debug"); idpHttpsPort = System.getProperty("idp.https.port"); Assert.assertNotNull("Property 'idp.https.port' null", idpHttpsPort); Modified: cxf/fediz/trunk/systests/tomcat7/src/test/resources/fediz_config.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/tomcat7/src/test/resources/fediz_config.xml?rev=1462277&r1=1462276&r2=1462277&view=diff ============================================================================== --- cxf/fediz/trunk/systests/tomcat7/src/test/resources/fediz_config.xml (original) +++ cxf/fediz/trunk/systests/tomcat7/src/test/resources/fediz_config.xml Thu Mar 28 19:53:35 2013 @@ -21,7 +21,7 @@ <protocol xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="federationProtocolType" version="1.0.0"> <realm>urn:org:apache:cxf:fediz:fedizhelloworld</realm> - <issuer>https://localhost:${idp.https.port}/fediz-idp/</issuer> + <issuer>https://localhost:${idp.https.port}/fediz-idp/federation</issuer> <roleDelimiter>,</roleDelimiter> <roleURI>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role</roleURI> <freshness>10</freshness> Added: cxf/fediz/trunk/systests/tomcat7/src/test/webapps/fediz-idp/WEB-INF/idp-servlet.xml URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/systests/tomcat7/src/test/webapps/fediz-idp/WEB-INF/idp-servlet.xml?rev=1462277&view=auto ============================================================================== --- cxf/fediz/trunk/systests/tomcat7/src/test/webapps/fediz-idp/WEB-INF/idp-servlet.xml (added) +++ cxf/fediz/trunk/systests/tomcat7/src/test/webapps/fediz-idp/WEB-INF/idp-servlet.xml Thu Mar 28 19:53:35 2013 @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:webflow="http://www.springframework.org/schema/webflow-config" + xmlns:p="http://www.springframework.org/schema/p" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd"> + + <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping" + p:flowRegistry-ref="flowRegistry" + p:order="2"> +<!-- <property name="interceptors"> --> +<!-- <ref local="localeChangeInterceptor" /> --> +<!-- </property> --> + </bean> + + <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter" + p:flowExecutor-ref="flowExecutor" /> + + <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry"> + <webflow:flow-execution-attributes> + <webflow:always-redirect-on-pause value="false" /> + </webflow:flow-execution-attributes> + </webflow:flow-executor> + + <webflow:flow-registry id="flowRegistry" flow-builder-services="builder"> + <webflow:flow-location path="/WEB-INF/federation-webflow.xml" id="federation" /> + </webflow:flow-registry> + + <webflow:flow-builder-services id="builder" view-factory-creator="viewFactoryCreator" + expression-parser="expressionParser"/> + + <bean id="expressionParser" class="org.springframework.webflow.expression.WebFlowOgnlExpressionParser" /> + + <bean id="viewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator"> + <property name="viewResolvers"> + <list> + <ref local="viewResolver" /> + </list> + </property> + </bean> + + <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> + <property name="prefix" value="/WEB-INF/"/> + <property name="suffix" value=".jsp"/> + </bean> + + <bean id="stsClientForIdpAction" class="org.apache.cxf.fediz.service.idp.beans.STSClientAction"> + <property name="wsdlLocation" value="https://localhost:${idp.https.port}/fediz-idp-sts/STSService?wsdl"/> + <property name="wsdlEndpoint" value="TransportUT_Port"/> + <property name="appliesTo" value="urn:fediz:idp"/> + <property name="tokenType" value="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"/> + <property name="claimsRequired" value="true"/> + </bean> + + <bean id="stsClientForRpAction" class="org.apache.cxf.fediz.service.idp.beans.STSClientAction"> + <property name="wsdlLocation" value="https://localhost:${idp.https.port}/fediz-idp-sts/STSServiceTransport?wsdl"/> + <property name="wsdlEndpoint" value="Transport_Port"/> + <property name="tokenType" value="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"/> + <property name="claimsRequired" value="true"/> + </bean> + + <bean id="logoutAction" class="org.apache.cxf.fediz.service.idp.beans.LogoutAction" /> + + <bean id="decodeAuthorizationHeaderAction" class="org.apache.cxf.fediz.service.idp.beans.DecodeAuthorizationHeaderAction" /> + + <bean id="initialFlowSetupAction" class="org.apache.cxf.fediz.service.idp.beans.InitialFlowSetupAction" > +<!-- <property name="authSupportType" value="FORM" /> --> +<!-- <property name="authSupportType" value="BASIC" /> --> + <property name="idpName" value="LocalIDP" /> + </bean> + +</beans>
