JBossWS SVN: r19032 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2014-10-27 04:01:58 -0400 (Mon, 27 Oct 2014)
New Revision: 19032
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestEjbTestCase.java
Log:
[JBWS-3843]:Add org.jboss.as.webservices.server.integration dependency to load UsernameTokenCallback
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestEjbTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestEjbTestCase.java 2014-10-24 15:08:21 UTC (rev 19031)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestEjbTestCase.java 2014-10-27 08:01:58 UTC (rev 19032)
@@ -64,9 +64,9 @@
{
List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
list.add(new JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-username-jaas-ejb-digest.jar") {
- {
+ { //add org.jboss.as.webservices.server.integration dependency to load UsernameTokenCallback for UsernamePasswordLoginModule
archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n" + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n" + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,org.jboss.as.webservices.server.integration\n"))
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.EJBServiceImpl.class)
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.ServiceIface.class)
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.GreetMe.class)
10 years, 1 month
JBossWS SVN: r19031 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-24 11:08:21 -0400 (Fri, 24 Oct 2014)
New Revision: 19031
Modified:
stack/cxf/trunk/modules/jaspi/src/main/java/org/jboss/wsf/stack/cxf/jaspi/interceptor/JaspiSeverInInterceptor.java
stack/cxf/trunk/modules/jaspi/src/main/java/org/jboss/wsf/stack/cxf/jaspi/interceptor/JaspiSubjectCreatingInitInterceptor.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java
Log:
[JBWS-3850] Move SubjectCreatingPolicyInterceptor to PRE_PROTOCOL interceptor phase
Modified: stack/cxf/trunk/modules/jaspi/src/main/java/org/jboss/wsf/stack/cxf/jaspi/interceptor/JaspiSeverInInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/jaspi/src/main/java/org/jboss/wsf/stack/cxf/jaspi/interceptor/JaspiSeverInInterceptor.java 2014-10-24 14:14:55 UTC (rev 19030)
+++ stack/cxf/trunk/modules/jaspi/src/main/java/org/jboss/wsf/stack/cxf/jaspi/interceptor/JaspiSeverInInterceptor.java 2014-10-24 15:08:21 UTC (rev 19031)
@@ -49,6 +49,7 @@
{
super(Phase.PRE_PROTOCOL);
addAfter(SAAJInInterceptor.class.getName());
+ addBefore("org.jboss.wsf.stack.cxf.security.authentication.JaspiSubjectCreatingInterceptor");
this.authManager = authManager;
}
Modified: stack/cxf/trunk/modules/jaspi/src/main/java/org/jboss/wsf/stack/cxf/jaspi/interceptor/JaspiSubjectCreatingInitInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/jaspi/src/main/java/org/jboss/wsf/stack/cxf/jaspi/interceptor/JaspiSubjectCreatingInitInterceptor.java 2014-10-24 14:14:55 UTC (rev 19030)
+++ stack/cxf/trunk/modules/jaspi/src/main/java/org/jboss/wsf/stack/cxf/jaspi/interceptor/JaspiSubjectCreatingInitInterceptor.java 2014-10-24 15:08:21 UTC (rev 19031)
@@ -37,7 +37,7 @@
private final JBossAuthenticationManager authenticationManger;
public JaspiSubjectCreatingInitInterceptor(String securityDomain) {
- super(Phase.PRE_INVOKE);
+ super(Phase.PRE_PROTOCOL);
this.addBefore("org.jboss.wsf.stack.cxf.security.authentication.JaspiSubjectCreatingInterceptor");
authenticationManger = new JBossAuthenticationManager(securityDomain, new JBossCallbackHandler());
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java 2014-10-24 14:14:55 UTC (rev 19030)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java 2014-10-24 15:08:21 UTC (rev 19031)
@@ -35,6 +35,7 @@
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
import org.apache.cxf.security.SecurityContext;
+import org.apache.cxf.ws.security.wss4j.UsernameTokenInterceptor;
import org.apache.wss4j.common.principal.UsernameTokenPrincipal;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.security.SecurityDomainContext;
@@ -55,7 +56,13 @@
public SubjectCreatingPolicyInterceptor()
{
- super(Phase.PRE_INVOKE);
+ this(Phase.PRE_PROTOCOL);
+ addAfter(UsernameTokenInterceptor.class.getName());
+ }
+
+ public SubjectCreatingPolicyInterceptor(String phase)
+ {
+ super(phase);
helper.setPropagateContext(true);
}
10 years, 2 months
JBossWS SVN: r19030 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2014-10-24 10:14:55 -0400 (Fri, 24 Oct 2014)
New Revision: 19030
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestEjbTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/jaxws-endpoint-config.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService_schema1.xsd
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java
Log:
[JBWS-3843]:EJB3 Web Service returns Invalid User on parallel invocations
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java 2014-10-23 17:13:14 UTC (rev 19029)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java 2014-10-24 14:14:55 UTC (rev 19030)
@@ -42,6 +42,7 @@
import java.lang.reflect.Method;
import java.util.List;
+import javax.security.auth.callback.CallbackHandler;
import javax.xml.ws.WebServiceContext;
import org.apache.cxf.Bus;
@@ -56,6 +57,7 @@
import org.apache.cxf.service.invoker.Invoker;
import org.apache.cxf.service.invoker.MethodDispatcher;
import org.apache.cxf.service.model.BindingOperationInfo;
+import org.jboss.security.auth.callback.CallbackHandlerPolicyContextHandler;
import org.jboss.ws.api.util.ServiceLoader;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -130,9 +132,28 @@
{
targetBean = this.getServiceObject(exchange);
}
- return invoke(exchange, targetBean, adjustMethodAndParams(md.getMethod(bop), exchange, params, targetBean.getClass()), params);
+
+ CallbackHandler cbHandler = exchange.getInMessage().get(CallbackHandler.class);
+ Object obj = null;
+ try
+ {
+ if (cbHandler != null)
+ {
+ CallbackHandlerPolicyContextHandler.setCallbackHandler(cbHandler);
+ }
+ obj = invoke(exchange, targetBean,
+ adjustMethodAndParams(md.getMethod(bop), exchange, params, targetBean.getClass()), params);
+ }
+ finally
+ {
+ if (cbHandler != null)
+ {
+ CallbackHandlerPolicyContextHandler.setCallbackHandler(null);
+ }
+ }
+ return obj;
}
-
+
/**
* This overrides org.apache.cxf.jaxws.AbstractInvoker in order for using the JBossWS integration logic
* to invoke the JBoss AS target bean.
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java 2014-10-23 17:13:14 UTC (rev 19029)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java 2014-10-24 14:14:55 UTC (rev 19030)
@@ -72,7 +72,7 @@
throw Messages.MESSAGES.unsupportedTokenType(token.getTokenType());
}
UsernameToken ut = (UsernameToken) token;
- subject = helper.createSubject(authenticationManger, ut.getName(), ut.getPassword(), ut.isHashed(), ut.getNonce(), ut.getCreatedTime());
+ subject = helper.createSubject(authenticationManger, ut.getName(), ut.getPassword(), ut.isHashed(), ut.getNonce(), ut.getCreatedTime(), message);
}
else
@@ -83,7 +83,7 @@
throw Messages.MESSAGES.couldNotGetSubjectInfo();
}
UsernameTokenPrincipal up = (UsernameTokenPrincipal) p;
- subject = helper.createSubject(authenticationManger, up.getName(), up.getPassword(), up.isPasswordDigest(), up.getNonce(), up.getCreatedTime());
+ subject = helper.createSubject(authenticationManger, up.getName(), up.getPassword(), up.isPasswordDigest(), up.getNonce(), up.getCreatedTime(), message);
}
Principal principal = getPrincipal(context.getUserPrincipal(), subject);
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2014-10-23 17:13:14 UTC (rev 19029)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2014-10-24 14:14:55 UTC (rev 19030)
@@ -104,7 +104,7 @@
UsernameToken ut = (UsernameToken)token;
Subject subject = createSubject(ut.getName(), ut.getPassword(), ut.isHashed(),
- ut.getNonce(), ut.getCreatedTime());
+ ut.getNonce(), ut.getCreatedTime(), msg);
SecurityContext sc = doCreateSecurityContext(context.getUserPrincipal(), subject);
msg.put(SecurityContext.class, sc);
@@ -152,7 +152,7 @@
Subject subject = null;
try
{
- subject = createSubject(name, password, isDigest, nonce, created);
+ subject = createSubject(name, password, isDigest, nonce, created, msg);
}
catch (Exception ex)
{
@@ -240,9 +240,9 @@
}
- public Subject createSubject(String name, String password, boolean isDigest, String nonce, String created)
+ public Subject createSubject(String name, String password, boolean isDigest, String nonce, String created, Message msg)
{
- return helper.createSubject(sdc.get(), name, password, isDigest, nonce, created);
+ return helper.createSubject(sdc.get(), name, password, isDigest, nonce, created, msg);
}
public void setPropagateContext(boolean propagateContext)
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java 2014-10-23 17:13:14 UTC (rev 19029)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java 2014-10-24 14:14:55 UTC (rev 19030)
@@ -81,7 +81,7 @@
throw Messages.MESSAGES.unsupportedTokenType(token.getTokenType());
}
UsernameToken ut = (UsernameToken) token;
- subject = createSubject(sdc, ut.getName(), ut.getPassword(), ut.isHashed(), ut.getNonce(), ut.getCreatedTime());
+ subject = createSubject(sdc, ut.getName(), ut.getPassword(), ut.isHashed(), ut.getNonce(), ut.getCreatedTime(), message);
}
else
@@ -92,19 +92,19 @@
throw Messages.MESSAGES.couldNotGetSubjectInfo();
}
UsernameTokenPrincipal up = (UsernameTokenPrincipal) p;
- subject = createSubject(sdc, up.getName(), up.getPassword(), up.isPasswordDigest(), up.getNonce(), up.getCreatedTime());
+ subject = createSubject(sdc, up.getName(), up.getPassword(), up.isPasswordDigest(), up.getNonce(), up.getCreatedTime(), message);
}
Principal principal = getPrincipal(context.getUserPrincipal(), subject);
message.put(SecurityContext.class, createSecurityContext(principal, subject));
}
- protected Subject createSubject(SecurityDomainContext sdc, String name, String password, boolean isDigest, String nonce, String creationTime)
+ protected Subject createSubject(SecurityDomainContext sdc, String name, String password, boolean isDigest, String nonce, String creationTime, Message msg)
{
Subject subject = null;
try
{
- subject = helper.createSubject(sdc, name, password, isDigest, nonce, creationTime);
+ subject = helper.createSubject(sdc, name, password, isDigest, nonce, creationTime, msg);
}
catch (Exception ex)
{
@@ -117,12 +117,12 @@
return subject;
}
- protected Subject createSubject(SecurityDomainContext sdc, String name, String password, boolean isDigest, byte[] nonce, String creationTime)
+ protected Subject createSubject(SecurityDomainContext sdc, String name, String password, boolean isDigest, byte[] nonce, String creationTime, Message msg)
{
Subject subject = null;
try
{
- subject = helper.createSubject(sdc, name, password, isDigest, nonce, creationTime);
+ subject = helper.createSubject(sdc, name, password, isDigest, nonce, creationTime, msg);
}
catch (Exception ex)
{
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java 2014-10-23 17:13:14 UTC (rev 19029)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java 2014-10-24 14:14:55 UTC (rev 19030)
@@ -35,6 +35,7 @@
import javax.security.auth.callback.CallbackHandler;
import org.apache.cxf.common.security.SimplePrincipal;
+import org.apache.cxf.message.Message;
import org.jboss.security.auth.callback.CallbackHandlerPolicyContextHandler;
import org.jboss.security.plugins.JBossAuthenticationManager;
import org.jboss.ws.common.utils.DelegateClassLoader;
@@ -63,14 +64,14 @@
private boolean decodeNonce = true;
- public Subject createSubject(SecurityDomainContext ctx, String name, String password, boolean isDigest, byte[] nonce, String created)
+ public Subject createSubject(SecurityDomainContext ctx, String name, String password, boolean isDigest, byte[] nonce, String created, Message msg)
{
//TODO, revisit
final String sNonce = convertNonce(nonce);
- return createSubject(ctx, name, password, isDigest, sNonce, created);
+ return createSubject(ctx, name, password, isDigest, sNonce, created, msg);
}
- public Subject createSubject(SecurityDomainContext ctx, String name, String password, boolean isDigest, String nonce, String created)
+ public Subject createSubject(SecurityDomainContext ctx, String name, String password, boolean isDigest, String nonce, String created, Message msg)
{
if (isDigest)
{
@@ -83,6 +84,7 @@
CallbackHandler handler = new UsernameTokenCallbackHandler(nonce, created, decodeNonce);
CallbackHandlerPolicyContextHandler.setCallbackHandler(handler);
+ msg.put(CallbackHandler.class, handler);
}
// authenticate and populate Subject
@@ -133,14 +135,14 @@
}
return subject;
}
- public Subject createSubject(JBossAuthenticationManager manager, String name, String password, boolean isDigest, byte[] nonce, String created)
+ public Subject createSubject(JBossAuthenticationManager manager, String name, String password, boolean isDigest, byte[] nonce, String created, Message msg)
{
//TODO revisit
final String sNonce = convertNonce(nonce);
- return createSubject(manager, name, password, isDigest, sNonce, created);
+ return createSubject(manager, name, password, isDigest, sNonce, created, msg);
}
//TODO:refactor this
- public Subject createSubject(JBossAuthenticationManager manager, String name, String password, boolean isDigest, String nonce, String created)
+ public Subject createSubject(JBossAuthenticationManager manager, String name, String password, boolean isDigest, String nonce, String created, Message msg)
{
if (isDigest)
{
@@ -153,6 +155,7 @@
CallbackHandler handler = new UsernameTokenCallbackHandler(nonce, created, decodeNonce);
CallbackHandlerPolicyContextHandler.setCallbackHandler(handler);
+ msg.put(CallbackHandler.class, handler);
}
// authenticate and populate Subject
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestEjbTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestEjbTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestEjbTestCase.java 2014-10-24 14:14:55 UTC (rev 19030)
@@ -0,0 +1,174 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.jaas;
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.wsf.stack.cxf.security.authentication.callback.UsernameTokenCallback;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+
+/**
+ * WS-Security Policy username ejb endpoint test case leveraging JAAS container integration and using digest passwords.
+ * WS-SecurityPolicy 1.2 used for policies in the included wsdl contract.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @author <a href="mailto:ema@redhat.com"/>Jim Ma<a>
+ * @since 26-May-2011
+ */
+public final class UsernameAuthorizationDigestEjbTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-username-jaas-ejb-digest/SecurityService/EJBServiceImpl";
+ private QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+
+ public static BaseDeployment<?>[] createDeployments()
+ {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-username-jaas-ejb-digest.jar") {
+ {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n" + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.EJBServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.GreetMe.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.GreetMeResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsManifestResource(
+ new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/jaxws-endpoint-config.xml"),
+ "jaxws-endpoint-config.xml")
+ .addAsManifestResource(
+ new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService.wsdl"),
+ "wsdl/SecurityService.wsdl")
+ .addAsManifestResource(
+ new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService_schema1.xsd"),
+ "wsdl/SecurityService_schema1.xsd");
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
+ public static Test suite()
+ {
+ JBossWSCXFTestSetup testSetup;
+ testSetup = new JBossWSCXFTestSetup(UsernameAuthorizationDigestEjbTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
+ Map<String, String> authenticationOptions = new HashMap<String, String>();
+ authenticationOptions.put("usersProperties", getResourceFile("jaxws/samples/wsse/policy/jaas/digest/WEB-INF/jbossws-users.properties").getAbsolutePath());
+ authenticationOptions.put("rolesProperties", getResourceFile("jaxws/samples/wsse/policy/jaas/digest/WEB-INF/jbossws-roles.properties").getAbsolutePath());
+ authenticationOptions.put("hashAlgorithm", "SHA");
+ authenticationOptions.put("hashEncoding", "BASE64");
+ authenticationOptions.put("hashCharset", "UTF-8");
+ authenticationOptions.put("hashUserPassword", "false");
+ authenticationOptions.put("hashStorePassword", "true");
+ authenticationOptions.put("storeDigestCallback", UsernameTokenCallback.class.getName());
+ authenticationOptions.put("unauthenticatedIdentity", "anonymous");
+ testSetup.addSecurityDomainRequirement("JBossWS", authenticationOptions);
+ return testSetup;
+ }
+
+ public void test() throws Exception
+ {
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "kermit");
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ }
+
+ //JBWS-3843
+ public void testConcurrent() throws Exception
+ {
+ ExecutorService executor = Executors.newFixedThreadPool(20);
+
+ List<Callable<String>> taskList = new ArrayList<Callable<String>>();
+ for (int i = 0; i < 20; i++)
+ {
+ taskList.add(new TestRunner());
+ }
+ List<Future<String>> resultList = executor.invokeAll(taskList);
+ boolean passed = true;
+ for (Future<String> future : resultList)
+ {
+ passed = future.get().equals("Secure Hello World!");
+ }
+ assertTrue("Unexpected response from concurrent invocation", passed);
+
+ }
+
+ public class TestRunner implements Callable<String>
+ {
+ public String call() throws Exception
+ {
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "kermit");
+ return proxy.sayHello();
+
+ }
+
+ }
+
+ public void testUnauthenticated() throws Exception
+ {
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "kermit");
+ try
+ {
+ proxy.greetMe();
+ fail("User kermit shouldn't be authenticated.");
+ }
+ catch (Exception e)
+ {
+ //OK
+ }
+ }
+
+ private void setupWsse(ServiceIface proxy, String username)
+ {
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.USERNAME, username);
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER,
+ "org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.UsernameDigestPasswordCallback");
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestEjbTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/jaxws-endpoint-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/jaxws-endpoint-config.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/jaxws-endpoint-config.xml 2014-10-24 14:14:55 UTC (rev 19030)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0 schema/jbossws-jaxws-config_4_0.xsd">
+
+ <endpoint-config>
+ <config-name>Custom WS-Security Endpoint</config-name>
+ <property>
+ <property-name>ws-security.validate.token</property-name>
+ <property-value>false</property-value>
+ </property>
+ <property>
+ <property-name>cxf.interceptors.in</property-name>
+ <property-value>org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor</property-value>
+ </property>
+ </endpoint-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/jaxws-endpoint-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService.wsdl (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService.wsdl 2014-10-24 14:14:55 UTC (rev 19030)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" name="SecurityService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsaws="http://www.w3.org/2005/08/addressing">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" schemaLocation="SecurityService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="sayHello">
+ <part name="parameters" element="tns:sayHello"/>
+ </message>
+ <message name="sayHelloResponse">
+ <part name="parameters" element="tns:sayHelloResponse"/>
+ </message>
+ <message name="greetMe">
+ <part name="parameters" element="tns:greetMe"/>
+ </message>
+ <message name="greetMeResponse">
+ <part name="parameters" element="tns:greetMeResponse"/>
+ </message>
+ <portType name="ServiceIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ <operation name="greetMe">
+ <input message="tns:greetMe"/>
+ <output message="tns:greetMeResponse"/>
+ </operation>
+ </portType>
+ <binding name="SecurityServicePortBinding" type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityServiceUsernameHashPasswordPolicy"/>
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="greetMe">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="SecurityService">
+ <port name="SecurityServicePort" binding="tns:SecurityServicePortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-username-jaas-ejb"/>
+ </port>
+ </service>
+
+ <wsp:Policy wsu:Id="SecurityServiceUsernameHashPasswordPolicy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:HashPassword/>
+ </wsp:Policy>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SupportingTokens>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+</definitions>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService_schema1.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService_schema1.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService_schema1.xsd 2014-10-24 14:14:55 UTC (rev 19030)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="sayHello" type="tns:sayHello"/>
+
+ <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+ <xs:complexType name="sayHello">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="sayHelloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="greetMe" type="tns:greetMe"/>
+
+ <xs:element name="greetMeResponse" type="tns:greetMeResponse"/>
+
+ <xs:complexType name="greetMe">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="greetMeResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb-digest/META-INF/wsdl/SecurityService_schema1.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
10 years, 2 months
JBossWS SVN: r19029 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-23 13:13:14 -0400 (Thu, 23 Oct 2014)
New Revision: 19029
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3792] Enabling passing tests
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2014-10-23 17:04:54 UTC (rev 19028)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2014-10-23 17:13:14 UTC (rev 19029)
@@ -691,9 +691,6 @@
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
-
- <!-- # [jbws-3792] waiting for jbossws-common update -->
- <exclude>org/jboss/test/ws/jaxws/cxf/jbws3792/wsImpl/JBWS3792WsImplTestCase*</exclude>
</excludes>
</configuration>
</plugin>
@@ -773,10 +770,6 @@
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
-
- <!-- # [jbws-3792] waiting for jbossws-common update -->
- <exclude>org/jboss/test/ws/jaxws/cxf/jbws3792/wsImpl/JBWS3792WsImplTestCase*</exclude>
-
</excludes>
</configuration>
</plugin>
@@ -857,10 +850,6 @@
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
-
- <!-- # [jbws-3792] waiting for jbossws-common update -->
- <exclude>org/jboss/test/ws/jaxws/cxf/jbws3792/wsImpl/JBWS3792WsImplTestCase*</exclude>
-
</excludes>
</configuration>
</plugin>
10 years, 2 months
JBossWS SVN: r19028 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-23 13:04:54 -0400 (Thu, 23 Oct 2014)
New Revision: 19028
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java
Log:
[JBWS-3848] Use array lists
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java 2014-10-23 17:04:10 UTC (rev 19027)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java 2014-10-23 17:04:54 UTC (rev 19028)
@@ -22,7 +22,6 @@
package org.jboss.wsf.stack.cxf.client.configuration;
import java.util.ArrayList;
-import java.util.LinkedList;
import java.util.List;
import javax.xml.ws.Binding;
@@ -158,21 +157,21 @@
{
case PRE :
if (pre == null) {
- pre = new LinkedList<Handler>();
+ pre = new ArrayList<Handler>(4);
}
pre.add(h);
break;
case POST :
if (post == null) {
- post = new LinkedList<Handler>();
+ post = new ArrayList<Handler>(4);
}
post.add(h);
break;
default :
if (ep == null) {
- ep = new LinkedList<Handler>();
+ ep = new ArrayList<Handler>();
}
ep.add(h);
break;
10 years, 2 months
JBossWS SVN: r19027 - stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-23 13:04:10 -0400 (Thu, 23 Oct 2014)
New Revision: 19027
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
Log:
Specify locale when using toLowerCase
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2014-10-22 14:18:48 UTC (rev 19026)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2014-10-23 17:04:10 UTC (rev 19027)
@@ -25,6 +25,7 @@
import java.net.URL;
import java.security.AccessController;
import java.util.List;
+import java.util.Locale;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.apache.cxf.transport.http.DestinationRegistry;
@@ -115,7 +116,7 @@
Object implementor = endpoint.getImplementor();
// setup our invoker for http endpoints if invoker is not configured in jbossws-cxf.xml DD
- boolean isHttpEndpoint = endpoint.getAddress() != null && endpoint.getAddress().substring(0, 5).toLowerCase().startsWith("http");
+ boolean isHttpEndpoint = endpoint.getAddress() != null && endpoint.getAddress().substring(0, 5).toLowerCase(Locale.ENGLISH).startsWith("http");
if ((endpoint.getInvoker() == null) && isHttpEndpoint)
{
endpoint.setInvoker(new JBossWSInvoker());
10 years, 2 months
JBossWS SVN: r19026 - in common/trunk/src: test/java/org/jboss/test/ws/common/configuration and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-22 10:18:48 -0400 (Wed, 22 Oct 2014)
New Revision: 19026
Removed:
common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigDelegateHandlerComparator.java
common/trunk/src/test/java/org/jboss/test/ws/common/configuration/ConfigDelegateHandlerComparatorTestCase.java
Log:
[JBWS-3848] Removing classes not used anymore
Deleted: common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigDelegateHandlerComparator.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigDelegateHandlerComparator.java 2014-10-22 14:18:29 UTC (rev 19025)
+++ common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigDelegateHandlerComparator.java 2014-10-22 14:18:48 UTC (rev 19026)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.ws.common.configuration;
-
-import java.io.Serializable;
-import java.util.Comparator;
-
-import javax.xml.ws.handler.Handler;
-
-/**
- * A Handler comparator properly dealing with PRE/POST ConfigDelegateHandler instances
- *
- * @author alessio.soldano(a)jboss.com
- * @since 06-Jun-2012
- *
- */
-@SuppressWarnings("rawtypes")
-public final class ConfigDelegateHandlerComparator<T extends Handler> implements Comparator<T>, Serializable
-{
- static final long serialVersionUID = 5045492270035185007L;
-
- @Override
- public int compare(Handler o1, Handler o2)
- {
- int i1 = 0;
- int i2 = 0;
- if (o1 instanceof ConfigDelegateHandler)
- {
- i1 = ((ConfigDelegateHandler) o1).isPre() ? -1 : 1;
- }
- if (o2 instanceof ConfigDelegateHandler)
- {
- i2 = ((ConfigDelegateHandler) o2).isPre() ? -1 : 1;
- }
- return i1 - i2;
- }
-}
\ No newline at end of file
Deleted: common/trunk/src/test/java/org/jboss/test/ws/common/configuration/ConfigDelegateHandlerComparatorTestCase.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/configuration/ConfigDelegateHandlerComparatorTestCase.java 2014-10-22 14:18:29 UTC (rev 19025)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/configuration/ConfigDelegateHandlerComparatorTestCase.java 2014-10-22 14:18:48 UTC (rev 19026)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.ws.common.configuration;
-
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.MessageContext;
-
-import junit.framework.TestCase;
-
-import org.jboss.ws.common.configuration.ConfigDelegateHandler;
-import org.jboss.ws.common.configuration.ConfigDelegateHandlerComparator;
-
-/**
- * Test the ConfigDelegateHandlerComparator
- *
- * @author alessio.soldano(a)jboss.org
- * @since 07-Jun-2012
- */
-public class ConfigDelegateHandlerComparatorTestCase extends TestCase
-{
- public void testComparator() throws Exception
- {
- List<NamedHandler> list = new LinkedList<NamedHandler>();
- list.add(new TestConfigDelegateHandler(new TestHandler("post1"), false));
- list.add(new TestHandler("h1"));
- list.add(new TestConfigDelegateHandler(new TestHandler("post2"), false));
- list.add(new TestConfigDelegateHandler(new TestHandler("pre1"), true));
- list.add(new TestConfigDelegateHandler(new TestHandler("pre2"), true));
- list.add(new TestHandler("h2"));
- list.add(new TestHandler("h3"));
- list.add(new TestHandler("h4"));
- list.add(new TestHandler("h5"));
- list.add(new TestConfigDelegateHandler(new TestHandler("post3"), false));
- list.add(new TestConfigDelegateHandler(new TestHandler("pre3"), true));
- list.add(new TestConfigDelegateHandler(new TestHandler("pre4"), true));
- list.add(new TestHandler("h6"));
- list.add(new TestConfigDelegateHandler(new TestHandler("post4"), false));
-
- Collections.sort(list, new ConfigDelegateHandlerComparator<Handler<MessageContext>>());
-
- StringBuilder sb = new StringBuilder();
- for (NamedHandler h : list)
- {
- sb.append(h.getName());
- sb.append(" ");
- }
- assertEquals("pre1 pre2 pre3 pre4 h1 h2 h3 h4 h5 h6 post1 post2 post3 post4", sb.toString().trim());
- }
-
- private static interface NamedHandler extends Handler<MessageContext>
- {
-
- public String getName();
-
- }
-
- private static class TestConfigDelegateHandler extends ConfigDelegateHandler<MessageContext> implements NamedHandler
- {
-
- public TestConfigDelegateHandler(Handler<MessageContext> delegate, boolean isPre)
- {
- super(delegate, isPre);
- }
-
- @Override
- public String getName()
- {
- return delegate instanceof NamedHandler ? ((NamedHandler) delegate).getName() : null;
- }
-
- }
-
- private static class TestHandler implements NamedHandler
- {
-
- private String name;
-
- public TestHandler(String name)
- {
- this.name = name;
- }
-
- @Override
- public String getName()
- {
- return name;
- }
-
- @Override
- public boolean handleMessage(MessageContext context)
- {
- return false;
- }
-
- @Override
- public boolean handleFault(MessageContext context)
- {
- return false;
- }
-
- @Override
- public void close(MessageContext context)
- {
- }
- }
-}
10 years, 2 months
JBossWS SVN: r19025 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-22 10:18:29 -0400 (Wed, 22 Oct 2014)
New Revision: 19025
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java
Log:
[JBWS-3848] Always cleanup the sorter
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java 2014-10-22 14:06:04 UTC (rev 19024)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java 2014-10-22 14:18:29 UTC (rev 19025)
@@ -63,8 +63,8 @@
HandlerSorter hs = new HandlerSorter();
if (hs.split(list)) {
binding.setHandlerChain(hs.merge());
- hs.cleanup();
}
+ hs.cleanup();
}
}
}
10 years, 2 months
JBossWS SVN: r19024 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-22 10:06:04 -0400 (Wed, 22 Oct 2014)
New Revision: 19024
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java
Log:
[JBWS-3848] Optimize HandlerChainSortInterceptor
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java 2014-10-22 09:41:53 UTC (rev 19023)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/HandlerChainSortInterceptor.java 2014-10-22 14:06:04 UTC (rev 19024)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -21,8 +21,8 @@
*/
package org.jboss.wsf.stack.cxf.client.configuration;
-import java.util.Collections;
-import java.util.Comparator;
+import java.util.ArrayList;
+import java.util.LinkedList;
import java.util.List;
import javax.xml.ws.Binding;
@@ -32,7 +32,8 @@
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
-import org.jboss.ws.common.configuration.ConfigDelegateHandlerComparator;
+import org.jboss.ws.common.configuration.ConfigDelegateHandler;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
/**
@@ -45,8 +46,6 @@
public class HandlerChainSortInterceptor extends AbstractPhaseInterceptor<Message>
{
private final Binding binding;
- @SuppressWarnings("rawtypes")
- private static final Comparator<Handler> comparator = new ConfigDelegateHandlerComparator<Handler>();
public HandlerChainSortInterceptor(Binding b)
{
@@ -61,10 +60,123 @@
@SuppressWarnings("rawtypes")
List<Handler> list = binding.getHandlerChain();
if (list != null && !list.isEmpty()) {
- Collections.sort(list, comparator);
- binding.setHandlerChain(list);
+ HandlerSorter hs = new HandlerSorter();
+ if (hs.split(list)) {
+ binding.setHandlerChain(hs.merge());
+ hs.cleanup();
+ }
}
}
}
+ /**
+ * Utility class for efficiently sorting handlers so that PRE handlers always
+ * come before user handlers and POST handlers always come after user handlers.
+ *
+ * We need to know if the sorted list is actually different from the original
+ * list, as if they are the same we don't want to spend time on setting a new
+ * handler chain, which can be expensive. Moreover we're not really interested
+ * in sorting the whole chain, we only care about the PRE/user/POST requirement
+ * and are fine with the relative order of handlers of the same type.
+ *
+ * So we process the list in two phases:
+ *
+ * 1) split phase: the handler list is scanned (O(n)) to split it into PRE, user
+ * and POST handler sublists. The relative order of handlers of
+ * the same type is not changed.
+ * While splitting, the procedure also figures out if the list
+ * actually requires sorting, that is whether the PRE-user-POST
+ * order requirement is not satisfied; this allows avoiding
+ * useless ordering if the list is already fine (which is the
+ * most common scenario).
+ * 2) merge phase: the sublists are merged together (O(n)) into an ordered
+ * handlers list
+ *
+ * The overall time complexity is O(2n).
+ *
+ */
+ @SuppressWarnings("rawtypes")
+ private class HandlerSorter {
+ private List<Handler> pre;
+ private List<Handler> ep;
+ private List<Handler> post;
+
+ /**
+ * Read the handlers list and figures out if it requires sorting.
+ *
+ * @param handlers
+ * @return
+ */
+ public boolean split(List<Handler> handlers) {
+ boolean requiresSort = false;
+ HandlerType lastHandlerType = null;
+ for (Handler h : handlers) {
+ if (h instanceof ConfigDelegateHandler) {
+ if (((ConfigDelegateHandler)h).isPre()) {
+ add(h, HandlerType.PRE);
+ if (lastHandlerType != null && lastHandlerType != HandlerType.PRE) {
+ requiresSort = true;
+ }
+ lastHandlerType = HandlerType.PRE;
+ } else {
+ add(h, HandlerType.POST);
+ lastHandlerType = HandlerType.POST;
+ }
+ } else {
+ add(h, HandlerType.ENDPOINT);
+ if (lastHandlerType != null && lastHandlerType == HandlerType.POST) {
+ requiresSort = true;
+ }
+ lastHandlerType = HandlerType.ENDPOINT;
+ }
+ }
+ return requiresSort;
+ }
+
+
+
+ public List<Handler> merge() {
+ List<Handler> l = new ArrayList<Handler>();
+ if (pre != null) {
+ l.addAll(pre);
+ }
+ l.addAll(ep);
+ if (post != null) {
+ l.addAll(post);
+ }
+ return l;
+ }
+
+ public void cleanup() {
+ this.pre = null;
+ this.post = null;
+ this.ep = null;
+ }
+
+ private void add(Handler h, HandlerType t) {
+ switch (t)
+ {
+ case PRE :
+ if (pre == null) {
+ pre = new LinkedList<Handler>();
+ }
+ pre.add(h);
+ break;
+
+ case POST :
+ if (post == null) {
+ post = new LinkedList<Handler>();
+ }
+ post.add(h);
+ break;
+
+ default :
+ if (ep == null) {
+ ep = new LinkedList<Handler>();
+ }
+ ep.add(h);
+ break;
+ }
+ }
+ }
}
10 years, 2 months
JBossWS SVN: r19023 - in projects/wsi-bp-test/trunk: bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/anon and 30 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2014-10-22 05:41:53 -0400 (Wed, 22 Oct 2014)
New Revision: 19023
Added:
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptDeploymentArchives.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/DeploymentArchives.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/DeploymentArchives.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustBearerTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustHolderOfKeyTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceIface.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceImpl.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/BearerIface.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/BearerImpl.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyIface.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyImpl.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceIface.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceImpl.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/picketlink/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/picketlink/PicketLinkSTService.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServerCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServiceIface.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServiceImpl.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/ClientCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/UsernameTokenCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/STSCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/SampleSTS.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/STSBearerCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/SampleSTSBearer.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/STSHolderOfKeyCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/SampleSTSHolderOfKey.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/wsf/test/CryptoHelper.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/bearer/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/bearer/web.xml
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/holderofkey/
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/holderofkey/web.xml
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService.wsdl
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService_schema1.xsd
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService.wsdl
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService_schema1.xsd
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService.wsdl
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/bearer-ws-trust-1.4-service.wsdl
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/holderofkey-ws-trust-1.4-service.wsdl
Removed:
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ClientCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/STSCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ServerCallbackHandler.java
Modified:
projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/anon/Test1189AnonTestCase.java
projects/wsi-bp-test/trunk/bp20-tests/src/test/java/org/jboss/test/ws/jaxws/bp20/wsa/test1189/anon/Test1189AnonTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/pom.xml
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/JavaFirstServiceImpl.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/KeystorePasswordCallback.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/MultipleClientsSignEncryptTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/ServerUsernamePasswordCallback.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptHelper.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameOverTransportTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernamePasswordCallback.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationEJBTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameDigestPasswordCallback.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernamePasswordCallback.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/KeystorePasswordCallback.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SamlCallbackHandler.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServerUsernamePasswordCallback.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/UsernamePasswordCallback.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/KeystorePasswordCallback.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/SecureConversationTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/wsf/test/TestServlet.java
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/jaxws-endpoint-config.xml
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/wsdl/SecurityService.wsdl
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/jaxws-client-config.xml
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign/META-INF-server/wsdl/SecurityService.wsdl
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign/WEB-INF/wsdl/SecurityService.wsdl
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jaxws-endpoint-config.xml
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService.wsdl
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-roles.properties
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-users.properties
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/web.xml
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl
projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl
projects/wsi-bp-test/trunk/pom.xml
Log:
Update bp test suite to work with wildfly8x and wildfly900
Modified: projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/anon/Test1189AnonTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/anon/Test1189AnonTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1189/anon/Test1189AnonTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -34,7 +34,6 @@
import org.apache.cxf.ws.addressing.AttributedURIType;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
import org.apache.cxf.ws.addressing.JAXWSAConstants;
-import org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl;
import org.jboss.test.ws.jaxws.bp12.common.BP12Test;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
@@ -60,7 +59,7 @@
EndpointReferenceType wsaTo = new EndpointReferenceType();
- AddressingProperties addrProperties = new AddressingPropertiesImpl();
+ AddressingProperties addrProperties = new AddressingProperties();
AttributedURIType epr = new AttributedURIType();
epr.setValue( "http://" + getServerHost() + ":8080/jaxws-bp12test1189-anon/Test1189Anon");
wsaTo.setAddress(epr);
@@ -74,7 +73,6 @@
}
catch (SOAPFaultException e)
{
- e.printStackTrace();
assertTrue("only anonymous supported error message is expected", e.getMessage().contains("Found non-anonymous address but only anonymous supported"));
}
Modified: projects/wsi-bp-test/trunk/bp20-tests/src/test/java/org/jboss/test/ws/jaxws/bp20/wsa/test1189/anon/Test1189AnonTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bp20-tests/src/test/java/org/jboss/test/ws/jaxws/bp20/wsa/test1189/anon/Test1189AnonTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bp20-tests/src/test/java/org/jboss/test/ws/jaxws/bp20/wsa/test1189/anon/Test1189AnonTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -33,7 +33,6 @@
import org.apache.cxf.ws.addressing.AttributedURIType;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
import org.apache.cxf.ws.addressing.JAXWSAConstants;
-import org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl;
import org.jboss.test.ws.jaxws.bp20.common.BP20Test;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
@@ -59,7 +58,7 @@
EndpointReferenceType wsaTo = new EndpointReferenceType();
- AddressingProperties addrProperties = new AddressingPropertiesImpl();
+ AddressingProperties addrProperties = new AddressingProperties();
AttributedURIType epr = new AttributedURIType();
epr.setValue( "http://" + getServerHost() + ":8080/jaxws-bp20test1189-anon/Test1189Anon");
wsaTo.setAddress(epr);
@@ -73,7 +72,6 @@
}
catch (Exception e)
{
- e.printStackTrace();
assertTrue("only anonymous supported error message is expected", e.getMessage().contains("Found non-anonymous address but only anonymous supported"));
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/pom.xml
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/pom.xml 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/pom.xml 2014-10-22 09:41:53 UTC (rev 19023)
@@ -12,8 +12,19 @@
<artifactId>wsi-bp-testsuite</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
- </parent>
-
+ </parent>
+ <!-- Properties -->
+ <properties>
+ <shrinkwrap.version>1.1.3</shrinkwrap.version>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-depchain</artifactId>
+ <version>${shrinkwrap.version}</version>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
<!-- Profiles -->
<profiles>
<!--
@@ -76,6 +87,27 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>exclude-integration-tests-BC-related</id>
+ <activation>
+ <property>
+ <name>exclude-integration-tests-BC-related</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes combine.children="append">
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase*</exclude>
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.basic;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+)
+public interface AnnotatedServiceIface
+{
+ @WebMethod
+ String sayHello();
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceIface.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.basic;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.PolicySets;
+import org.jboss.wsf.stack.cxf.extensions.policy.Constants;
+
+@WebService(
+ portName = "AnnotatedSecurityServicePort",
+ serviceName = "AnnotatedSecurityService",
+ name = "AnnotatedServiceIface",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.basic.AnnotatedServiceIface",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.signature.username", value = "bob"),
+ @EndpointProperty(key = "ws-security.encryption.username", value = "alice"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback")
+ }
+)
+(a)PolicySets(Constants.AsymmetricBinding_X509v1_GCM256OAEP_ProtectTokens_POLICY_SET)
+public class AnnotatedServiceImpl implements AnnotatedServiceIface
+{
+ public String sayHello()
+ {
+ return "Secure Hello World!";
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.basic;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.message.Message;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.ws.common.IOUtils;
+import org.jboss.wsf.test.CryptoHelper;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * WS-SecurityPolicy code first dev test
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 05-Jun-2013
+ */
+public final class AnnotatedSignEncryptTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-sign-encrypt-gcm-code-first/AnnotatedSecurityService";
+
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(AnnotatedSignEncryptTestCase.class, SignEncryptDeploymentArchives.SERVER_GCM_CODEFIRST_WAR + " " + SignEncryptDeploymentArchives.CLIENT_JAR);
+ }
+
+ public void testWsdl() throws Exception
+ {
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ assertTrue(IOUtils.readAndCloseStream(wsdlURL.openStream()).contains("AsymmetricBinding_X509v1_GCM256OAEP_ProtectTokens_binding_policy"));
+ }
+
+ public void test() throws Exception
+ {
+ try {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "AnnotatedSecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ AnnotatedServiceIface proxy = (AnnotatedServiceIface)service.getPort(AnnotatedServiceIface.class);
+ setupWsse(proxy);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
+ ((BindingProvider)proxy).getRequestContext().put(Message.RECEIVE_TIMEOUT, 120000);
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
+ }
+
+ private void setupWsse(AnnotatedServiceIface proxy)
+ {
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME, "alice");
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_USERNAME, "bob");
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/JavaFirstServiceImpl.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/JavaFirstServiceImpl.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/JavaFirstServiceImpl.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -23,8 +23,9 @@
import javax.jws.WebService;
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
import org.apache.cxf.annotations.Policy;
-import org.jboss.ws.api.annotation.EndpointConfig;
@WebService
(
@@ -34,7 +35,10 @@
targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
)
@Policy(placement = Policy.Placement.BINDING, uri = "JavaFirstPolicy.xml")
-@EndpointConfig(configFile = "WEB-INF/jaxws-endpoint-config.xml", configName = "Custom WS-Security Endpoint")
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServerUsernamePasswordCallback")
+ }
+)
public class JavaFirstServiceImpl //Not extending JavaFirstServiceIface for testing purposes only, to avoid having to
//move the @Policy annotation in the interface, which is also used on client side.
{
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/KeystorePasswordCallback.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/KeystorePasswordCallback.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/KeystorePasswordCallback.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,51 +21,23 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
-public class KeystorePasswordCallback implements CallbackHandler
+public class KeystorePasswordCallback extends PasswordCallbackHandler
{
-
- private Map<String, String> passwords = new HashMap<String, String>();
-
public KeystorePasswordCallback()
{
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap() {
+ Map<String, String> passwords = new HashMap<String, String>();
passwords.put("alice", "password");
passwords.put("bob", "password");
passwords.put("john", "password");
+ return passwords;
}
-
- /**
- * It attempts to get the password from the private
- * alias/passwords map.
- */
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i = 0; i < callbacks.length; i++)
- {
- WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
-
- String pass = passwords.get(pc.getIdentifier());
- if (pass != null)
- {
- pc.setPassword(pass);
- return;
- }
- }
- }
-
- /**
- * Add an alias/password pair to the callback mechanism.
- */
- public void setAliasPassword(String alias, String password)
- {
- passwords.put(alias, password);
- }
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/MultipleClientsSignEncryptTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/MultipleClientsSignEncryptTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/MultipleClientsSignEncryptTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,7 +21,10 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
+import java.io.File;
import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
@@ -31,8 +34,11 @@
import junit.framework.Test;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
/**
* WS-Security Policy sign & encrypt test case
@@ -45,10 +51,38 @@
{
private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-sign-encrypt-mc/SecurityService";
+ public static BaseDeployment<?>[] createDeployments() {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-sign-encrypt-mc-client.jar") { {
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/alice.jks"), "alice.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/alice.properties"), "alice.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/john.jks"), "john.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/john.properties"), "john.properties");
+ }
+ });
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-sign-encrypt-mc.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.MultipleClientsServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/bob2.jks"), "classes/bob2.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/bob2.properties"), "classes/bob2.properties")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd");
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
public static Test suite()
{
- return new JBossWSCXFTestSetup(MultipleClientsSignEncryptTestCase.class,
- "jaxws-samples-wsse-policy-sign-encrypt-mc-client.jar jaxws-samples-wsse-policy-sign-encrypt-mc.war");
+ return new JBossWSCXFTestSetup(MultipleClientsSignEncryptTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
}
public void testAlice() throws Exception
@@ -58,13 +92,15 @@
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "alice");
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
+
try
{
assertEquals("Multiple Clients Secure Hello World!", proxy.sayHello());
}
catch (SOAPFaultException e)
{
- throw new Exception("Please check that the Bouncy Castle provider is installed.", e);
+ throw new Exception("Error " + e.getMessage() + " - please check that the Bouncy Castle provider is installed.", e);
}
}
@@ -75,19 +111,19 @@
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "john");
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
try
{
assertEquals("Multiple Clients Secure Hello World!", proxy.sayHello());
}
catch (SOAPFaultException e)
{
- throw new Exception("Please check that the Bouncy Castle provider is installed.", e);
+ throw new Exception("Error " + e.getMessage() + " - please check that the Bouncy Castle provider is installed.", e);
}
}
private void setupWsse(ServiceIface proxy, String client)
{
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:7070/jaxws-samples-wsse-policy-sign-encrypt-mc/SecurityS...");
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/" + client + ".properties"));
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/" + client + ".properties"));
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/ServerUsernamePasswordCallback.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/ServerUsernamePasswordCallback.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/ServerUsernamePasswordCallback.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,20 +21,21 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
-import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
-public class ServerUsernamePasswordCallback implements CallbackHandler
+public class ServerUsernamePasswordCallback extends PasswordCallbackHandler
{
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ public ServerUsernamePasswordCallback()
{
- WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
- //this CallbackHandler is meant for use with WSS4J 1.6, see http://ws.apache.org/wss4j/wss4j16.html
- if ("kermit".equals(pc.getIdentifier()))
- pc.setPassword("thefrog");
+ super(getInitMap());
}
+
+ private static Map<String, String> getInitMap() {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("kermit", "thefrog");
+ return passwords;
+ }
}
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptDeploymentArchives.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptDeploymentArchives.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptDeploymentArchives.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.basic;
+
+import java.io.File;
+
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.wsf.test.JBossWSTestHelper;
+
+public final class SignEncryptDeploymentArchives
+{
+ public static final String SERVER_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-sign-encrypt.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/bob.jks"), "classes/bob.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/bob.properties"), "classes/bob.properties")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/web.xml"));
+ }
+ });
+
+ public static final String CLIENT_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-sign-encrypt-client.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client services\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.SignEncryptHelper.class)
+ .addClass(org.jboss.wsf.test.ClientHelper.class)
+ .addClass(org.jboss.wsf.test.CryptoHelper.class)
+ .addClass(org.jboss.wsf.test.TestServlet.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/alice.properties"), "classes/META-INF/alice.properties")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/alice.jks"), "classes/META-INF/alice.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/jaxws-client-config.xml"), "classes/META-INF/jaxws-client-config.xml");
+ }
+ });
+
+ public static final String CLIENT_JAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-sign-encrypt-client.jar") { {
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/alice.jks"), "alice.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/alice.properties"), "alice.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/jaxws-client-config.xml"), "jaxws-client-config.xml");
+ }
+ });
+
+ public static final String SERVER_GCM_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-sign-encrypt-gcm.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/bob.jks"), "classes/bob.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/bob.properties"), "classes/bob.properties")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/web.xml"));
+ }
+ });
+
+ public static final String SERVER_GCM_CODEFIRST_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-sign-encrypt-gcm-code-first.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.AnnotatedServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.AnnotatedServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/bob.jks"), "classes/bob.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/bob.properties"), "classes/bob.properties");
+ }
+ });
+
+
+ private SignEncryptDeploymentArchives() {
+ //NOOP
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptDeploymentArchives.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -43,10 +42,8 @@
public static Test suite()
{
- return new JBossWSCXFTestSetup(SignEncryptGCMTestCase.class,
- "jaxws-samples-wsse-policy-sign-encrypt-client.jar " +
- "jaxws-samples-wsse-policy-sign-encrypt-client.war " +
- "jaxws-samples-wsse-policy-sign-encrypt-gcm.war");
+ return new JBossWSCXFTestSetup(SignEncryptGCMTestCase.class,
+ SignEncryptDeploymentArchives.CLIENT_JAR + " " + SignEncryptDeploymentArchives.CLIENT_WAR + " " + SignEncryptDeploymentArchives.SERVER_GCM_WAR);
}
public void testClientSide() throws Exception
@@ -75,7 +72,6 @@
{
URL url = new URL("http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-sign-encrypt-client?" +
"path=/jaxws-samples-wsse-policy-sign-encrypt-gcm&method=testSignEncryptUsingConfigProperties&helper=" + SignEncryptHelper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("1", br.readLine());
+ assertEquals("1", IOUtils.readAndCloseStream(url.openStream()));
}
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptHelper.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptHelper.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptHelper.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -34,6 +34,7 @@
import org.apache.cxf.ws.security.SecurityConstants;
import org.jboss.ws.api.configuration.ClientConfigUtil;
import org.jboss.wsf.test.ClientHelper;
+import org.jboss.wsf.test.CryptoHelper;
public class SignEncryptHelper implements ClientHelper
{
@@ -91,14 +92,12 @@
}
catch (SOAPFaultException e)
{
- throw new Exception("Please check that the Bouncy Castle provider is installed.", e);
+ throw CryptoHelper.checkAndWrapException(e);
}
}
private void setupWsse(ServiceIface proxy)
{
- String address = targetEndpoint.replaceFirst("8080", "7070");
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address);
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -43,9 +42,7 @@
public static Test suite()
{
return new JBossWSCXFTestSetup(SignEncryptTestCase.class,
- "jaxws-samples-wsse-policy-sign-encrypt-client.jar " +
- "jaxws-samples-wsse-policy-sign-encrypt-client.war " +
- "jaxws-samples-wsse-policy-sign-encrypt.war");
+ SignEncryptDeploymentArchives.CLIENT_JAR + " " + SignEncryptDeploymentArchives.CLIENT_WAR + " " + SignEncryptDeploymentArchives.SERVER_WAR);
}
public void testClientSide() throws Exception
@@ -66,15 +63,13 @@
{
URL url = new URL("http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-sign-encrypt-client?" +
"path=/jaxws-samples-wsse-policy-sign-encrypt&method=testSignEncrypt&helper=" + SignEncryptHelper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("1", br.readLine());
+ assertEquals("1", IOUtils.readAndCloseStream(url.openStream()));
}
public void testServerSideUsingConfigProperties() throws Exception
{
URL url = new URL("http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-sign-encrypt-client?" +
"path=/jaxws-samples-wsse-policy-sign-encrypt&method=testSignEncryptUsingConfigProperties&helper=" + SignEncryptHelper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("1", br.readLine());
+ assertEquals("1", IOUtils.readAndCloseStream(url.openStream()));
}
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,7 +21,10 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
+import java.io.File;
import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
@@ -30,8 +33,11 @@
import junit.framework.Test;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
/**
* WS-Security Policy sign test case
@@ -41,33 +47,75 @@
*/
public final class SignTestCase extends JBossWSTest
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-sign";
- private final String serviceURLEJB = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-sign-ejb/SecurityService/EJBServiceImpl";
+ public static BaseDeployment<?>[] createDeployments() {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-sign-ejb.jar") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.EJBServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/META-INF-server/bob.jks"), "bob.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/META-INF-server/bob.properties"), "bob.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/META-INF-server/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/META-INF-server/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/META-INF-server/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd");
+ }
+ });
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-sign.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/WEB-INF/bob.jks"), "classes/bob.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/WEB-INF/bob.properties"), "classes/bob.properties")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/WEB-INF/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/WEB-INF/web.xml"));
+ }
+ });
+ list.add(new JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-sign-client.jar") { {
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/META-INF/alice.jks"), "alice.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/sign/META-INF/alice.properties"), "alice.properties");
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
public static Test suite()
{
- return new JBossWSCXFTestSetup(SignTestCase.class, "jaxws-samples-wsse-policy-sign-client.jar jaxws-samples-wsse-policy-sign.war jaxws-samples-wsse-policy-sign-ejb.jar");
+ return new JBossWSCXFTestSetup(SignTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
}
public void test() throws Exception
{
QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
- URL wsdlURL = new URL(serviceURL + "?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-sign?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
setupWsse(proxy);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":7070/jaxws-samples-wsse-policy-sign");
assertEquals("Secure Hello World!", proxy.sayHello());
}
public void testEJB() throws Exception
{
QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
- URL wsdlURL = new URL(serviceURLEJB + "?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-sign-ejb/SecurityService/EJBServiceImpl?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURLEJB.replaceFirst("8080", "7070"));
setupWsse(proxy);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":7070/jaxws-samples-wsse-policy-sign-ejb/SecurityService/EJBServiceImpl");
assertEquals("EJB Secure Hello World!", proxy.sayHello());
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameOverTransportTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameOverTransportTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameOverTransportTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,8 +21,11 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
+import java.io.File;
import java.net.URL;
import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
@@ -32,8 +35,11 @@
import junit.framework.Test;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
@@ -46,6 +52,26 @@
{
private final String serviceURL = "https://" + getServerHost() + ":8443/jaxws-samples-wsse-policy-username";
+ public static BaseDeployment<?>[] createDeployments() {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-username.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServerUsernamePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/username/WEB-INF/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/username/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/username/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/username/WEB-INF/web.xml"));
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
public static Test suite()
{
/** System properties - currently set at testsuite start time
@@ -54,22 +80,11 @@
System.setProperty("javax.net.ssl.trustStoreType", "jks");
System.setProperty("org.jboss.security.ignoreHttpsHost", "true");
*/
- JBossWSTestSetup setup = new JBossWSCXFTestSetup(UsernameOverTransportTestCase.class, "jaxws-samples-wsse-policy-username.war");
+ JBossWSTestSetup setup = new JBossWSCXFTestSetup(UsernameOverTransportTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
Map<String, String> sslOptions = new HashMap<String, String>();
- if (isTargetJBoss7())
- {
- sslOptions.put("certificate-key-file", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
- sslOptions.put("password", "changeit");
- sslOptions.put("verify-client", "false");
- sslOptions.put("key-alias", "tomcat");
- }
- else
- {
- sslOptions.put("keystore-path", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
- sslOptions.put("keystore-password", "changeit");
- sslOptions.put("verify-client", "false");
- sslOptions.put("alias", "tomcat");
- }
+ sslOptions.put("server-identity.ssl.keystore-path", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
+ sslOptions.put("server-identity.ssl.keystore-password", "changeit");
+ sslOptions.put("server-identity.ssl.alias", "tomcat");
setup.setHttpsConnectorRequirement(sslOptions);
return setup;
}
@@ -81,6 +96,7 @@
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "kermit");
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
assertEquals("Secure Hello World!", proxy.sayHello());
}
@@ -91,6 +107,7 @@
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "snoopy");
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
try
{
proxy.sayHello();
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernamePasswordCallback.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernamePasswordCallback.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernamePasswordCallback.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -26,8 +26,9 @@
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+
public class UsernamePasswordCallback implements CallbackHandler
{
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,7 +21,10 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
+import java.io.File;
import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
@@ -30,8 +33,11 @@
import junit.framework.Test;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
/**
* WS-Security Policy username test case
@@ -44,9 +50,32 @@
private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-username-unsecure-transport/service";
private final String javaFirstServiceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-username-unsecure-transport/javafirst-service";
+ public static BaseDeployment<?>[] createDeployments() {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-username-unsecure-transport.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.JavaFirstServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.JavaFirstServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServerUsernamePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.basic.ServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/username-unsecure-transport/JavaFirstPolicy.xml"), "classes/JavaFirstPolicy.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/username-unsecure-transport/WEB-INF/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/username-unsecure-transport/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/username-unsecure-transport/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/basic/username-unsecure-transport/WEB-INF/web.xml"));
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
public static Test suite()
{
- return new JBossWSCXFTestSetup(UsernameTestCase.class, "jaxws-samples-wsse-policy-username-unsecure-transport.war");
+ return new JBossWSCXFTestSetup(UsernameTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
}
public void test() throws Exception
@@ -55,8 +84,8 @@
URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse((BindingProvider)proxy, "kermit");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
- setupWsse((BindingProvider)proxy, "kermit");
assertEquals("Secure Hello World!", proxy.sayHello());
}
@@ -66,9 +95,8 @@
URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse((BindingProvider)proxy, "snoopy");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
- setupWsse((BindingProvider)proxy, "snoopy");
try
{
proxy.sayHello();
@@ -86,11 +114,10 @@
URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
setupWsseNoCBH((BindingProvider)proxy, "kermit", "thefrog");
assertEquals("Secure Hello World!", proxy.sayHello());
setupWsseNoCBH((BindingProvider)proxy, "kermit", "wrongpassword");
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
try
{
proxy.sayHello();
@@ -109,7 +136,6 @@
Service service = Service.create(wsdlURL, serviceName);
JavaFirstServiceIface proxy = (JavaFirstServiceIface)service.getPort(JavaFirstServiceIface.class);
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, javaFirstServiceURL.replaceFirst("8080", "7070"));
-
setupWsse((BindingProvider)proxy, "kermit");
assertEquals("Secure Hello World!", proxy.sayHello());
}
@@ -120,8 +146,8 @@
URL wsdlURL = new URL(javaFirstServiceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
JavaFirstServiceIface proxy = (JavaFirstServiceIface)service.getPort(JavaFirstServiceIface.class);
+ setupWsse((BindingProvider)proxy, "snoopy");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, javaFirstServiceURL.replaceFirst("8080", "7070"));
- setupWsse((BindingProvider)proxy, "snoopy");
try
{
proxy.sayHello();
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/EJBServiceImpl.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -43,8 +43,6 @@
)
@SecurityDomain("JBossWS")
@EndpointConfig(configFile = "META-INF/jaxws-endpoint-config.xml", configName = "Custom WS-Security Endpoint")
-//be sure to have dependency on org.apache.cxf module when on AS7, otherwise Apache CXF annotations are ignored
-@InInterceptors(interceptors = {"org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor"})
public class EJBServiceImpl
{
// Provide logging
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationDigestTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,8 +21,11 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.jaas;
+import java.io.File;
import java.net.URL;
import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
@@ -32,9 +35,12 @@
import junit.framework.Test;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.wsf.stack.cxf.security.authentication.callback.UsernameTokenCallback;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
/**
* WS-Security Policy username test case leveraging JAAS container integration and using digest passwords.
@@ -47,10 +53,33 @@
{
private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-username-jaas-digest";
+ public static BaseDeployment<?>[] createDeployments() {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-username-jaas-digest.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl\n")) //cxf impl required due to custom interceptor in deployment
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.POJOEndpointAuthorizationInterceptor.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.ServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.GreetMe.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.GreetMeResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/digest/WEB-INF/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/digest/WEB-INF/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/digest/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/digest/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/digest/WEB-INF/web.xml"));
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
public static Test suite()
{
JBossWSCXFTestSetup testSetup;
- testSetup = new JBossWSCXFTestSetup(UsernameAuthorizationDigestTestCase.class, "jaxws-samples-wsse-policy-username-jaas-digest.war");
+ testSetup = new JBossWSCXFTestSetup(UsernameAuthorizationDigestTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
Map<String, String> authenticationOptions = new HashMap<String, String>();
authenticationOptions.put("usersProperties",
getResourceFile("jaxws/samples/wsse/policy/jaas/digest/WEB-INF/jbossws-users.properties").getAbsolutePath());
@@ -86,7 +115,6 @@
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "snoopy");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
try
{
proxy.sayHello();
@@ -104,9 +132,8 @@
URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
setupWsse(proxy, "kermit");
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
try
{
proxy.greetMe();
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationEJBTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationEJBTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationEJBTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,7 +21,10 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.jaas;
+import java.io.File;
import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
@@ -30,8 +33,11 @@
import junit.framework.Test;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
/**
* WS-SecurityPolicy (v.1.2) UT testcase with JAAS integration (EJB3)
@@ -43,9 +49,29 @@
{
public final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-username-jaas-ejb/SecurityService/EJBServiceImpl";
+ public static BaseDeployment<?>[] createDeployments() {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-username-jaas-ejb.jar") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.EJBServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.GreetMe.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.GreetMeResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/ejb/META-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/ejb/META-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd");
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
public static Test suite()
{
- return new JBossWSCXFTestSetup(UsernameAuthorizationEJBTestCase.class, "jaxws-samples-wsse-policy-username-jaas-ejb.jar", true);
+ return new JBossWSCXFTestSetup(UsernameAuthorizationEJBTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()), true);
}
public void test() throws Exception
@@ -56,7 +82,6 @@
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "kermit");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
assertEquals("Secure Hello World!", proxy.sayHello());
}
@@ -68,7 +93,6 @@
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "snoopy");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
try
{
proxy.sayHello();
@@ -87,6 +111,7 @@
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "kermit");
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
try
{
proxy.greetMe();
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameAuthorizationTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,7 +21,10 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.jaas;
+import java.io.File;
import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
@@ -30,8 +33,11 @@
import junit.framework.Test;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
/**
* WS-Security Policy username test case leveraging JAAS container integration.
@@ -44,9 +50,32 @@
{
private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-username-jaas";
+ public static BaseDeployment<?>[] createDeployments() {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-username-jaas.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl\n")) //cxf impl required due to custom interceptor in deployment
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.POJOEndpointAuthorizationInterceptor.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaas.ServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.GreetMe.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.GreetMeResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/auth/WEB-INF/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/auth/WEB-INF/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/auth/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/auth/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/jaas/auth/WEB-INF/web.xml"));
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
public static Test suite()
{
- return new JBossWSCXFTestSetup(UsernameAuthorizationTestCase.class, "jaxws-samples-wsse-policy-username-jaas.war", true);
+ return new JBossWSCXFTestSetup(UsernameAuthorizationTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()), true);
}
public void test() throws Exception
@@ -57,7 +86,6 @@
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "kermit");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
assertEquals("Secure Hello World!", proxy.sayHello());
}
@@ -69,7 +97,6 @@
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "snoopy");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
try
{
proxy.sayHello();
@@ -89,7 +116,6 @@
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
setupWsse(proxy, "kermit");
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
try
{
proxy.greetMe();
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameDigestPasswordCallback.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameDigestPasswordCallback.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernameDigestPasswordCallback.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -26,8 +26,9 @@
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+
public class UsernameDigestPasswordCallback implements CallbackHandler
{
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernamePasswordCallback.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernamePasswordCallback.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaas/UsernamePasswordCallback.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -26,8 +26,9 @@
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+
public class UsernamePasswordCallback implements CallbackHandler
{
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/DeploymentArchives.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/DeploymentArchives.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/DeploymentArchives.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import java.io.File;
+
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.wsf.test.JBossWSTestHelper;
+
+public final class DeploymentArchives
+{
+ public static final String CLIENT_JAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-oasis-client.jar") { {
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/META-INF/alice.jks"), "alice.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/META-INF/alice.properties"), "alice.properties");
+ }
+ });
+
+ public static final String SERVER_22X_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-oasis-22x.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.KeystorePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service221Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service222Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service223Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service224Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/bob.jks"), "classes/bob.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/bob.properties"), "classes/bob.properties")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd");
+ }
+ });
+
+ public static final String SERVER_21X_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-oasis-21x.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServerUsernamePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2111Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2112Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2113Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2121Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service213Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service214Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/bob.jks"), "classes/bob.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/bob.properties"), "classes/bob.properties")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService21x.wsdl"), "wsdl/SecurityService21x.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd");
+ }
+ });
+
+ public static final String SERVER_23X_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-oasis-23x.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.KeystorePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2311Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2312Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2313Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2314Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2315Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2321Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2322Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2323Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.Service2324Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.SAMLValidator.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/bob.jks"), "classes/bob.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/bob.properties"), "classes/bob.properties")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService23x.wsdl"), "wsdl/SecurityService23x.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd");
+ }
+ });
+
+ private DeploymentArchives() {
+ //NOOP
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/DeploymentArchives.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/KeystorePasswordCallback.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/KeystorePasswordCallback.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/KeystorePasswordCallback.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,50 +21,22 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
-public class KeystorePasswordCallback implements CallbackHandler
+public class KeystorePasswordCallback extends PasswordCallbackHandler
{
-
- private Map<String, String> passwords = new HashMap<String, String>();
-
public KeystorePasswordCallback()
{
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap() {
+ Map<String, String> passwords = new HashMap<String, String>();
passwords.put("alice", "password");
passwords.put("bob", "password");
+ return passwords;
}
-
- /**
- * It attempts to get the password from the private
- * alias/passwords map.
- */
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i = 0; i < callbacks.length; i++)
- {
- WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
-
- String pass = passwords.get(pc.getIdentifier());
- if (pass != null)
- {
- pc.setPassword(pass);
- return;
- }
- }
- }
-
- /**
- * Add an alias/password pair to the callback mechanism.
- */
- public void setAliasPassword(String alias, String password)
- {
- passwords.put(alias, password);
- }
}
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,9 @@
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+public class SAMLValidator extends org.apache.wss4j.dom.validate.SamlAssertionValidator
+{
+ public SAMLValidator() {
+ super();
+ setRequireBearerSignature(false);
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SAMLValidator.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SamlCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SamlCallbackHandler.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/SamlCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -10,17 +10,18 @@
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.components.crypto.Crypto;
-import org.apache.ws.security.components.crypto.CryptoFactory;
-import org.apache.ws.security.components.crypto.CryptoType;
-import org.apache.ws.security.saml.ext.SAMLCallback;
-import org.apache.ws.security.saml.ext.bean.AttributeBean;
-import org.apache.ws.security.saml.ext.bean.AttributeStatementBean;
-import org.apache.ws.security.saml.ext.bean.KeyInfoBean;
-import org.apache.ws.security.saml.ext.bean.KeyInfoBean.CERT_IDENTIFIER;
-import org.apache.ws.security.saml.ext.bean.SubjectBean;
-import org.apache.ws.security.saml.ext.builder.SAML1Constants;
-import org.apache.ws.security.saml.ext.builder.SAML2Constants;
+import org.apache.wss4j.common.crypto.Crypto;
+import org.apache.wss4j.common.crypto.CryptoFactory;
+import org.apache.wss4j.common.crypto.CryptoType;
+import org.apache.wss4j.common.ext.WSSecurityException;
+import org.apache.wss4j.common.saml.SAMLCallback;
+import org.apache.wss4j.common.saml.bean.AttributeBean;
+import org.apache.wss4j.common.saml.bean.AttributeStatementBean;
+import org.apache.wss4j.common.saml.bean.KeyInfoBean;
+import org.apache.wss4j.common.saml.bean.KeyInfoBean.CERT_IDENTIFIER;
+import org.apache.wss4j.common.saml.bean.SubjectBean;
+import org.apache.wss4j.common.saml.builder.SAML1Constants;
+import org.apache.wss4j.common.saml.builder.SAML2Constants;
import org.opensaml.common.SAMLVersion;
public class SamlCallbackHandler implements CallbackHandler
@@ -28,6 +29,8 @@
private String confirmationMethod = SAML2Constants.CONF_BEARER;
private boolean saml2;
+
+ private boolean signed;
public SamlCallbackHandler()
{
@@ -88,9 +91,21 @@
attributeBean.setSimpleName("subject-role");
attributeBean.setQualifiedName("http://custom-ns");
}
- attributeBean.setAttributeValues(Collections.singletonList("system-user"));
+
+ attributeBean.addAttributeValue("system-user");
attrBean.setSamlAttributes(Collections.singletonList(attributeBean));
callback.setAttributeStatementData(Collections.singletonList(attrBean));
+
+ try {
+ String file = "META-INF/alice.properties";
+ Crypto crypto = CryptoFactory.getInstance(file);
+ callback.setIssuerCrypto(crypto);
+ callback.setIssuerKeyName("alice");
+ callback.setIssuerKeyPassword("password");
+ callback.setSignAssertion(signed);
+ } catch (WSSecurityException e) {
+ throw new IOException(e);
+ }
}
}
}
@@ -119,4 +134,13 @@
return keyInfo;
}
+ public boolean isSigned()
+ {
+ return signed;
+ }
+
+ public void setSigned(boolean signed)
+ {
+ this.signed = signed;
+ }
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServerUsernamePasswordCallback.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServerUsernamePasswordCallback.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServerUsernamePasswordCallback.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,22 +21,22 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
-import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
-public class ServerUsernamePasswordCallback implements CallbackHandler
+public class ServerUsernamePasswordCallback extends PasswordCallbackHandler
{
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
- final String id = pc.getIdentifier();
- if ("kermit".equals(id))
- pc.setPassword("thefrog");
- else if ("alice".equals(id) || "bob".equals(id))
- pc.setPassword("password");
+ public ServerUsernamePasswordCallback() {
+ super(getInitMap());
}
+
+ private static Map<String, String> getInitMap() {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("kermit", "thefrog");
+ passwords.put("alice", "password");
+ passwords.put("bob", "password");
+ return passwords;
+ }
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -24,6 +24,8 @@
import javax.ejb.Stateless;
import javax.jws.WebService;
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
import org.jboss.ws.api.annotation.WebContext;
@WebService
@@ -35,6 +37,10 @@
endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
)
@Stateless
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.saml1.validator", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.SAMLValidator")
+ }
+)
@WebContext(urlPattern = "SecurityService2311")
public class Service2311Impl implements ServiceIface
{
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -41,6 +41,7 @@
@EndpointProperty(key = "ws-security.signature.username", value = "bob"),
@EndpointProperty(key = "ws-security.encryption.properties", value = "bob.properties"),
@EndpointProperty(key = "ws-security.encryption.username", value = "useReqSigCert"),
+ @EndpointProperty(key = "ws-security.saml2.validator", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.SAMLValidator"),
@EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.KeystorePasswordCallback")
}
)
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/UsernamePasswordCallback.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/UsernamePasswordCallback.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/UsernamePasswordCallback.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -26,8 +26,9 @@
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+
public class UsernamePasswordCallback implements CallbackHandler
{
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -60,22 +60,11 @@
System.setProperty("org.jboss.security.ignoreHttpsHost", "true");
*/
JBossWSCXFTestSetup setup = new JBossWSCXFTestSetup(WSSecurityPolicyExamples21xTestCase.class,
- "jaxws-samples-wsse-policy-oasis-21x.war,jaxws-samples-wsse-policy-oasis-client.jar");
+ DeploymentArchives.SERVER_21X_WAR + " " + DeploymentArchives.CLIENT_JAR);
Map<String, String> sslOptions = new HashMap<String, String>();
- if (isTargetJBoss7())
- {
- sslOptions.put("certificate-key-file", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
- sslOptions.put("password", "changeit");
- sslOptions.put("verify-client", "false");
- sslOptions.put("key-alias", "tomcat");
- }
- else
- {
- sslOptions.put("keystore-path", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
- sslOptions.put("keystore-password", "changeit");
- sslOptions.put("verify-client", "false");
- sslOptions.put("alias", "tomcat");
- }
+ sslOptions.put("server-identity.ssl.keystore-path", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
+ sslOptions.put("server-identity.ssl.keystore-password", "changeit");
+ sslOptions.put("server-identity.ssl.alias", "tomcat");
setup.setHttpsConnectorRequirement(sslOptions);
return setup;
}
@@ -89,9 +78,8 @@
{
Service service = Service.create(new URL(serviceURL + "SecurityService2111?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2111Port"), ServiceIface.class);
- setupWsse(proxy);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService2111").replaceFirst("8080", "7070"));
-
+ setupWsse(proxy, true);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService2111".replaceFirst("8080", "7070"));
assertTrue(proxy.sayHello().equals("Hello - UsernameToken with plain text password"));
}
@@ -104,9 +92,8 @@
{
Service service = Service.create(new URL(serviceURL + "SecurityService2112?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2112Port"), ServiceIface.class);
- setupWsse(proxy);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService2112").replaceFirst("8080", "7070"));
-
+ setupWsse(proxy, false);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService2112".replaceFirst("8080", "7070"));
assertTrue(proxy.sayHello().equals("Hello - UsernameToken without password"));
}
@@ -119,8 +106,8 @@
{
Service service = Service.create(new URL(serviceURL + "SecurityService2113?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2113Port"), ServiceIface.class);
- setupWsse(proxy);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService2113").replaceFirst("8080", "7070"));
+ setupWsse(proxy, true);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService2113".replaceFirst("8080", "7070"));
assertTrue(proxy.sayHello().equals("Hello - UsernameToken with timestamp, nonce and password hash"));
}
@@ -132,14 +119,9 @@
*/
public void test2121() throws Exception
{
- if (true) {
- System.out.println("FIXME: [JBWS-3622] Restore HTTPS tests w/ Undertow");
- return;
- }
Service service = Service.create(new URL(serviceURLHttps + "SecurityService2121?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2121Port"), ServiceIface.class);
- setupWsse(proxy);
-
+ setupWsse(proxy, false);
assertTrue(proxy.sayHello().equals("Hello - UsernameToken as supporting token"));
}
@@ -152,8 +134,8 @@
{
Service service = Service.create(new URL(serviceURL + "SecurityService213?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService213Port"), ServiceIface.class);
- setupWsse(proxy);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService213").replaceFirst("8080", "7070"));
+ setupWsse(proxy, true);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService213".replaceFirst("8080", "7070"));
assertTrue(proxy.sayHello().equals("Hello - (WSS 1.0) UsernameToken with Mutual X.509v3 Authentication, Sign, Encrypt"));
}
@@ -167,13 +149,13 @@
{
Service service = Service.create(new URL(serviceURL + "SecurityService214?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService214Port"), ServiceIface.class);
- setupWsse(proxy);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService214").replaceFirst("8080", "7070"));
+ setupWsse(proxy, false);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService214".replaceFirst("8080", "7070"));
assertTrue(proxy.sayHello().equals("Hello - (WSS 1.1) User Name with Certificates, Sign, Encrypt"));
}
- private void setupWsse(ServiceIface proxy)
+ private void setupWsse(ServiceIface proxy, boolean streaming)
{
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.USERNAME, "kermit");
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new UsernamePasswordCallback());
@@ -181,5 +163,10 @@
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME, "alice");
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_USERNAME, "bob");
+ if (streaming)
+ {
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
+ ((BindingProvider)proxy).getResponseContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
+ }
}
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -31,6 +31,7 @@
import org.apache.cxf.ws.security.SecurityConstants;
import org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -52,7 +53,7 @@
public static Test suite()
{
return new JBossWSCXFTestSetup(WSSecurityPolicyExamples22xTestCase.class,
- "jaxws-samples-wsse-policy-oasis-22x.war,jaxws-samples-wsse-policy-oasis-client.jar");
+ DeploymentArchives.SERVER_22X_WAR + " " + DeploymentArchives.CLIENT_JAR);
}
/**
@@ -67,10 +68,15 @@
{
Service service = Service.create(new URL(serviceURL + "SecurityService221?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService221Port"), ServiceIface.class);
- setupWsse(proxy);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService221").replaceFirst("8080", "7070"));
+ setupWsse(proxy, true);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService221".replaceFirst("8080", "7070"));
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) X.509 Certificates, Sign, Encrypt"));
+
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) X.509 Certificates, Sign, Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
/**
@@ -87,10 +93,14 @@
{
Service service = Service.create(new URL(serviceURL + "SecurityService222?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService222Port"), ServiceIface.class);
- setupWsse(proxy);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService222").replaceFirst("8080", "7070"));
+ setupWsse(proxy, true);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService222".replaceFirst("8080", "7070"));
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) Mutual Authentication with X.509 Certificates, Sign, Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) Mutual Authentication with X.509 Certificates, Sign, Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
/**
@@ -107,10 +117,14 @@
{
Service service = Service.create(new URL(serviceURL + "SecurityService223?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService223Port"), ServiceIface.class);
- setupWsse(proxy);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService223").replaceFirst("8080", "7070"));
+ setupWsse(proxy, true);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService223".replaceFirst("8080", "7070"));
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) Anonymous with X.509 Certificates, Sign, Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) Anonymous with X.509 Certificates, Sign, Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
/**
@@ -127,18 +141,27 @@
{
Service service = Service.create(new URL(serviceURL + "SecurityService224?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService224Port"), ServiceIface.class);
- setupWsse(proxy);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService224").replaceFirst("8080", "7070"));
+ setupWsse(proxy, false);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService224".replaceFirst("8080", "7070"));
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) Mutual Authentication with X.509 Certificates, Sign, Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) Mutual Authentication with X.509 Certificates, Sign, Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
- private void setupWsse(ServiceIface proxy)
+ private void setupWsse(ServiceIface proxy, boolean streaming)
{
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME, "alice");
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_USERNAME, "bob");
+ if (streaming)
+ {
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
+ ((BindingProvider)proxy).getResponseContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
+ }
}
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -32,6 +32,7 @@
import junit.framework.Test;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -63,27 +64,15 @@
System.setProperty("org.jboss.security.ignoreHttpsHost", "true");
*/
JBossWSCXFTestSetup setup = new JBossWSCXFTestSetup(WSSecurityPolicyExamples23xTestCase.class,
- "jaxws-samples-wsse-policy-oasis-23x.war,jaxws-samples-wsse-policy-oasis-client.jar");
+ DeploymentArchives.SERVER_23X_WAR + " " + DeploymentArchives.CLIENT_JAR);
Map<String, String> sslOptions = new HashMap<String, String>();
- if (isTargetJBoss7())
- {
- sslOptions.put("certificate-key-file", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
- sslOptions.put("password", "changeit");
- sslOptions.put("verify-client", "true"); //enable SSL mutual authentication (https client cert is checked on server side)
- sslOptions.put("key-alias", "tomcat");
- sslOptions.put("ca-certificate-file", System.getProperty("org.jboss.ws.testsuite.server.truststore"));
- sslOptions.put("ca-certificate-password", "changeit");
- }
- else
- {
- sslOptions.put("server-identity.ssl.keystore-path", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
- sslOptions.put("server-identity.ssl.keystore-password", "changeit");
- sslOptions.put("server-identity.ssl.alias", "tomcat");
- //enable SSL mutual authentication (https client cert is checked on server side)
- sslOptions.put("verify-client", "REQUESTED");
- sslOptions.put("authentication.truststore.keystore-path", System.getProperty("org.jboss.ws.testsuite.server.truststore"));
- sslOptions.put("authentication.truststore.keystore-password", "changeit");
- }
+ sslOptions.put("server-identity.ssl.keystore-path", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
+ sslOptions.put("server-identity.ssl.keystore-password", "changeit");
+ sslOptions.put("server-identity.ssl.alias", "tomcat");
+ //enable SSL mutual authentication (https client cert is checked on server side)
+ sslOptions.put("verify-client", "REQUESTED");
+ sslOptions.put("authentication.truststore.keystore-path", System.getProperty("org.jboss.ws.testsuite.server.truststore"));
+ sslOptions.put("authentication.truststore.keystore-password", "changeit");
setup.setHttpsConnectorRequirement(sslOptions);
return setup;
}
@@ -98,7 +87,7 @@
Service service = Service.create(new URL(serviceURL + "SecurityService2311?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2311Port"), ServiceIface.class);
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SAML_CALLBACK_HANDLER, new SamlCallbackHandler());
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService2311").replaceFirst("8080", "7070"));
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService2311".replaceFirst("8080", "7070"));
assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Assertion (Bearer)"));
}
@@ -130,11 +119,11 @@
Map<String, Object> reqCtx = ((BindingProvider) proxy).getRequestContext();
SamlCallbackHandler cbh = new SamlCallbackHandler();
cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:1.0:cm:holder-of-key");
+ cbh.setSigned(true);
reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
- reqCtx.put(SecurityConstants.SELF_SIGN_SAML_ASSERTION, "true");
assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Assertion (HK) over SSL"));
}
@@ -156,9 +145,13 @@
reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
- //((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService2314").replaceFirst("8080", "7070"));
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService2314".replaceFirst("8080", "7070"));
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Sender Vouches with X.509 Certificates, Sign, Optional Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Sender Vouches with X.509 Certificates, Sign, Optional Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
/**
@@ -171,18 +164,22 @@
Service service = Service.create(new URL(serviceURL + "SecurityService2315?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2315Port"), ServiceIface.class);
Map<String, Object> reqCtx = ((BindingProvider) proxy).getRequestContext();
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService2315").replaceFirst("8080", "7070"));
-
SamlCallbackHandler cbh = new SamlCallbackHandler();
cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:1.0:cm:holder-of-key");
+ cbh.setSigned(true);
reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
- reqCtx.put(SecurityConstants.SELF_SIGN_SAML_ASSERTION, "true");
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Holder of Key, Sign, Optional Encrypt"));
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService2315".replaceFirst("8080", "7070"));
+
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Holder of Key, Sign, Optional Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
/**
@@ -204,7 +201,7 @@
reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService2321").replaceFirst("8080", "7070"));
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService2321".replaceFirst("8080", "7070"));
assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML 2.0 Bearer"));
}
@@ -222,8 +219,6 @@
cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:2.0:cm:sender-vouches");
cbh.setSaml2(true);
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
- //((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURLHttps + "SecurityService2322").replaceFirst("8443", "7070"));
-
assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML2.0 Sender Vouches over SSL"));
}
@@ -240,12 +235,11 @@
SamlCallbackHandler cbh = new SamlCallbackHandler();
cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:2.0:cm:holder-of-key");
cbh.setSaml2(true);
+ cbh.setSigned(true);
reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
- reqCtx.put(SecurityConstants.SELF_SIGN_SAML_ASSERTION, "true");
-
assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML2.0 HoK over SSL"));
}
@@ -267,8 +261,12 @@
reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, (serviceURL + "SecurityService2324").replaceFirst("8080", "7070"));
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL + "SecurityService2324".replaceFirst("8080", "7070"));
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML1.1/2.0 Sender Vouches with X.509 Certificate, Sign, Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML1.1/2.0 Sender Vouches with X.509 Certificate, Sign, Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/KeystorePasswordCallback.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/KeystorePasswordCallback.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/KeystorePasswordCallback.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,51 +21,21 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.secconv;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
-
-public class KeystorePasswordCallback implements CallbackHandler
+public class KeystorePasswordCallback extends org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler
{
-
- private Map<String, String> passwords = new HashMap<String, String>();
-
public KeystorePasswordCallback()
{
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap() {
+ Map<String, String> passwords = new HashMap<String, String>();
passwords.put("alice", "password");
passwords.put("bob", "password");
passwords.put("john", "password");
+ return passwords;
}
-
- /**
- * It attempts to get the password from the private
- * alias/passwords map.
- */
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i = 0; i < callbacks.length; i++)
- {
- WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
-
- String pass = passwords.get(pc.getIdentifier());
- if (pass != null)
- {
- pc.setPassword(pass);
- return;
- }
- }
- }
-
- /**
- * Add an alias/password pair to the callback mechanism.
- */
- public void setAliasPassword(String alias, String password)
- {
- passwords.put(alias, password);
- }
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/SecureConversationTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/SecureConversationTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/SecureConversationTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,7 +21,10 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.secconv;
+import java.io.File;
import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
@@ -29,9 +32,13 @@
import junit.framework.Test;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
/**
* Secure Conversation testcase
@@ -46,32 +53,62 @@
*/
public final class SecureConversationTestCase extends JBossWSTest
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-secconv/SecureConversationService";
+ public static BaseDeployment<?>[] createDeployments() {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-secconv.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.secconv.KeystorePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.secconv.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.secconv.ServiceImpl.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/secconv/WEB-INF/bob.jks"), "classes/bob.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/secconv/WEB-INF/bob.properties"), "classes/bob.properties")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/secconv/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/secconv/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd");
+ }
+ });
+ list.add(new JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-secconv-client.jar") { {
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/secconv/META-INF/alice.jks"), "alice.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/secconv/META-INF/alice.properties"), "alice.properties");
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
public static Test suite()
{
- return new JBossWSCXFTestSetup(SecureConversationTestCase.class, "jaxws-samples-wsse-policy-secconv.war,jaxws-samples-wsse-policy-secconv-client.jar");
+ return new JBossWSCXFTestSetup(SecureConversationTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
}
public void test() throws Exception
{
QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
- URL wsdlURL = new URL(serviceURL + "?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-secconv/SecureConversationService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
- setupWsse(proxy);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
+ setupWsse(proxy, true);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":7070/jaxws-samples-wsse-policy-secconv/SecureConversationServic");
assertTrue(proxy.sayHello().startsWith("Secure Conversation Hello World!"));
assertTrue(proxy.sayHello().startsWith("Secure Conversation Hello World!"));
}
- private void setupWsse(ServiceIface proxy)
+ private void setupWsse(ServiceIface proxy, boolean streaming)
{
((BindingProvider)proxy).getRequestContext().put("ws-security.callback-handler.sct", new KeystorePasswordCallback());
((BindingProvider)proxy).getRequestContext().put("ws-security.signature.properties.sct", Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
((BindingProvider)proxy).getRequestContext().put("ws-security.encryption.properties.sct", Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
((BindingProvider)proxy).getRequestContext().put("ws-security.signature.username.sct", "alice");
((BindingProvider)proxy).getRequestContext().put("ws-security.encryption.username.sct", "bob");
+ if (streaming)
+ {
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
+ ((BindingProvider)proxy).getResponseContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
+ }
}
}
Deleted: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ClientCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ClientCallbackHandler.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ClientCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -1,50 +0,0 @@
-/**
- * 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.
- */
-package org.jboss.test.ws.jaxws.samples.wsse.policy.trust;
-
-import java.io.IOException;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
-
-public class ClientCallbackHandler implements CallbackHandler {
-
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- if (callbacks[i] instanceof WSPasswordCallback) {
- WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
- if ("myclientkey".equals(pc.getIdentifier())) {
- pc.setPassword("ckpass");
- break;
- } else if ("alice".equals(pc.getIdentifier())) {
- pc.setPassword("clarinet");
- break;
- } else if ("bob".equals(pc.getIdentifier())) {
- pc.setPassword("trombone");
- break;
- } else if ("eve".equals(pc.getIdentifier())) {
- pc.setPassword("evekpass");
- break;
- }
- }
- }
- }
-}
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/DeploymentArchives.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/DeploymentArchives.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/DeploymentArchives.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust;
+
+import java.io.File;
+
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.wsf.test.JBossWSTestHelper;
+
+public final class DeploymentArchives
+{
+ public static final String STS_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-sts.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl annotations\n")) //cxf impl required to extend STS impl
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.STSCallbackHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.SampleSTS.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ws-trust-1.4-service.wsdl"), "wsdl/ws-trust-1.4-service.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"), "classes/stsstore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"), "classes/stsKeystore.properties")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/web.xml"));
+ }
+ });
+
+ public static final String SERVER_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServerCallbackHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceImpl.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/servicestore.jks"), "classes/servicestore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/serviceKeystore.properties"), "classes/serviceKeystore.properties");
+ }
+ });
+
+ public static final String CLIENT_JAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-trust-client.jar") { {
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/META-INF/clientKeystore.properties"), "clientKeystore.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks"), "clientstore.jks");
+ }
+ });
+
+ public static final String SERVER_ACTAS_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-actas.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client, org.apache.cxf.impl\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsCallbackHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl"), "wsdl/ActAsService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd"), "wsdl/ActAsService_schema1.xsd")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks"), "classes/actasstore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties"), "classes/actasKeystore.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks"), "clientstore.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/META-INF/clientKeystore.properties"), "clientKeystore.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml"), "permissions.xml");
+ }
+ });
+
+ public static final String SERVER_ONBEHALFOF_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-onbehalfof.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client, org.apache.cxf.impl\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfCallbackHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService.wsdl"), "wsdl/OnBehalfOfService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd"), "wsdl/OnBehalfOfService_schema1.xsd")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks"), "classes/actasstore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties"), "classes/actasKeystore.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks"), "clientstore.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/META-INF/clientKeystore.properties"), "clientKeystore.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml"), "permissions.xml");
+ }
+ });
+
+ public static final String STS_HOLDEROFKEY_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-sts-holderofkey.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl annotations\n")) //cxf impl required to extend STS impl
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsholderofkey.STSHolderOfKeyCallbackHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsholderofkey.SampleSTSHolderOfKey.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/holderofkey-ws-trust-1.4-service.wsdl"), "wsdl/holderofkey-ws-trust-1.4-service.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"), "classes/stsstore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"), "classes/stsKeystore.properties")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/holderofkey/web.xml"));
+ }
+ });
+
+ public static final String SERVER_HOLDEROFKEY_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-holderofkey.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyCallbackHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyImpl.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService.wsdl"), "wsdl/HolderOfKeyService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService_schema1.xsd"), "wsdl/HolderOfKeyService_schema1.xsd")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/servicestore.jks"), "classes/servicestore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/serviceKeystore.properties"), "classes/serviceKeystore.properties");
+ }
+ });
+
+ public static final String STS_PICKETLINK_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trustPicketLink-sts.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,org.picketlink\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.picketlink.PicketLinkSTService.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.STSCallbackHandler.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl"), "wsdl/PicketLinkSTS.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"), "classes/stsstore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml"), "classes/picketlink-sts.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"), "classes/stsKeystore.properties");
+ }
+ });
+
+ public static final String STS_BEARER_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-sts-bearer.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl annotations\n")) //cxf impl required to extend STS impl
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsbearer.STSBearerCallbackHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsbearer.SampleSTSBearer.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/bearer-ws-trust-1.4-service.wsdl"), "wsdl/bearer-ws-trust-1.4-service.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"), "classes/stsstore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"), "classes/stsKeystore.properties")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/bearer/web.xml"));
+ }
+ });
+
+ public static final String SERVER_BEARER_WAR = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-bearer.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerIface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerImpl.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService.wsdl"), "wsdl/BearerService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService_schema1.xsd"), "wsdl/BearerService_schema1.xsd")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/servicestore.jks"), "classes/servicestore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/serviceKeystore.properties"), "classes/serviceKeystore.properties");
+ }
+ });
+
+ private DeploymentArchives() {
+ //NOOP
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/DeploymentArchives.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Deleted: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/STSCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/STSCallbackHandler.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/STSCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -1,41 +0,0 @@
-/**
- * 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.
- */
-package org.jboss.test.ws.jaxws.samples.wsse.policy.trust;
-
-import java.io.IOException;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
-
-public class STSCallbackHandler implements CallbackHandler {
-
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- if (callbacks[i] instanceof WSPasswordCallback) {
- WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
- if ("mystskey".equals(pc.getIdentifier())) {
- pc.setPassword("stskpass");
- break;
- }
- }
- }
- }
-}
Deleted: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust;
-
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.ws.WebServiceProvider;
-
-import org.apache.cxf.annotations.EndpointProperties;
-import org.apache.cxf.annotations.EndpointProperty;
-import org.apache.cxf.interceptor.InInterceptors;
-import org.apache.cxf.sts.StaticSTSProperties;
-import org.apache.cxf.sts.operation.TokenIssueOperation;
-import org.apache.cxf.sts.operation.TokenValidateOperation;
-import org.apache.cxf.sts.service.ServiceMBean;
-import org.apache.cxf.sts.service.StaticService;
-import org.apache.cxf.sts.token.provider.SAMLTokenProvider;
-import org.apache.cxf.sts.token.validator.SAMLTokenValidator;
-import org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider;
-
-@WebServiceProvider(serviceName = "SecurityTokenService",
- portName = "UT_Port",
- targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
- wsdlLocation = "WEB-INF/wsdl/ws-trust-1.4-service.wsdl")
-//be sure to have dependency on org.apache.cxf module when on AS7, otherwise Apache CXF annotations are ignored
-@EndpointProperties(value = {
- @EndpointProperty(key = "ws-security.signature.username", value = "mystskey"),
- @EndpointProperty(key = "ws-security.signature.properties", value = "stsKeystore.properties"),
- @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.STSCallbackHandler"),
- @EndpointProperty(key = "ws-security.validate.token", value = "false") //to let the JAAS integration deal with validation through the interceptor below
-})
-@InInterceptors(interceptors = {"org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor"})
-public class SampleSTS extends SecurityTokenServiceProvider
-{
- public SampleSTS() throws Exception
- {
- super();
-
- StaticSTSProperties props = new StaticSTSProperties();
- props.setSignaturePropertiesFile("stsKeystore.properties");
- props.setSignatureUsername("mystskey");
- props.setCallbackHandlerClass(STSCallbackHandler.class.getName());
- props.setIssuer("DoubleItSTSIssuer");
-
- List<ServiceMBean> services = new LinkedList<ServiceMBean>();
- StaticService service = new StaticService();
- service.setEndpoints(Arrays.asList("http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService", "http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService"));
- services.add(service);
-
- TokenIssueOperation issueOperation = new TokenIssueOperation();
- issueOperation.setServices(services);
- issueOperation.getTokenProviders().add(new SAMLTokenProvider());
- issueOperation.setStsProperties(props);
-
- TokenValidateOperation validateOperation = new TokenValidateOperation();
- validateOperation.getTokenValidators().add(new SAMLTokenValidator());
- validateOperation.setStsProperties(props);
-
- this.setIssueOperation(issueOperation);
- this.setValidateOperation(validateOperation);
- }
-}
Deleted: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ServerCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ServerCallbackHandler.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ServerCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -1,41 +0,0 @@
-/**
- * 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.
- */
-package org.jboss.test.ws.jaxws.samples.wsse.policy.trust;
-
-import java.io.IOException;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.ws.security.WSPasswordCallback;
-
-public class ServerCallbackHandler implements CallbackHandler {
-
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- if (callbacks[i] instanceof WSPasswordCallback) { // CXF
- WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
- if ("myservicekey".equals(pc.getIdentifier())) {
- pc.setPassword("skpass");
- break;
- }
- }
- }
- }
-}
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust;
+
+import junit.framework.Test;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsServiceIface;
+import org.jboss.wsf.test.JBossWSTest;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import java.net.URL;
+
+/**
+ * A demo of using WS-Trust ActAs extension.
+ *
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+public class WSTrustActAsTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trust-actas/ActAsService";
+
+ public static Test suite()
+ {
+ //deploy client, STS and service; start a security domain to be used by the STS for authenticating client
+ return WSTrustTestUtils.getTestSetup(WSTrustActAsTestCase.class,
+ DeploymentArchives.CLIENT_JAR + " " + DeploymentArchives.STS_WAR + " " + DeploymentArchives.SERVER_WAR + " " + DeploymentArchives.SERVER_ACTAS_WAR);
+ }
+
+ /**
+ * Request a security token that allows it to act as if it were somebody else.
+ *
+ * @throws Exception
+ */
+ public void testActAs() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy", "ActAsService");
+ final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ActAsServiceIface proxy = (ActAsServiceIface) service.getPort(ActAsServiceIface.class);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
+
+ WSTrustTestUtils.setupWsseAndSTSClientActAs((BindingProvider) proxy, bus);
+
+ assertEquals("ActAs WS-Trust Hello World!", proxy.sayHello());
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustBearerTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustBearerTestCase.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustBearerTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerIface;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * A demo of using SAML Bearer key type
+ *
+ * User: rsearls(a)redhat.com
+ * Date: 2/24/14
+ */
+public class WSTrustBearerTestCase extends JBossWSTest
+{
+ private final String serviceURL = "https://" + getServerHost() + ":8443/jaxws-samples-wsse-policy-trust-bearer/BearerService";
+
+ public static Test suite()
+ {
+ //deploy client, STS and service; start a security domain to be used by the STS for authenticating client
+ JBossWSCXFTestSetup testSetup = WSTrustTestUtils.getTestSetup(WSTrustBearerTestCase.class,
+ DeploymentArchives.CLIENT_JAR + " " + DeploymentArchives.STS_BEARER_WAR + " " + DeploymentArchives.SERVER_BEARER_WAR);
+
+ // setup the https connector in the server config file.
+ Map<String, String> sslOptions = new HashMap<String, String>();
+ sslOptions.put("server-identity.ssl.keystore-path", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
+ sslOptions.put("server-identity.ssl.keystore-password", "changeit");
+ sslOptions.put("server-identity.ssl.alias", "tomcat");
+ testSetup.setHttpsConnectorRequirement(sslOptions);
+ return testSetup;
+ }
+
+ public void testBearer() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypolicy", "BearerService");
+ Service service = Service.create(new URL(serviceURL + "?wsdl"), serviceName);
+ BearerIface proxy = (BearerIface) service.getPort(BearerIface.class);
+ WSTrustTestUtils.setupWsseAndSTSClientBearer((BindingProvider) proxy, bus);
+ assertEquals("Bearer WS-Trust Hello World!", proxy.sayHello());
+
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustBearerTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustHolderOfKeyTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustHolderOfKeyTestCase.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustHolderOfKeyTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyIface;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * A demo of using SAML Holder-of-key
+ *
+ * User: rsearls(a)redhat.com
+ * Date: 3/14/14
+ */
+public class WSTrustHolderOfKeyTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ //deploy client, STS and service; start a security domain to be used by the STS for authenticating client
+ JBossWSCXFTestSetup testSetup = WSTrustTestUtils.getTestSetup(WSTrustHolderOfKeyTestCase.class,
+ DeploymentArchives.CLIENT_JAR + " " + DeploymentArchives.STS_HOLDEROFKEY_WAR + " " + DeploymentArchives.SERVER_HOLDEROFKEY_WAR);
+
+ // setup the https connector in the server config file.
+ Map<String, String> sslOptions = new HashMap<String, String>();
+ sslOptions.put("server-identity.ssl.keystore-path", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
+ sslOptions.put("server-identity.ssl.keystore-password", "changeit");
+ sslOptions.put("server-identity.ssl.alias", "tomcat");
+
+ testSetup.setHttpsConnectorRequirement(sslOptions);
+ return testSetup;
+
+ }
+
+ public void testBearer() throws Exception
+ {
+
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecuritypolicy", "HolderOfKeyService");
+ final URL wsdlURL = new URL("https://" + getServerHost() + ":8443/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ HolderOfKeyIface proxy = (HolderOfKeyIface) service.getPort(HolderOfKeyIface.class);
+
+ WSTrustTestUtils.setupWsseAndSTSClientHolderOfKey((BindingProvider) proxy, bus);
+ assertEquals("Holder-Of-Key WS-Trust Hello World!", proxy.sayHello());
+
+ } finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustHolderOfKeyTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust;
+
+import junit.framework.Test;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfServiceIface;
+import org.jboss.wsf.test.JBossWSTest;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import java.net.URL;
+
+/**
+ * A demo of using WS-Trust ActAs extension.
+ *
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+public class WSTrustOnBehalfOfTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trust-onbehalfof/OnBehalfOfService";
+
+ public static Test suite()
+ {
+ //deploy client, STS and service; start a security domain to be used by the STS for authenticating client
+ return WSTrustTestUtils.getTestSetup(WSTrustOnBehalfOfTestCase.class,
+ DeploymentArchives.CLIENT_JAR + " " + DeploymentArchives.STS_WAR + " " + DeploymentArchives.SERVER_WAR + " " + DeploymentArchives.SERVER_ONBEHALFOF_WAR);
+ }
+
+ /**
+ * Request a security token that allows it to act on behalf of somebody else.
+ *
+ * @throws Exception
+ */
+ public void testOnBehalfOf() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/onbehalfofwssecuritypolicy", "OnBehalfOfService");
+ final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ OnBehalfOfServiceIface proxy = (OnBehalfOfServiceIface) service.getPort(OnBehalfOfServiceIface.class);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
+ /* TODO explain why this is not needed for setup and then remove
+ final QName stsServiceName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "SecurityTokenService");
+ final QName stsPortName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "UT_Port");
+ */
+ WSTrustTestUtils.setupWsseAndSTSClientOnBehalfOf((BindingProvider) proxy, bus);
+
+ assertEquals("OnBehalfOf WS-Trust Hello World!", proxy.sayHello());
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -31,7 +31,9 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface;
/**
* WS-Trust test case using PicketLink implementation of STS
@@ -41,14 +43,11 @@
*/
public final class WSTrustPicketLinkTestCase extends JBossWSTest
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trust/SecurityService";
- private final String stsURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trustPicketLink-sts/PicketLinkSTS";
-
public static Test suite()
{
//deploy client, STS and service; start a security domain to be used by the STS for authenticating client
return WSTrustTestUtils.getTestSetup(WSTrustPicketLinkTestCase.class,
- "jaxws-samples-wsse-policy-trust-client.jar jaxws-samples-wsse-policy-trustPicketLink-sts.war jaxws-samples-wsse-policy-trust.war");
+ DeploymentArchives.CLIENT_JAR + " " + DeploymentArchives.STS_PICKETLINK_WAR + " " + DeploymentArchives.SERVER_WAR);
}
public void test() throws Exception
@@ -59,16 +58,20 @@
BusFactory.setThreadDefaultBus(bus);
final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
- final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ final URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trust/SecurityService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
- ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trust/SecurityService".replaceFirst("8080", "7070"));
final QName stsServiceName = new QName("urn:picketlink:identity-federation:sts", "PicketLinkSTS");
final QName stsPortName = new QName("urn:picketlink:identity-federation:sts", "PicketLinkSTSPort");
- WSTrustTestUtils.setupWsseAndSTSClient(proxy, bus, stsURL + "?wsdl", stsServiceName, stsPortName);
+ WSTrustTestUtils.setupWsseAndSTSClient(proxy, bus, "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trustPicketLink-sts/PicketLinkSTS?wsdl",
+ stsServiceName, stsPortName);
- assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ try {
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
finally
{
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -31,7 +31,9 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface;
/**
* WS-Trust test case
@@ -50,7 +52,7 @@
{
//deploy client, STS and service; start a security domain to be used by the STS for authenticating client
return WSTrustTestUtils.getTestSetup(WSTrustTestCase.class,
- "jaxws-samples-wsse-policy-trust-client.jar jaxws-samples-wsse-policy-trust-sts.war jaxws-samples-wsse-policy-trust.war");
+ DeploymentArchives.CLIENT_JAR + " " + DeploymentArchives.STS_WAR + " " + DeploymentArchives.SERVER_WAR);
}
/**
@@ -70,12 +72,15 @@
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
-
final QName stsServiceName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "SecurityTokenService");
final QName stsPortName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "UT_Port");
WSTrustTestUtils.setupWsseAndSTSClient(proxy, bus, stsURL + "?wsdl", stsServiceName, stsPortName);
-
- assertEquals("WS-Trust Hello World!", proxy.sayHello());
+
+ try {
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
finally
{
@@ -99,15 +104,77 @@
final URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
+
+ WSTrustTestUtils.setupWsse(proxy, bus);
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
- WSTrustTestUtils.setupWsse(proxy, bus);
-
+ try {
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+ /**
+ * No CallbackHandler is provided in STSCLient. Username and password provided instead.
+ *
+ * @throws Exception
+ */
+ public void testNoClientCallback() throws Exception {
+ Bus bus = BusFactory.newInstance().createBus();
+ try {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+ final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
+
+ final QName stsServiceName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "SecurityTokenService");
+ final QName stsPortName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "UT_Port");
+ WSTrustTestUtils.setupWsseAndSTSClientNoCallbackHandler(proxy, bus, stsURL + "?wsdl", stsServiceName, stsPortName);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
+
assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ } finally {
+ bus.shutdown(true);
}
+ }
+
+ /**
+ * No SIGNATURE_USERNAME is provided to the service. Service will use the
+ * client's keystore alias in its place.
+ *
+ * @throws Exception
+ */
+ public void testNoSignatureUsername() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+ final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.replaceFirst("8080", "7070"));
+
+ final QName stsServiceName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "SecurityTokenService");
+ final QName stsPortName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "UT_Port");
+ WSTrustTestUtils.setupWsseAndSTSClientNoSignatureUsername(proxy, bus, stsURL + "?wsdl", stsServiceName, stsPortName);
+
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ }
finally
{
bus.shutdown(true);
}
}
+
}
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -21,18 +21,20 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.trust;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-
import org.apache.cxf.Bus;
import org.apache.cxf.ws.security.SecurityConstants;
import org.apache.cxf.ws.security.trust.STSClient;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.ClientCallbackHandler;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.UsernameTokenCallbackHandler;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTestHelper;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* Some client util methods for WS-Trust testcases
*
@@ -56,11 +58,39 @@
public static void setupWsseAndSTSClient(ServiceIface proxy, Bus bus, String stsWsdlLocation, QName stsService, QName stsPort)
{
Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
- ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
- ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
- ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
- ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myclientkey");
- ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
+ setServiceContextAttributes(ctx);
+ ctx.put(SecurityConstants.STS_CLIENT, createSTSClient(bus, stsWsdlLocation, stsService, stsPort));
+ }
+
+ public static void setupWsse(ServiceIface proxy, Bus bus)
+ {
+ Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
+ setServiceContextAttributes(ctx);
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.USERNAME), "alice");
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.CALLBACK_HANDLER), new ClientCallbackHandler());
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.ENCRYPT_PROPERTIES), Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.ENCRYPT_USERNAME), "mystskey");
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_USERNAME), "myclientkey");
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_PROPERTIES), Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO), "true");
+ }
+
+
+ /**
+ * A PASSWORD is provided in place of the ClientCallbackHandler in the
+ * STSClient. A USERNAME and PASSWORD is required by CXF in the msg.
+ *
+ * @param proxy
+ * @param bus
+ * @param stsWsdlLocation
+ * @param stsService
+ * @param stsPort
+ * @see org.apache.cxf.ws.security.SecurityConstants#PASSWORD
+ */
+ public static void setupWsseAndSTSClientNoCallbackHandler(ServiceIface proxy, Bus bus, String stsWsdlLocation, QName stsService, QName stsPort) {
+ Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
+ setServiceContextAttributes(ctx);
+
STSClient stsClient = new STSClient(bus);
if (stsWsdlLocation != null) {
stsClient.setWsdlLocation(stsWsdlLocation);
@@ -69,7 +99,7 @@
}
Map<String, Object> props = stsClient.getProperties();
props.put(SecurityConstants.USERNAME, "alice");
- props.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+ props.put(SecurityConstants.PASSWORD, "clarinet");
props.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
props.put(SecurityConstants.ENCRYPT_USERNAME, "mystskey");
props.put(SecurityConstants.STS_TOKEN_USERNAME, "myclientkey");
@@ -77,14 +107,106 @@
props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
ctx.put(SecurityConstants.STS_CLIENT, stsClient);
}
-
- public static void setupWsse(ServiceIface proxy, Bus bus)
- {
+
+ /**
+ * Uses the SIGNATURE_PROPERTIES keystore's "alias name" as the SIGNATURE_USERNAME when
+ * USERNAME and SIGNATURE_USERNAME is not provided.
+ *
+ * @param proxy
+ * @param bus
+ * @param stsWsdlLocation
+ * @param stsService
+ * @param stsPort
+ * @see org.apache.cxf.ws.security.SecurityConstants#SIGNATURE_PROPERTIES
+ */
+ public static void setupWsseAndSTSClientNoSignatureUsername(ServiceIface proxy, Bus bus, String stsWsdlLocation, QName stsService, QName stsPort) {
Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
+
+ ctx.put(SecurityConstants.STS_CLIENT, createSTSClient(bus, stsWsdlLocation, stsService, stsPort));
+ }
+
+ /**
+ * Request a security token that allows it to act as if it were somebody else.
+ *
+ * @param proxy
+ * @param bus
+ */
+ public static void setupWsseAndSTSClientActAs(BindingProvider proxy, Bus bus) {
+
+ Map<String, Object> ctx = proxy.getRequestContext();
+
+ ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+ ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myactaskey");
+ ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myclientkey");
+
+
+ UsernameTokenCallbackHandler ch = new UsernameTokenCallbackHandler();
+ String str = ch.getUsernameTokenString("alice","clarinet");
+
+ ctx.put(SecurityConstants.STS_TOKEN_ACT_AS, str);
+
+
+ STSClient stsClient = new STSClient(bus);
+ Map<String, Object> props = stsClient.getProperties();
+ props.put(SecurityConstants.USERNAME, "bob");
+ props.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+ props.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ props.put(SecurityConstants.ENCRYPT_USERNAME, "mystskey");
+ props.put(SecurityConstants.STS_TOKEN_USERNAME, "myclientkey");
+ props.put(SecurityConstants.STS_TOKEN_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
+
+ ctx.put(SecurityConstants.STS_CLIENT, stsClient);
+ }
+
+ /**
+ * Request a security token that allows it to act on the behalf of somebody else.
+ *
+ * @param proxy
+ * @param bus
+ */
+ public static void setupWsseAndSTSClientOnBehalfOf(BindingProvider proxy, Bus bus) {
+
+ Map<String, Object> ctx = proxy.getRequestContext();
+
+ ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+ ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myactaskey");
+ ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myclientkey");
+ ctx.put(SecurityConstants.USERNAME,"alice");
+ ctx.put(SecurityConstants.PASSWORD, "clarinet");
+
+ STSClient stsClient = new STSClient(bus);
+ stsClient.setOnBehalfOf(new UsernameTokenCallbackHandler());
+
+ Map<String, Object> props = stsClient.getProperties();
+ props.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+ props.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ props.put(SecurityConstants.ENCRYPT_USERNAME, "mystskey");
+ props.put(SecurityConstants.STS_TOKEN_USERNAME, "myclientkey");
+ props.put(SecurityConstants.STS_TOKEN_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
+
+ ctx.put(SecurityConstants.STS_CLIENT, stsClient);
+ }
+
+ public static void setupWsseAndSTSClientBearer(BindingProvider proxy, Bus bus) {
+
+ Map<String, Object> ctx = proxy.getRequestContext();
+
+ STSClient stsClient = new STSClient(bus);
+
+ ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+ ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myclientkey");
ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
ctx.put(appendIssuedTokenSuffix(SecurityConstants.USERNAME), "alice");
ctx.put(appendIssuedTokenSuffix(SecurityConstants.CALLBACK_HANDLER), new ClientCallbackHandler());
@@ -93,10 +215,73 @@
ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_USERNAME), "myclientkey");
ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_PROPERTIES), Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO), "true");
+
+ ctx.put(SecurityConstants.STS_CLIENT, stsClient);
}
-
+
+ public static void setupWsseAndSTSClientHolderOfKey(BindingProvider proxy, Bus bus) {
+
+ Map<String, Object> ctx = proxy.getRequestContext();
+
+ STSClient stsClient = new STSClient(bus);
+
+ ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+ ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myclientkey");
+ ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.USERNAME), "alice");
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.CALLBACK_HANDLER), new ClientCallbackHandler());
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.ENCRYPT_PROPERTIES), Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.ENCRYPT_USERNAME), "mystskey");
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_USERNAME), "myclientkey");
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_PROPERTIES), Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO), "true");
+
+ ctx.put(SecurityConstants.STS_CLIENT, stsClient);
+ }
+
private static String appendIssuedTokenSuffix(String prop)
{
return prop + ".it";
}
+
+ /**
+ * Create and configure an STSClient for use by service ServiceImpl.
+ *
+ * Whenever an "<sp:IssuedToken>" policy is configured on a WSDL port, as is the
+ * case for ServiceImpl, a STSClient must be created and configured in
+ * order for the service to connect to the STS-server to obtain a token.
+ *
+ * @param bus
+ * @param stsWsdlLocation
+ * @param stsService
+ * @param stsPort
+ * @return
+ */
+ private static STSClient createSTSClient(Bus bus, String stsWsdlLocation, QName stsService, QName stsPort){
+ STSClient stsClient = new STSClient(bus);
+ if (stsWsdlLocation != null) {
+ stsClient.setWsdlLocation(stsWsdlLocation);
+ stsClient.setServiceQName(stsService);
+ stsClient.setEndpointQName(stsPort);
+ }
+ Map<String, Object> props = stsClient.getProperties();
+ props.put(SecurityConstants.USERNAME, "alice");
+ props.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+ props.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ props.put(SecurityConstants.ENCRYPT_USERNAME, "mystskey");
+ props.put(SecurityConstants.STS_TOKEN_USERNAME, "myclientkey");
+ props.put(SecurityConstants.STS_TOKEN_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
+ return stsClient;
+ }
+
+ private static void setServiceContextAttributes(Map<String, Object> ctx){
+ ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+ ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myclientkey");
+ ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
+ }
}
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsCallbackHandler.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,44 @@
+/**
+ * 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.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas;
+
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+public class ActAsCallbackHandler extends PasswordCallbackHandler {
+
+ public ActAsCallbackHandler()
+ {
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap()
+ {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("myactaskey", "aspass");
+ passwords.put("alice", "clarinet");
+ return passwords;
+ }
+
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsCallbackHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceIface.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceIface.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceIface.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.actas;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+/**
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy"
+)
+public interface ActAsServiceIface
+{
+ @WebMethod
+ String sayHello();
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceIface.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceImpl.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceImpl.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceImpl.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.actas;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.cxf.ws.security.trust.STSClient;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils;
+
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Map;
+
+/**
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+
+@WebService
+(
+ portName = "ActAsServicePort",
+ serviceName = "ActAsService",
+ wsdlLocation = "WEB-INF/wsdl/ActAsService.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsServiceIface"
+)
+
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.username", value = "myactaskey"),
+ @EndpointProperty(key = "ws-security.signature.properties", value = "actasKeystore.properties"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "actasKeystore.properties"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsCallbackHandler")
+})
+
+public class ActAsServiceImpl implements ActAsServiceIface
+{
+ public String sayHello() {
+ Bus bus = BusFactory.newInstance().createBus();
+ try {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final String serviceURL = "http://" + WSTrustAppUtils.getServerHost() + ":8080/jaxws-samples-wsse-policy-trust/SecurityService";
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+ final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
+
+ Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
+ ctx.put(SecurityConstants.CALLBACK_HANDLER, new ActAsCallbackHandler());
+
+ ctx.put(SecurityConstants.SIGNATURE_PROPERTIES,
+ Thread.currentThread().getContextClassLoader().getResource("actasKeystore.properties" ));
+ ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myactaskey" );
+ ctx.put(SecurityConstants.ENCRYPT_PROPERTIES,
+ Thread.currentThread().getContextClassLoader().getResource("../../META-INF/clientKeystore.properties" ));
+ ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
+
+ STSClient stsClient = new STSClient(bus);
+ Map<String, Object> props = stsClient.getProperties();
+ props.put(SecurityConstants.USERNAME, "alice");
+ props.put(SecurityConstants.ENCRYPT_USERNAME, "mystskey");
+ props.put(SecurityConstants.STS_TOKEN_USERNAME, "myactaskey" );
+ props.put(SecurityConstants.STS_TOKEN_PROPERTIES,
+ Thread.currentThread().getContextClassLoader().getResource("actasKeystore.properties" ));
+ props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
+
+ ctx.put(SecurityConstants.STS_CLIENT, stsClient);
+
+ return "ActAs " + proxy.sayHello();
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ return null;
+ } finally {
+ bus.shutdown(true);
+ }
+ }
+
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/BearerIface.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/BearerIface.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/BearerIface.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.bearer;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypolicy"
+)
+public interface BearerIface
+{
+ @WebMethod
+ String sayHello();
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/BearerIface.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/BearerImpl.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/BearerImpl.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/BearerImpl.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.bearer;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+
+import javax.jws.WebService;
+
+@WebService
+(
+ portName = "BearerServicePort",
+ serviceName = "BearerService",
+ wsdlLocation = "WEB-INF/wsdl/BearerService.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypolicy",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value = "serviceKeystore.properties")
+})
+public class BearerImpl implements BearerIface
+{
+ public String sayHello()
+ {
+ return "Bearer WS-Trust Hello World!";
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/bearer/BearerImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyCallbackHandler.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.holderofkey;
+
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * User: rsearls
+ * Date: 3/14/14
+ */
+public class HolderOfKeyCallbackHandler extends PasswordCallbackHandler {
+
+ public HolderOfKeyCallbackHandler()
+ {
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap()
+ {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("myservicekey", "skpass");
+ return passwords;
+ }
+}
+
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyCallbackHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyIface.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyIface.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyIface.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.holderofkey;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecuritypolicy"
+)
+public interface HolderOfKeyIface {
+ @WebMethod
+ String sayHello();
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyIface.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyImpl.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyImpl.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyImpl.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.holderofkey;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+
+import javax.jws.WebService;
+
+@WebService
+ (
+ portName = "HolderOfKeyServicePort",
+ serviceName = "HolderOfKeyService",
+ wsdlLocation = "WEB-INF/wsdl/HolderOfKeyService.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecuritypolicy",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyIface"
+ )
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.is-bsp-compliant", value = "false"),
+ @EndpointProperty(key = "ws-security.signature.properties", value = "serviceKeystore.properties"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyCallbackHandler")
+})
+public class HolderOfKeyImpl implements HolderOfKeyIface
+{
+ public String sayHello()
+ {
+ return "Holder-Of-Key WS-Trust Hello World!";
+ }
+}
\ No newline at end of file
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/holderofkey/HolderOfKeyImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfCallbackHandler.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,67 @@
+/**
+ * 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.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof;
+
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
+
+import java.util.HashMap;
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.
+ */
+import java.util.Map;
+
+/**
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+public class OnBehalfOfCallbackHandler extends PasswordCallbackHandler {
+
+ public OnBehalfOfCallbackHandler()
+ {
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap()
+ {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("myactaskey", "aspass");
+ passwords.put("alice", "clarinet");
+ passwords.put("bob", "trombone");
+ return passwords;
+ }
+
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfCallbackHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceIface.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceIface.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceIface.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+/**
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/onbehalfofwssecuritypolicy"
+)
+public interface OnBehalfOfServiceIface
+{
+ @WebMethod
+ String sayHello();
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceIface.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceImpl.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceImpl.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceImpl.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.cxf.ws.security.trust.STSClient;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils;
+
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import java.net.*;
+import java.util.Map;
+
+/**
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+
+@WebService
+(
+ portName = "OnBehalfOfServicePort",
+ serviceName = "OnBehalfOfService",
+ wsdlLocation = "WEB-INF/wsdl/OnBehalfOfService.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/onbehalfofwssecuritypolicy",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfServiceIface"
+)
+
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.username", value = "myactaskey"),
+ @EndpointProperty(key = "ws-security.signature.properties", value = "actasKeystore.properties"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "actasKeystore.properties"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfCallbackHandler")
+})
+
+public class OnBehalfOfServiceImpl implements OnBehalfOfServiceIface
+{
+ public String sayHello() {
+ Bus bus = BusFactory.newInstance().createBus();
+ try {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final String serviceURL = "http://" + WSTrustAppUtils.getServerHost() + ":8080/jaxws-samples-wsse-policy-trust/SecurityService";
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+ final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
+
+ Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
+ ctx.put(SecurityConstants.CALLBACK_HANDLER, new OnBehalfOfCallbackHandler());
+
+ ctx.put(SecurityConstants.SIGNATURE_PROPERTIES,
+ Thread.currentThread().getContextClassLoader().getResource("actasKeystore.properties" ));
+ ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myactaskey" );
+ ctx.put(SecurityConstants.ENCRYPT_PROPERTIES,
+ Thread.currentThread().getContextClassLoader().getResource("../../META-INF/clientKeystore.properties" ));
+ ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
+
+ STSClient stsClient = new STSClient(bus);
+ Map<String, Object> props = stsClient.getProperties();
+ props.put(SecurityConstants.USERNAME, "bob"); //-rls test
+ props.put(SecurityConstants.ENCRYPT_USERNAME, "mystskey");
+ props.put(SecurityConstants.STS_TOKEN_USERNAME, "myactaskey" );
+ props.put(SecurityConstants.STS_TOKEN_PROPERTIES,
+ Thread.currentThread().getContextClassLoader().getResource("actasKeystore.properties" ));
+ props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
+
+ ctx.put(SecurityConstants.STS_CLIENT, stsClient);
+
+ return "OnBehalfOf " + proxy.sayHello();
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ return null;
+ } finally {
+ bus.shutdown(true);
+ }
+ }
+
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/picketlink/PicketLinkSTService.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/picketlink/PicketLinkSTService.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/picketlink/PicketLinkSTService.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.picketlink;
+
+import javax.annotation.Resource;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceProvider;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.apache.cxf.interceptor.InInterceptors;
+import org.picketlink.identity.federation.core.wstrust.PicketLinkSTS;
+
+/**
+ * A Security Token Service implementation extending default PicketLink one
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ * @author <a href="mailto:pskopek@redhat.com">Peter Skopek</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
+ */
+@WebServiceProvider(serviceName = "PicketLinkSTS", portName = "PicketLinkSTSPort", targetNamespace = "urn:picketlink:identity-federation:sts", wsdlLocation = "WEB-INF/wsdl/PicketLinkSTS.wsdl")
+@ServiceMode(value = Service.Mode.MESSAGE)
+//be sure to have dependency on org.apache.cxf module when on AS7, otherwise Apache CXF annotations are ignored
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.username", value = "mystskey"),
+ @EndpointProperty(key = "ws-security.signature.properties", value = "stsKeystore.properties"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.STSCallbackHandler"),
+ @EndpointProperty(key = "ws-security.validate.token", value = "false") //to let the JAAS integration deal with validation through the interceptor below
+})
+@InInterceptors(interceptors = {"org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor"})
+public class PicketLinkSTService extends PicketLinkSTS
+{
+ @Resource
+ public void setWSC(WebServiceContext wctx) {
+ this.context = wctx;
+ }
+
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/picketlink/PicketLinkSTService.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServerCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServerCallbackHandler.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServerCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,40 @@
+/**
+ * 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.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
+
+public class ServerCallbackHandler extends PasswordCallbackHandler
+{
+
+ public ServerCallbackHandler()
+ {
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap()
+ {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("myservicekey", "skpass");
+ return passwords;
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServerCallbackHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServiceIface.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServiceIface.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServiceIface.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.service;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+)
+public interface ServiceIface
+{
+ @WebMethod
+ String sayHello();
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServiceIface.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServiceImpl.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServiceImpl.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServiceImpl.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.service;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+
+@WebService
+(
+ portName = "SecurityServicePort",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.username", value = "myservicekey"),
+ @EndpointProperty(key = "ws-security.signature.properties", value = "serviceKeystore.properties"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "serviceKeystore.properties"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServerCallbackHandler")
+})
+public class ServiceImpl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "WS-Trust Hello World!";
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/service/ServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/ClientCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/ClientCallbackHandler.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/ClientCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,51 @@
+/**
+ * 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.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared;
+
+import java.io.IOException;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+
+public class ClientCallbackHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ if (callbacks[i] instanceof WSPasswordCallback) {
+ WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
+ if ("myclientkey".equals(pc.getIdentifier())) {
+ pc.setPassword("ckpass");
+ break;
+ } else if ("alice".equals(pc.getIdentifier())) {
+ pc.setPassword("clarinet");
+ break;
+ } else if ("bob".equals(pc.getIdentifier())) {
+ pc.setPassword("trombone");
+ break;
+ } else if ("myservicekey".equals(pc.getIdentifier())) { // rls test added for bearer test
+ pc.setPassword("skpass");
+ break;
+ }
+ }
+ }
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/ClientCallbackHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/UsernameTokenCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/UsernameTokenCallbackHandler.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/UsernameTokenCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,183 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.shared;
+
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.cxf.ws.security.trust.delegation.DelegationCallback;
+import org.apache.wss4j.dom.WSConstants;
+import org.apache.wss4j.dom.message.token.UsernameToken;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.Element;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSSerializer;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * A utility to provide the 3 different input parameter types for jaxws property
+ * "ws-security.sts.token.act-as" and "ws-security.sts.token.on-behalf-of".
+ * This implementation obtains a username and password via the jaxws property
+ * "ws-security.username" and "ws-security.password" respectively, as defined
+ * in SecurityConstants. It creates a wss UsernameToken to be used as the
+ * delegation token.
+ *
+ * User: rsearls
+ * Date: 2/3/14
+ */
+
+public class UsernameTokenCallbackHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks)
+ throws IOException, UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ if (callbacks[i] instanceof DelegationCallback) {
+ DelegationCallback callback = (DelegationCallback) callbacks[i];
+ Message message = callback.getCurrentMessage();
+
+ String username =
+ (String)message.getContextualProperty(SecurityConstants.USERNAME);
+ String password =
+ (String)message.getContextualProperty(SecurityConstants.PASSWORD);
+ if (username != null) {
+ Node contentNode = message.getContent(Node.class);
+ Document doc = null;
+ if (contentNode != null) {
+ doc = contentNode.getOwnerDocument();
+ } else {
+ doc = DOMUtils.createDocument();
+ }
+ UsernameToken usernameToken = createWSSEUsernameToken(username,password, doc);
+ callback.setToken(usernameToken.getElement());
+ }
+ } else {
+ throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
+ }
+ }
+ }
+
+ /**
+ * Provide UsernameToken as a string.
+ * @param ctx
+ * @return
+ */
+ public String getUsernameTokenString(Map<String, Object> ctx){
+ Document doc = DOMUtils.createDocument();
+ String result = null;
+ String username = (String)ctx.get(SecurityConstants.USERNAME);
+ String password = (String)ctx.get(SecurityConstants.PASSWORD);
+ if (username != null) {
+ UsernameToken usernameToken = createWSSEUsernameToken(username,password, doc);
+ result = toString(usernameToken.getElement().getFirstChild().getParentNode());
+ }
+ return result;
+ }
+
+ /**
+ *
+ * @param username
+ * @param password
+ * @return
+ */
+ public String getUsernameTokenString(String username, String password){
+ Document doc = DOMUtils.createDocument();
+ String result = null;
+ if (username != null) {
+ UsernameToken usernameToken = createWSSEUsernameToken(username,password, doc);
+ result = toString(usernameToken.getElement().getFirstChild().getParentNode());
+ }
+ return result;
+ }
+
+ /**
+ * Provide UsernameToken as a DOM Element.
+ * @param ctx
+ * @return
+ */
+ public Element getUsernameTokenElement(Map<String, Object> ctx){
+ Document doc = DOMUtils.createDocument();
+ Element result = null;
+ UsernameToken usernameToken = null;
+ String username = (String)ctx.get(SecurityConstants.USERNAME);
+ String password = (String)ctx.get(SecurityConstants.PASSWORD);
+ if (username != null) {
+ usernameToken = createWSSEUsernameToken(username,password, doc);
+ result = usernameToken.getElement();
+ }
+ return result;
+ }
+
+ /**
+ *
+ * @param username
+ * @param password
+ * @return
+ */
+ public Element getUsernameTokenElement(String username, String password){
+ Document doc = DOMUtils.createDocument();
+ Element result = null;
+ UsernameToken usernameToken = null;
+ if (username != null) {
+ usernameToken = createWSSEUsernameToken(username,password, doc);
+ result = usernameToken.getElement();
+ }
+ return result;
+ }
+
+ private UsernameToken createWSSEUsernameToken(String username, String password, Document doc) {
+
+ UsernameToken usernameToken = new UsernameToken(true, doc,
+ (password == null)? null: WSConstants.PASSWORD_TEXT);
+ usernameToken.setName(username);
+ usernameToken.addWSUNamespace();
+ usernameToken.addWSSENamespace();
+ usernameToken.setID("id-" + username);
+
+ if (password != null){
+ usernameToken.setPassword(password);
+ }
+
+ return usernameToken;
+ }
+
+
+ private String toString(Node node) {
+ String str = null;
+
+ if (node != null) {
+ DOMImplementationLS lsImpl = (DOMImplementationLS)
+ node.getOwnerDocument().getImplementation().getFeature("LS", "3.0");
+ LSSerializer serializer = lsImpl.createLSSerializer();
+ serializer.getDomConfig().setParameter("xml-declaration", false); //by default its true, so set it to false to get String without xml-declaration
+ str = serializer.writeToString(node);
+ //System.out.println("@@UT: " + str);
+ }
+ return str;
+ }
+
+}
\ No newline at end of file
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/UsernameTokenCallbackHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.shared;
+
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+/**
+ *
+ * User: rsearls
+ * Date: 2/5/14
+ */
+public class WSTrustAppUtils {
+
+ public static String getServerHost() {
+ final String host = System.getProperty("jboss.bind.address", "localhost");
+ return toIPv6URLFormat(host);
+ }
+
+ private static String toIPv6URLFormat(final String host)
+ {
+ try
+ {
+ if (host.startsWith("[") || host.startsWith(":"))
+ {
+ if (System.getProperty("java.net.preferIPv4Stack") == null)
+ {
+ throw new IllegalStateException("always provide java.net.preferIPv4Stack JVM property when using IPv6 address format");
+ }
+ if (System.getProperty("java.net.preferIPv6Addresses") == null)
+ {
+ throw new IllegalStateException("always provide java.net.preferIPv6Addresses JVM property when using IPv6 address format");
+ }
+ }
+ final boolean isIPv6Address = InetAddress.getByName(host) instanceof Inet6Address;
+ final boolean isIPv6Formatted = isIPv6Address && host.startsWith("[");
+ return isIPv6Address && !isIPv6Formatted ? "[" + host + "]" : host;
+ }
+ catch (final UnknownHostException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/STSCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/STSCallbackHandler.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/STSCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.sts;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
+
+public class STSCallbackHandler extends PasswordCallbackHandler
+{
+ public STSCallbackHandler()
+ {
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap()
+ {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("mystskey", "stskpass");
+ passwords.put("alice", "clarinet");
+ return passwords;
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/STSCallbackHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/SampleSTS.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/SampleSTS.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/SampleSTS.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.sts;
+
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.ws.WebServiceProvider;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.apache.cxf.interceptor.InInterceptors;
+import org.apache.cxf.sts.StaticSTSProperties;
+import org.apache.cxf.sts.operation.TokenIssueOperation;
+import org.apache.cxf.sts.operation.TokenValidateOperation;
+import org.apache.cxf.sts.service.ServiceMBean;
+import org.apache.cxf.sts.service.StaticService;
+import org.apache.cxf.sts.token.delegation.UsernameTokenDelegationHandler;
+import org.apache.cxf.sts.token.provider.SAMLTokenProvider;
+import org.apache.cxf.sts.token.validator.SAMLTokenValidator;
+import org.apache.cxf.sts.token.validator.UsernameTokenValidator;
+import org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider;
+
+@WebServiceProvider(serviceName = "SecurityTokenService",
+ portName = "UT_Port",
+ targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
+ wsdlLocation = "WEB-INF/wsdl/ws-trust-1.4-service.wsdl")
+//be sure to have dependency on org.apache.cxf module when on AS7, otherwise Apache CXF annotations are ignored
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.username", value = "mystskey"),
+ @EndpointProperty(key = "ws-security.signature.properties", value = "stsKeystore.properties"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.STSCallbackHandler"),
+ @EndpointProperty(key = "ws-security.validate.token", value = "false") //to let the JAAS integration deal with validation through the interceptor below
+})
+@InInterceptors(interceptors = {"org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor"})
+public class SampleSTS extends SecurityTokenServiceProvider
+{
+ public SampleSTS() throws Exception
+ {
+ super();
+
+ StaticSTSProperties props = new StaticSTSProperties();
+ props.setSignatureCryptoProperties("stsKeystore.properties");
+ props.setSignatureUsername("mystskey");
+ props.setCallbackHandlerClass(STSCallbackHandler.class.getName());
+ props.setIssuer("DoubleItSTSIssuer");
+
+ List<ServiceMBean> services = new LinkedList<ServiceMBean>();
+ StaticService service = new StaticService();
+ service.setEndpoints(Arrays.asList(
+ "http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
+ "http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
+ "http://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
+
+ "http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust-actas/ActAsService",
+ "http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-actas/ActAsService",
+ "http://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-actas/ActAsService",
+
+ "http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust-onbehalfof/OnBeha...",
+ "http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-onbehalfof/OnBehalfOfService",
+ "http://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-onbehalfof/OnBehalfOfService"
+ ));
+ services.add(service);
+
+ TokenIssueOperation issueOperation = new TokenIssueOperation();
+ issueOperation.setServices(services);
+ issueOperation.getTokenProviders().add(new SAMLTokenProvider());
+ // required for OnBehalfOf
+ issueOperation.getTokenValidators().add(new UsernameTokenValidator());
+ // added for OnBehalfOf and ActAs
+ issueOperation.getDelegationHandlers().add(new UsernameTokenDelegationHandler());
+ issueOperation.setStsProperties(props);
+
+ TokenValidateOperation validateOperation = new TokenValidateOperation();
+ validateOperation.getTokenValidators().add(new SAMLTokenValidator());
+ validateOperation.setStsProperties(props);
+
+ this.setIssueOperation(issueOperation);
+ this.setValidateOperation(validateOperation);
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/SampleSTS.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/STSBearerCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/STSBearerCallbackHandler.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/STSBearerCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.stsbearer;
+
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class STSBearerCallbackHandler extends PasswordCallbackHandler
+{
+ public STSBearerCallbackHandler()
+ {
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap()
+ {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("mystskey", "stskpass");
+ passwords.put("alice", "clarinet");
+ return passwords;
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/STSBearerCallbackHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/SampleSTSBearer.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/SampleSTSBearer.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/SampleSTSBearer.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.stsbearer;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.apache.cxf.sts.StaticSTSProperties;
+import org.apache.cxf.sts.operation.TokenIssueOperation;
+import org.apache.cxf.sts.service.ServiceMBean;
+import org.apache.cxf.sts.service.StaticService;
+import org.apache.cxf.sts.token.provider.SAMLTokenProvider;
+import org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider;
+
+import javax.xml.ws.WebServiceProvider;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+@WebServiceProvider(serviceName = "SecurityTokenService",
+ portName = "UT_Port",
+ targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
+ wsdlLocation = "WEB-INF/wsdl/bearer-ws-trust-1.4-service.wsdl")
+//be sure to have dependency on org.apache.cxf module when on AS7, otherwise Apache CXF annotations are ignored
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.username", value = "mystskey"),
+ @EndpointProperty(key = "ws-security.signature.properties", value = "stsKeystore.properties"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsbearer.STSBearerCallbackHandler")
+})
+public class SampleSTSBearer extends SecurityTokenServiceProvider
+{
+
+ public SampleSTSBearer() throws Exception
+ {
+ super();
+
+ StaticSTSProperties props = new StaticSTSProperties();
+ props.setSignatureCryptoProperties("stsKeystore.properties");
+ props.setSignatureUsername("mystskey");
+ props.setCallbackHandlerClass(STSBearerCallbackHandler.class.getName());
+ props.setEncryptionCryptoProperties("stsKeystore.properties");
+ props.setEncryptionUsername("myservicekey");
+ props.setIssuer("DoubleItSTSIssuer");
+
+ List<ServiceMBean> services = new LinkedList<ServiceMBean>();
+ StaticService service = new StaticService();
+ service.setEndpoints(Arrays.asList(
+ "https://localhost:(\\d)*/jaxws-samples-wsse-policy-trust-bearer/BearerSer...",
+ "https://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-bearer/BearerService",
+ "https://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-bearer/BearerService"
+ ));
+ services.add(service);
+
+ TokenIssueOperation issueOperation = new TokenIssueOperation();
+ issueOperation.getTokenProviders().add(new SAMLTokenProvider());
+ issueOperation.setServices(services);
+ issueOperation.setStsProperties(props);
+ this.setIssueOperation(issueOperation);
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/SampleSTSBearer.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/STSHolderOfKeyCallbackHandler.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/STSHolderOfKeyCallbackHandler.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/STSHolderOfKeyCallbackHandler.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,26 @@
+package org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsholderofkey;
+
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * User: rsearls
+ * Date: 3/19/14
+ */
+public class STSHolderOfKeyCallbackHandler extends PasswordCallbackHandler
+{
+ public STSHolderOfKeyCallbackHandler()
+ {
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap()
+ {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("mystskey", "stskpass");
+ passwords.put("alice", "clarinet");
+ return passwords;
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/STSHolderOfKeyCallbackHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/SampleSTSHolderOfKey.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/SampleSTSHolderOfKey.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/SampleSTSHolderOfKey.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsse.policy.trust.stsholderofkey;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.apache.cxf.sts.StaticSTSProperties;
+import org.apache.cxf.sts.operation.TokenIssueOperation;
+import org.apache.cxf.sts.service.ServiceMBean;
+import org.apache.cxf.sts.service.StaticService;
+import org.apache.cxf.sts.token.provider.SAMLTokenProvider;
+import org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider;
+
+import javax.xml.ws.WebServiceProvider;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * User: rsearls
+ * Date: 3/14/14
+ */
+@WebServiceProvider(serviceName = "SecurityTokenService",
+ portName = "UT_Port",
+ targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
+ wsdlLocation = "WEB-INF/wsdl/holderofkey-ws-trust-1.4-service.wsdl")
+//be sure to have dependency on org.apache.cxf module when on AS7, otherwise Apache CXF annotations are ignored
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value = "stsKeystore.properties"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsholderofkey.STSHolderOfKeyCallbackHandler")
+})
+public class SampleSTSHolderOfKey extends SecurityTokenServiceProvider
+{
+
+ public SampleSTSHolderOfKey() throws Exception
+ {
+ super();
+
+ StaticSTSProperties props = new StaticSTSProperties();
+ props.setSignatureCryptoProperties("stsKeystore.properties");
+ props.setSignatureUsername("mystskey");
+ props.setCallbackHandlerClass(STSHolderOfKeyCallbackHandler.class.getName());
+ props.setEncryptionCryptoProperties("stsKeystore.properties");
+ props.setEncryptionUsername("myservicekey");
+ props.setIssuer("DoubleItSTSIssuer");
+
+ List<ServiceMBean> services = new LinkedList<ServiceMBean>();
+ StaticService service = new StaticService();
+ service.setEndpoints(Arrays.asList(
+ "https://localhost:(\\d)*/jaxws-samples-wsse-policy-trust-holderofkey/Hold...",
+ "https://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService",
+ "https://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService"
+ ));
+
+ services.add(service);
+
+ TokenIssueOperation issueOperation = new TokenIssueOperation();
+ issueOperation.getTokenProviders().add(new SAMLTokenProvider());
+ issueOperation.setServices(services);
+ issueOperation.setStsProperties(props);
+ this.setIssueOperation(issueOperation);
+
+ }
+}
\ No newline at end of file
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/SampleSTSHolderOfKey.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/wsf/test/CryptoHelper.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/wsf/test/CryptoHelper.java (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/wsf/test/CryptoHelper.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.test;
+
+import java.security.NoSuchAlgorithmException;
+
+public final class CryptoHelper
+{
+ public static Exception checkAndWrapException(Exception e) throws Exception {
+ if (!isBouncyCastleAvailable()) {
+ return new Exception("Bouncy Castle JCE provider does not seem to be properly installed; either install it " +
+ "or run the testuite with -Dexclude-integration-tests-BC-related=true to exclude this test.", e);
+ } else if(!isUnlimitedStrengthCryptographyAvailable()) {
+ return new Exception("JCE unlimited strength cryptography extension does not seem to be properly installed; either install it " +
+ "or run the testuite with '-Dexclude-integration-tests-unlimited-strength-related=true' to exclude this test.", e);
+ } else if (e.getCause() != null && e.getCause().getClass().getName().contains("SoapFault") && e.getMessage() != null && e.getMessage().contains("algorithm")) {
+ return new Exception("Please check for Bouncy Castle JCE provider and JCE unlimited strenght cryptography extension availability on server side.", e);
+ } else {
+ return e;
+ }
+ }
+
+ public static boolean isBouncyCastleAvailable() {
+ return java.security.Security.getProvider("BC") != null;
+ }
+
+ public static boolean isUnlimitedStrengthCryptographyAvailable() {
+ try {
+ return (javax.crypto.Cipher.getMaxAllowedKeyLength("RC5") >= 256);
+ } catch (NoSuchAlgorithmException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/wsf/test/CryptoHelper.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/wsf/test/TestServlet.java
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/wsf/test/TestServlet.java 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/java/org/jboss/wsf/test/TestServlet.java 2014-10-22 09:41:53 UTC (rev 19023)
@@ -28,6 +28,9 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
@@ -45,6 +48,19 @@
public class TestServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
+ private static final Pattern VALID_IPV6_PATTERN;
+ private static final String ipv6Pattern = "^([\\dA-F]{1,4}:|((?=.*(::))(?!.*\\3.+\\3))\\3?)([\\dA-F]{1,4}(\\3|:\\b)|\\2){5}(([\\dA-F]{1,4}(\\3|:\\b|$)|\\2){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})\\z";
+ static
+ {
+ try
+ {
+ VALID_IPV6_PATTERN = Pattern.compile(ipv6Pattern, Pattern.CASE_INSENSITIVE);
+ }
+ catch (PatternSyntaxException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
@@ -58,11 +74,7 @@
try
{
ClientHelper helper = (ClientHelper) Class.forName(helperClassName).newInstance();
- String hostName = System.getProperty("jboss.bind.address", "localhost");
- if (hostName.startsWith(":"))
- {
- hostName = "[" + hostName + "]";
- }
+ String hostName = toIPv6URLFormat(System.getProperty("jboss.bind.address", "localhost"));
helper.setTargetEndpoint("http://" + hostName + ":8080" + path);
List<String> failedTests = new LinkedList<String>();
List<String> errorTests = new LinkedList<String>();
@@ -117,6 +129,22 @@
}
}
+ private String toIPv6URLFormat(final String host)
+ {
+ boolean isIPv6URLFormatted = false;
+ //strip out IPv6 URL formatting if already provided...
+ if (host.startsWith("[") && host.endsWith("]")) {
+ isIPv6URLFormatted = true;
+ }
+ //return IPv6 URL formatted address
+ if (isIPv6URLFormatted) {
+ return host;
+ } else {
+ Matcher m = VALID_IPV6_PATTERN.matcher(host);
+ return m.matches() ? "[" + host + "]" : host;
+ }
+ }
+
private void invokeMethod(Method m, ClientHelper helper, List<String> failedTests, List<String> errorTests) throws ServletException
{
try
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/jaxws-endpoint-config.xml
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/jaxws-endpoint-config.xml 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/jaxws-endpoint-config.xml 2014-10-22 09:41:53 UTC (rev 19023)
@@ -22,6 +22,10 @@
<property-value>alice</property-value>
</property>
<property>
+ <property-name>ws-security.enable.streaming</property-name>
+ <property-value>true</property-value>
+ </property>
+ <property>
<property-name>ws-security.callback-handler</property-name>
<property-value>org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback</property-value>
</property>
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/wsdl/SecurityService.wsdl 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/gcm/WEB-INF/wsdl/SecurityService.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -78,7 +78,7 @@
<sp:OnlySignEntireHeadersAndBody/>
<sp:AlgorithmSuite>
<wsp:Policy>
- <sp-cxf:Basic192GCM xmlns:sp-cxf="http://cxf.apache.org/custom/security-policy"/>
+ <sp-cxf:Basic256GCM xmlns:sp-cxf="http://cxf.apache.org/custom/security-policy"/>
</wsp:Policy>
</sp:AlgorithmSuite>
</wsp:Policy>
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign/META-INF-server/wsdl/SecurityService.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign/META-INF-server/wsdl/SecurityService.wsdl 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign/META-INF-server/wsdl/SecurityService.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -54,7 +54,7 @@
<wsp:Policy>
<sp:X509Token sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysT...'>
<wsp:Policy>
- <sp:WssX509V3Token10 />
+ <sp:WssX509V1Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
@@ -63,7 +63,7 @@
<wsp:Policy>
<sp:X509Token sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Always'>
<wsp:Policy>
- <sp:WssX509V3Token10 />
+ <sp:WssX509V1Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign/WEB-INF/wsdl/SecurityService.wsdl 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign/WEB-INF/wsdl/SecurityService.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -54,7 +54,7 @@
<wsp:Policy>
<sp:X509Token sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysT...'>
<wsp:Policy>
- <sp:WssX509V3Token10 />
+ <sp:WssX509V1Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
@@ -63,7 +63,7 @@
<wsp:Policy>
<sp:X509Token sp:IncludeToken='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Always'>
<wsp:Policy>
- <sp:WssX509V3Token10 />
+ <sp:WssX509V1Token10 />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/jaxws-client-config.xml
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/jaxws-client-config.xml 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign-encrypt/META-INF/jaxws-client-config.xml 2014-10-22 09:41:53 UTC (rev 19023)
@@ -22,6 +22,10 @@
<property-value>bob</property-value>
</property>
<property>
+ <property-name>ws-security.enable.streaming</property-name>
+ <property-value>true</property-value>
+ </property>
+ <property>
<property-name>ws-security.callback-handler</property-name>
<property-value>org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback</property-value>
</property>
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jaxws-endpoint-config.xml
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jaxws-endpoint-config.xml 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/jaas/ejb/META-INF/jaxws-endpoint-config.xml 2014-10-22 09:41:53 UTC (rev 19023)
@@ -9,6 +9,10 @@
<property-name>ws-security.validate.token</property-name>
<property-value>false</property-value>
</property>
+ <property>
+ <property-name>cxf.interceptors.in</property-name>
+ <property-value>org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor</property-value>
+ </property>
</endpoint-config>
</jaxws-config>
\ No newline at end of file
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService.wsdl 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -101,7 +101,7 @@
<soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService224"/>
</wsdl:port>
</wsdl:service>
- <!-- 2.2.1 (WSS 1.0) UsernameToken with Mutual X.509v3 Authentication, Sign, Encrypt -->
+ <!-- 2.2.1 (WSS1.0) X.509 Certificates, Sign, Encrypt -->
<wsp:Policy wsu:Id="SecurityService221_policy">
<wsp:ExactlyOne>
<wsp:All>
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks
===================================================================
(Binary files differ)
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<permissions xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/permissions_7.xsd"
+ version="7">
+ <permission>
+ <class-name>java.lang.RuntimePermission</class-name>
+ <name>getClassLoader</name>
+ </permission>
+ <permission>
+ <class-name>java.lang.RuntimePermission</class-name>
+ <name>createClassLoader</name>
+ </permission>
+ <permission>
+ <class-name>java.lang.RuntimePermission</class-name>
+ <name>accessDeclaredMembers</name>
+ </permission>
+ <permission>
+ <class-name>java.util.PropertyPermission</class-name>
+ <name>jboss.bind.address</name>
+ <actions>read</actions>
+ </permission>
+ <permission>
+ <class-name>java.net.SocketPermission</class-name>
+ <name>*</name>
+ <actions>connect,resolve</actions>
+ </permission>
+</permissions>
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=aapass
+org.apache.ws.security.crypto.merlin.keystore.alias=myactaskey
+org.apache.ws.security.crypto.merlin.keystore.file=actasstore.jks
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks
===================================================================
(Binary files differ)
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks
___________________________________________________________________
Added: svn:mime-type
+ application/x-java-keystore
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/bearer/web.xml
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/bearer/web.xml (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/bearer/web.xml 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
+ version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <servlet>
+ <servlet-name>TestSecurityTokenService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsbearer.SampleSTSBearer</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestSecurityTokenService</servlet-name>
+ <url-pattern>/SecurityTokenService/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/bearer/web.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/holderofkey/web.xml
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/holderofkey/web.xml (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/holderofkey/web.xml 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
+ version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <servlet>
+ <servlet-name>TestSecurityTokenService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsholderofkey.SampleSTSHolderOfKey</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestSecurityTokenService</servlet-name>
+ <url-pattern>/SecurityTokenService/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/holderofkey/web.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-roles.properties
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-roles.properties 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-roles.properties 2014-10-22 09:41:53 UTC (rev 19023)
@@ -1,2 +1,3 @@
# A sample roles.properties file for use with the UsersRolesLoginModule
-alice=friend
\ No newline at end of file
+alice=friend
+bob=friend
\ No newline at end of file
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-users.properties
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-users.properties 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-users.properties 2014-10-22 09:41:53 UTC (rev 19023)
@@ -1,2 +1,3 @@
# A sample users.properties file for use with the UsersRolesLoginModule
alice=clarinet
+bob=trombone
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml 2014-10-22 09:41:53 UTC (rev 19023)
@@ -17,4 +17,10 @@
TokenElement="Assertion"
TokenElementNS="urn:oasis:names:tc:SAML:2.0:assertion"/>
</TokenProviders>
+ <!-- Erroneously mandatory element below (in PLINK 2.1.8.Final / 2.5.1.Final) -->
+ <ServiceProviders>
+ <ServiceProvider Endpoint="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust/SecurityService"
+ TokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"
+ TruststoreAlias="myservicekey"/>
+ </ServiceProviders>
</PicketLinkSTS>
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks
===================================================================
(Binary files differ)
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/web.xml
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/web.xml 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/web.xml 2014-10-22 09:41:53 UTC (rev 19023)
@@ -6,7 +6,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>TestSecurityTokenService</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxws.samples.wsse.policy.trust.SampleSTS</servlet-class>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.SampleSTS</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestSecurityTokenService</servlet-name>
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy" name="ActAsService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsaws="http://www.w3.org/2005/08/addressing"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
+ xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy"
+ schemaLocation="ActAsService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="sayHello">
+ <part name="parameters" element="tns:sayHello"/>
+ </message>
+ <message name="sayHelloResponse">
+ <part name="parameters" element="tns:sayHelloResponse"/>
+ </message>
+ <portType name="ActAsServiceIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ </portType>
+ <binding name="ActAsServicePortBinding" type="tns:ActAsServiceIface">
+ <wsp:PolicyReference URI="#AsymmetricSAML2Policy" />
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Input_Policy" />
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Output_Policy" />
+ </output>
+ </operation>
+ </binding>
+ <service name="ActAsService">
+ <port name="ActAsServicePort" binding="tns:ActAsServicePortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-actas/ActAsService"/>
+ </port>
+ </service>
+
+ <wsp:Policy wsu:Id="AsymmetricSAML2Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsam:Addressing wsp:Optional="false">
+ <wsp:Policy />
+ </wsam:Addressing>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:IssuedToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <sp:RequestSecurityTokenTemplate>
+ <t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</t:TokenType>
+ <t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey</t:KeyType>
+ </sp:RequestSecurityTokenTemplate>
+ <wsp:Policy>
+ <sp:RequireInternalReference />
+ </wsp:Policy>
+ <sp:Issuer>
+ <wsaws:Address>http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService</wsaws:Address>
+ <wsaws:Metadata xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ wsdli:wsdlLocation="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService?wsdl">
+ <wsaw:ServiceName xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:stsns="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ EndpointName="UT_Port">stsns:SecurityTokenService</wsaw:ServiceName>
+ </wsaws:Metadata>
+ </sp:Issuer>
+ </sp:IssuedToken>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10 />
+ <sp:RequireIssuerSerialReference />
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax />
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256 />
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefIssuerSerial />
+ <sp:MustSupportRefThumbprint />
+ <sp:MustSupportRefEncryptedKey />
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust13>
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens />
+ <sp:RequireClientEntropy />
+ <sp:RequireServerEntropy />
+ </wsp:Policy>
+ </sp:Trust13>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Input_Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body />
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Output_Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body />
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+</definitions>
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="sayHello" type="tns:sayHello"/>
+
+ <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+ <xs:complexType name="sayHello">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="sayHelloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService.wsdl (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypolicy"
+ name="BearerService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypolicy"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsaws="http://www.w3.org/2005/08/addressing"
+ xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
+ xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
+
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypolicy"
+ schemaLocation="BearerService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="sayHello">
+ <part name="parameters" element="tns:sayHello"/>
+ </message>
+ <message name="sayHelloResponse">
+ <part name="parameters" element="tns:sayHelloResponse"/>
+ </message>
+ <portType name="BearerIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ </portType>
+ <binding name="BearerServicePortBinding" type="tns:BearerIface">
+ <wsp:PolicyReference URI="#TransportSAML2BearerPolicy" />
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="BearerService">
+ <port name="BearerServicePort" binding="tns:BearerServicePortBinding">
+ <soap:address location="https://@jboss.bind.address@:8443/jaxws-samples-wsse-policy-trust-bearer/BearerService"/>
+ </port>
+ </service>
+
+
+ <wsp:Policy wsu:Id="TransportSAML2BearerPolicy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsam:Addressing wsp:Optional="false">
+ <wsp:Policy />
+ </wsam:Addressing>
+
+ <sp:TransportBinding
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <sp:HttpsToken>
+ <wsp:Policy/>
+ </sp:HttpsToken>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:TripleDes />
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax />
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp />
+ </wsp:Policy>
+ </sp:TransportBinding>
+
+ <sp:SignedSupportingTokens
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:IssuedToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <sp:RequestSecurityTokenTemplate>
+ <t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</t:TokenType>
+ <t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</t:KeyType>
+ </sp:RequestSecurityTokenTemplate>
+ <wsp:Policy>
+ <sp:RequireInternalReference />
+ </wsp:Policy>
+
+ <sp:Issuer>
+ <wsaws:Address>http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts-bearer/SecurityTokenService</wsaws:Address>
+ <wsaws:Metadata
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ wsdli:wsdlLocation="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts-bearer/SecurityTokenService?wsdl">
+ <wsaw:ServiceName
+ xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:stsns="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ EndpointName="UT_Port">stsns:SecurityTokenService</wsaw:ServiceName>
+ </wsaws:Metadata>
+ </sp:Issuer>
+
+ </sp:IssuedToken>
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefIssuerSerial />
+ <sp:MustSupportRefThumbprint />
+ <sp:MustSupportRefEncryptedKey />
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust13>
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens />
+ <sp:RequireClientEntropy />
+ <sp:RequireServerEntropy />
+ </wsp:Policy>
+ </sp:Trust13>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+</definitions>
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService_schema1.xsd
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService_schema1.xsd (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService_schema1.xsd 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypolicy"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypolicy"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="sayHello" type="tns:sayHello"/>
+
+ <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+ <xs:complexType name="sayHello">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="sayHelloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService_schema1.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService.wsdl (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecuritypolicy"
+ name="HolderOfKeyService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecuritypolicy"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsaws="http://www.w3.org/2005/08/addressing"
+ xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
+ xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
+
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecuritypolicy"
+ schemaLocation="HolderOfKeyService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="sayHello">
+ <part name="parameters" element="tns:sayHello"/>
+ </message>
+ <message name="sayHelloResponse">
+ <part name="parameters" element="tns:sayHelloResponse"/>
+ </message>
+ <portType name="HolderOfKeyIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ </portType>
+ <binding name="HolderOfKeyServicePortBinding" type="tns:HolderOfKeyIface">
+ <wsp:PolicyReference URI="#TransportSAML2HolderOfKeyPolicy" />
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="HolderOfKeyService">
+ <port name="HolderOfKeyServicePort" binding="tns:HolderOfKeyServicePortBinding">
+ <soap:address location="https://@jboss.bind.address@:8443/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService"/>
+ </port>
+ </service>
+
+
+ <wsp:Policy wsu:Id="TransportSAML2HolderOfKeyPolicy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsam:Addressing wsp:Optional="false">
+ <wsp:Policy />
+ </wsam:Addressing>
+
+ <sp:TransportBinding
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <sp:HttpsToken>
+ <wsp:Policy/>
+ </sp:HttpsToken>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:TripleDes />
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax />
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp />
+ </wsp:Policy>
+ </sp:TransportBinding>
+
+ <sp:SignedEndorsingSupportingTokens
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:IssuedToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <sp:RequestSecurityTokenTemplate>
+ <t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</t:TokenType>
+ <t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey</t:KeyType>
+ </sp:RequestSecurityTokenTemplate>
+ <wsp:Policy>
+ <sp:RequireInternalReference />
+ </wsp:Policy>
+
+ <sp:Issuer>
+ <wsaws:Address>http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts-holderofkey/SecurityTokenService</wsaws:Address>
+ <wsaws:Metadata
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ wsdli:wsdlLocation="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts-holderofkey/SecurityTokenService?wsdl">
+ <wsaw:ServiceName
+ xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:stsns="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ EndpointName="UT_Port">stsns:SecurityTokenService</wsaw:ServiceName>
+ </wsaws:Metadata>
+ </sp:Issuer>
+
+ </sp:IssuedToken>
+ </wsp:Policy>
+ </sp:SignedEndorsingSupportingTokens>
+
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefIssuerSerial />
+ <sp:MustSupportRefThumbprint />
+ <sp:MustSupportRefEncryptedKey />
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust13>
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens />
+ <sp:RequireClientEntropy />
+ <sp:RequireServerEntropy />
+ </wsp:Policy>
+ </sp:Trust13>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+</definitions>
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService_schema1.xsd
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService_schema1.xsd (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService_schema1.xsd 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecuritypolicy"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecuritypolicy"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="sayHello" type="tns:sayHello"/>
+
+ <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+ <xs:complexType name="sayHello">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="sayHelloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService_schema1.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService.wsdl (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/onbehalfofwssecuritypolicy" name="OnBehalfOfService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/onbehalfofwssecuritypolicy"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsaws="http://www.w3.org/2005/08/addressing"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
+ xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/onbehalfofwssecuritypolicy"
+ schemaLocation="OnBehalfOfService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="sayHello">
+ <part name="parameters" element="tns:sayHello"/>
+ </message>
+ <message name="sayHelloResponse">
+ <part name="parameters" element="tns:sayHelloResponse"/>
+ </message>
+ <portType name="OnBehalfOfServiceIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ </portType>
+ <binding name="OnBehalfOfServicePortBinding" type="tns:OnBehalfOfServiceIface">
+ <wsp:PolicyReference URI="#AsymmetricSAML2Policy" />
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Input_Policy" />
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Output_Policy" />
+ </output>
+ </operation>
+ </binding>
+ <service name="OnBehalfOfService">
+ <port name="OnBehalfOfServicePort" binding="tns:OnBehalfOfServicePortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-onbehalfof/OnBehalfOfService"/>
+ </port>
+ </service>
+
+ <wsp:Policy wsu:Id="AsymmetricSAML2Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsam:Addressing wsp:Optional="false">
+ <wsp:Policy />
+ </wsam:Addressing>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:IssuedToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <sp:RequestSecurityTokenTemplate>
+ <t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</t:TokenType>
+ <t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey</t:KeyType>
+ </sp:RequestSecurityTokenTemplate>
+ <wsp:Policy>
+ <sp:RequireInternalReference />
+ </wsp:Policy>
+ <sp:Issuer>
+ <wsaws:Address>http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService</wsaws:Address>
+ <wsaws:Metadata xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ wsdli:wsdlLocation="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService?wsdl">
+ <wsaw:ServiceName xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:stsns="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ EndpointName="UT_Port">stsns:SecurityTokenService</wsaw:ServiceName>
+ </wsaws:Metadata>
+ </sp:Issuer>
+ </sp:IssuedToken>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10 />
+ <sp:RequireIssuerSerialReference />
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax />
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256 />
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefIssuerSerial />
+ <sp:MustSupportRefThumbprint />
+ <sp:MustSupportRefEncryptedKey />
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust13>
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens />
+ <sp:RequireClientEntropy />
+ <sp:RequireServerEntropy />
+ </wsp:Policy>
+ </sp:Trust13>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Input_Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body />
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Output_Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body />
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+</definitions>
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/onbehalfofwssecuritypolicy"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/onbehalfofwssecuritypolicy"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="sayHello" type="tns:sayHello"/>
+
+ <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+ <xs:complexType name="sayHello">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="sayHelloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -66,7 +66,7 @@
</wsdl:binding>
<wsdl:service name="PicketLinkSTS">
<wsdl:port name="PicketLinkSTSPort" binding="tns:STSBinding">
- <soap12:address location="http://localhost:8080/picketlink-sts/PicketLinkSTS"/>
+ <soap12:address location="http://@jboss.bind.address@:8080/picketlink-sts/PicketLinkSTS"/>
</wsdl:port>
</wsdl:service>
Modified: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -68,9 +68,9 @@
<sp:RequireInternalReference />
</wsp:Policy>
<sp:Issuer>
- <wsaws:Address>http://localhost:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenSe...</wsaws:Address>
+ <wsaws:Address>http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService</wsaws:Address>
<wsaws:Metadata xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
- wsdli:wsdlLocation="http://localhost:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenSe...">
+ wsdli:wsdlLocation="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService?wsdl">
<wsaw:ServiceName xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:stsns="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
EndpointName="UT_Port">stsns:SecurityTokenService</wsaw:ServiceName>
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/bearer-ws-trust-1.4-service.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/bearer-ws-trust-1.4-service.wsdl (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/bearer-ws-trust-1.4-service.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,333 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
+ targetNamespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ xmlns:tns="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ xmlns:wstrust="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsap10="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
+
+ <wsdl:types>
+ <xs:schema elementFormDefault="qualified"
+ targetNamespace='http://docs.oasis-open.org/ws-sx/ws-trust/200512'>
+
+ <xs:element name='RequestSecurityToken'
+ type='wst:AbstractRequestSecurityTokenType'/>
+ <xs:element name='RequestSecurityTokenResponse'
+ type='wst:AbstractRequestSecurityTokenType'/>
+
+ <xs:complexType name='AbstractRequestSecurityTokenType'>
+ <xs:sequence>
+ <xs:any namespace='##any' processContents='lax' minOccurs='0'
+ maxOccurs='unbounded'/>
+ </xs:sequence>
+ <xs:attribute name='Context' type='xs:anyURI' use='optional'/>
+ <xs:anyAttribute namespace='##other' processContents='lax'/>
+ </xs:complexType>
+ <xs:element name='RequestSecurityTokenCollection'
+ type='wst:RequestSecurityTokenCollectionType'/>
+ <xs:complexType name='RequestSecurityTokenCollectionType'>
+ <xs:sequence>
+ <xs:element name='RequestSecurityToken'
+ type='wst:AbstractRequestSecurityTokenType' minOccurs='2'
+ maxOccurs='unbounded'/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name='RequestSecurityTokenResponseCollection'
+ type='wst:RequestSecurityTokenResponseCollectionType'/>
+ <xs:complexType name='RequestSecurityTokenResponseCollectionType'>
+ <xs:sequence>
+ <xs:element ref='wst:RequestSecurityTokenResponse' minOccurs='1'
+ maxOccurs='unbounded'/>
+ </xs:sequence>
+ <xs:anyAttribute namespace='##other' processContents='lax'/>
+ </xs:complexType>
+
+ </xs:schema>
+ </wsdl:types>
+
+ <!-- WS-Trust defines the following GEDs -->
+ <wsdl:message name="RequestSecurityTokenMsg">
+ <wsdl:part name="request" element="wst:RequestSecurityToken"/>
+ </wsdl:message>
+ <wsdl:message name="RequestSecurityTokenResponseMsg">
+ <wsdl:part name="response"
+ element="wst:RequestSecurityTokenResponse"/>
+ </wsdl:message>
+ <wsdl:message name="RequestSecurityTokenCollectionMsg">
+ <wsdl:part name="requestCollection"
+ element="wst:RequestSecurityTokenCollection"/>
+ </wsdl:message>
+ <wsdl:message name="RequestSecurityTokenResponseCollectionMsg">
+ <wsdl:part name="responseCollection"
+ element="wst:RequestSecurityTokenResponseCollection"/>
+ </wsdl:message>
+
+ <!-- This portType an example of a Requestor (or other) endpoint that
+ Accepts SOAP-based challenges from a Security Token Service -->
+ <wsdl:portType name="WSSecurityRequestor">
+ <wsdl:operation name="Challenge">
+ <wsdl:input message="tns:RequestSecurityTokenResponseMsg"/>
+ <wsdl:output message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <!-- This portType is an example of an STS supporting full protocol -->
+ <wsdl:portType name="STS">
+ <wsdl:operation name="Cancel">
+ <wsdl:input
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Cancel"
+ message="tns:RequestSecurityTokenMsg"/>
+ <wsdl:output
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/CancelFinal"
+ message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ <wsdl:operation name="Issue">
+ <wsdl:input
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue"
+ message="tns:RequestSecurityTokenMsg"/>
+ <wsdl:output
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTRC/IssueFinal"
+ message="tns:RequestSecurityTokenResponseCollectionMsg"/>
+ </wsdl:operation>
+ <wsdl:operation name="Renew">
+ <wsdl:input
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Renew"
+ message="tns:RequestSecurityTokenMsg"/>
+ <wsdl:output
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/RenewFinal"
+ message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ <wsdl:operation name="Validate">
+ <wsdl:input
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Validate"
+ message="tns:RequestSecurityTokenMsg"/>
+ <wsdl:output
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/ValidateFinal"
+ message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ <wsdl:operation name="KeyExchangeToken">
+ <wsdl:input
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/KET"
+ message="tns:RequestSecurityTokenMsg"/>
+ <wsdl:output
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/KETFinal"
+ message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ <wsdl:operation name="RequestCollection">
+ <wsdl:input message="tns:RequestSecurityTokenCollectionMsg"/>
+ <wsdl:output message="tns:RequestSecurityTokenResponseCollectionMsg"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <!-- This portType is an example of an endpoint that accepts
+ Unsolicited RequestSecurityTokenResponse messages -->
+ <wsdl:portType name="SecurityTokenResponseService">
+ <wsdl:operation name="RequestSecurityTokenResponse">
+ <wsdl:input message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="UT_Binding" type="wstrust:STS">
+ <wsp:PolicyReference URI="#UT_policy"/>
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="Issue">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue"/>
+ <wsdl:input>
+ <wsp:PolicyReference
+ URI="#Input_policy"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <wsp:PolicyReference
+ URI="#Output_policy"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Validate">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Validate"/>
+ <wsdl:input>
+ <wsp:PolicyReference
+ URI="#Input_policy"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <wsp:PolicyReference
+ URI="#Output_policy"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Cancel">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Cancel"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Renew">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Renew"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="KeyExchangeToken">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/KeyExchangeToken"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="RequestCollection">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/RequestCollection"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="SecurityTokenService">
+ <wsdl:port name="UT_Port" binding="tns:UT_Binding">
+ <soap:address location="http://localhost:8080/SecurityTokenService/UT"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <wsp:Policy wsu:Id="UT_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsap10:UsingAddressing/>
+ <sp:SymmetricBinding
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ <sp:RequireThumbprintReference/>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:EncryptSignature/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:SignedSupportingTokens
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:UsernameToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssUsernameToken10/>
+ </wsp:Policy>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+ <sp:Wss11
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust13
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens/>
+ <sp:RequireClientEntropy/>
+ <sp:RequireServerEntropy/>
+ </wsp:Policy>
+ </sp:Trust13>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Input_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <sp:Body/>
+ <sp:Header Name="To"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Output_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <sp:Body/>
+ <sp:Header Name="To"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+</wsdl:definitions>
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/bearer-ws-trust-1.4-service.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/holderofkey-ws-trust-1.4-service.wsdl
===================================================================
--- projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/holderofkey-ws-trust-1.4-service.wsdl (rev 0)
+++ projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/holderofkey-ws-trust-1.4-service.wsdl 2014-10-22 09:41:53 UTC (rev 19023)
@@ -0,0 +1,333 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
+ targetNamespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ xmlns:tns="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ xmlns:wstrust="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsap10="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
+
+ <wsdl:types>
+ <xs:schema elementFormDefault="qualified"
+ targetNamespace='http://docs.oasis-open.org/ws-sx/ws-trust/200512'>
+
+ <xs:element name='RequestSecurityToken'
+ type='wst:AbstractRequestSecurityTokenType'/>
+ <xs:element name='RequestSecurityTokenResponse'
+ type='wst:AbstractRequestSecurityTokenType'/>
+
+ <xs:complexType name='AbstractRequestSecurityTokenType'>
+ <xs:sequence>
+ <xs:any namespace='##any' processContents='lax' minOccurs='0'
+ maxOccurs='unbounded'/>
+ </xs:sequence>
+ <xs:attribute name='Context' type='xs:anyURI' use='optional'/>
+ <xs:anyAttribute namespace='##other' processContents='lax'/>
+ </xs:complexType>
+ <xs:element name='RequestSecurityTokenCollection'
+ type='wst:RequestSecurityTokenCollectionType'/>
+ <xs:complexType name='RequestSecurityTokenCollectionType'>
+ <xs:sequence>
+ <xs:element name='RequestSecurityToken'
+ type='wst:AbstractRequestSecurityTokenType' minOccurs='2'
+ maxOccurs='unbounded'/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name='RequestSecurityTokenResponseCollection'
+ type='wst:RequestSecurityTokenResponseCollectionType'/>
+ <xs:complexType name='RequestSecurityTokenResponseCollectionType'>
+ <xs:sequence>
+ <xs:element ref='wst:RequestSecurityTokenResponse' minOccurs='1'
+ maxOccurs='unbounded'/>
+ </xs:sequence>
+ <xs:anyAttribute namespace='##other' processContents='lax'/>
+ </xs:complexType>
+
+ </xs:schema>
+ </wsdl:types>
+
+ <!-- WS-Trust defines the following GEDs -->
+ <wsdl:message name="RequestSecurityTokenMsg">
+ <wsdl:part name="request" element="wst:RequestSecurityToken"/>
+ </wsdl:message>
+ <wsdl:message name="RequestSecurityTokenResponseMsg">
+ <wsdl:part name="response"
+ element="wst:RequestSecurityTokenResponse"/>
+ </wsdl:message>
+ <wsdl:message name="RequestSecurityTokenCollectionMsg">
+ <wsdl:part name="requestCollection"
+ element="wst:RequestSecurityTokenCollection"/>
+ </wsdl:message>
+ <wsdl:message name="RequestSecurityTokenResponseCollectionMsg">
+ <wsdl:part name="responseCollection"
+ element="wst:RequestSecurityTokenResponseCollection"/>
+ </wsdl:message>
+
+ <!-- This portType an example of a Requestor (or other) endpoint that
+ Accepts SOAP-based challenges from a Security Token Service -->
+ <wsdl:portType name="WSSecurityRequestor">
+ <wsdl:operation name="Challenge">
+ <wsdl:input message="tns:RequestSecurityTokenResponseMsg"/>
+ <wsdl:output message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <!-- This portType is an example of an STS supporting full protocol -->
+ <wsdl:portType name="STS">
+ <wsdl:operation name="Cancel">
+ <wsdl:input
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Cancel"
+ message="tns:RequestSecurityTokenMsg"/>
+ <wsdl:output
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/CancelFinal"
+ message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ <wsdl:operation name="Issue">
+ <wsdl:input
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue"
+ message="tns:RequestSecurityTokenMsg"/>
+ <wsdl:output
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTRC/IssueFinal"
+ message="tns:RequestSecurityTokenResponseCollectionMsg"/>
+ </wsdl:operation>
+ <wsdl:operation name="Renew">
+ <wsdl:input
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Renew"
+ message="tns:RequestSecurityTokenMsg"/>
+ <wsdl:output
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/RenewFinal"
+ message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ <wsdl:operation name="Validate">
+ <wsdl:input
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Validate"
+ message="tns:RequestSecurityTokenMsg"/>
+ <wsdl:output
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/ValidateFinal"
+ message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ <wsdl:operation name="KeyExchangeToken">
+ <wsdl:input
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/KET"
+ message="tns:RequestSecurityTokenMsg"/>
+ <wsdl:output
+ wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/KETFinal"
+ message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ <wsdl:operation name="RequestCollection">
+ <wsdl:input message="tns:RequestSecurityTokenCollectionMsg"/>
+ <wsdl:output message="tns:RequestSecurityTokenResponseCollectionMsg"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <!-- This portType is an example of an endpoint that accepts
+ Unsolicited RequestSecurityTokenResponse messages -->
+ <wsdl:portType name="SecurityTokenResponseService">
+ <wsdl:operation name="RequestSecurityTokenResponse">
+ <wsdl:input message="tns:RequestSecurityTokenResponseMsg"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="UT_Binding" type="wstrust:STS">
+ <wsp:PolicyReference URI="#UT_policy"/>
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="Issue">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue"/>
+ <wsdl:input>
+ <wsp:PolicyReference
+ URI="#Input_policy"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <wsp:PolicyReference
+ URI="#Output_policy"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Validate">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Validate"/>
+ <wsdl:input>
+ <wsp:PolicyReference
+ URI="#Input_policy"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <wsp:PolicyReference
+ URI="#Output_policy"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Cancel">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Cancel"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Renew">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Renew"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="KeyExchangeToken">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/KeyExchangeToken"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="RequestCollection">
+ <soap:operation
+ soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/RequestCollection"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="SecurityTokenService">
+ <wsdl:port name="UT_Port" binding="tns:UT_Binding">
+ <soap:address location="http://localhost:8080/SecurityTokenService/UT"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <wsp:Policy wsu:Id="UT_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsap10:UsingAddressing/>
+ <sp:SymmetricBinding
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:RequireDerivedKeys/>
+ <sp:RequireThumbprintReference/>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:EncryptSignature/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:SignedSupportingTokens
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:UsernameToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssUsernameToken10/>
+ </wsp:Policy>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+ <sp:Wss11
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust13
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens/>
+ <sp:RequireClientEntropy/>
+ <sp:RequireServerEntropy/>
+ </wsp:Policy>
+ </sp:Trust13>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Input_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <sp:Body/>
+ <sp:Header Name="To"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Output_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedParts
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <sp:Body/>
+ <sp:Header Name="To"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action"
+ Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+</wsdl:definitions>
Property changes on: projects/wsi-bp-test/trunk/bsp11-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/holderofkey-ws-trust-1.4-service.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/wsi-bp-test/trunk/pom.xml
===================================================================
--- projects/wsi-bp-test/trunk/pom.xml 2014-10-21 09:37:37 UTC (rev 19022)
+++ projects/wsi-bp-test/trunk/pom.xml 2014-10-22 09:41:53 UTC (rev 19023)
@@ -26,18 +26,20 @@
<test.classes.directory>${project.build.directory}/test-classes</test.classes.directory>
<test.resources.directory>${project.build.directory}/test-resources</test.resources.directory>
- <jbossws.cxf.version>4.3.0.Final</jbossws.cxf.version>
- <jbossws.cxf-test-utils.version>4.3.0.CR1</jbossws.cxf-test-utils.version>
+ <jbossws.cxf.version>5.0.0-SNAPSHOT</jbossws.cxf.version>
+ <jbossws.cxf-test-utils.version>5.0.0-SNAPSHOT</jbossws.cxf-test-utils.version>
<junit.version>4.10</junit.version>
- <log4j.version>1.2.14</log4j.version>
+ <log4j.version>1.2.16</log4j.version>
+ <jbossws.wildfly800.version>5.0.0-SNAPSHOT</jbossws.wildfly800.version>
+ <jbossws.wildfly810.version>5.0.0-SNAPSHOT</jbossws.wildfly810.version>
+ <wildfly800.version>8.0.0.Final</wildfly800.version>
+ <wildfly810.version>8.1.0.Final</wildfly810.version>
+ <wildfly900.version>9.0.0.Alpha2-SNAPSHOT</wildfly900.version>
- <jboss720.version>7.2.0.Final</jboss720.version>
- <wildfly800.version>8.0.1.Final-SNAPSHOT</wildfly800.version>
-
- <ejb.api.version>1.0.1.Final</ejb.api.version>
- <jaxb.api.version>1.0.3.Final</jaxb.api.version>
- <jaxws.api.version>2.0.0.Final</jaxws.api.version>
+ <ejb.api.version>1.0.2.Final</ejb.api.version>
+ <jaxb.api.version>1.0.4.Final</jaxb.api.version>
+ <jaxws.api.version>2.0.2.Final</jaxws.api.version>
<jsr181.api.version>1.0-MR1</jsr181.api.version>
<picketlink.version>2.1.7.Final</picketlink.version>
<org.slf4j.version>1.6.1</org.slf4j.version>
@@ -101,6 +103,22 @@
</dependency>
<dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-wildfly810-server-integration</artifactId>
+ <version>${jbossws.wildfly810.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-wildfly810-tests-integration</artifactId>
+ <version>${jbossws.wildfly810.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.wildfly</groupId>
+ <artifactId>wildfly-webservices-tests-integration</artifactId>
+ <version>${wildfly900.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-core</artifactId>
<version>${picketlink.version}</version>
@@ -425,21 +443,22 @@
</build>
</profile>
- <!--
- Name: jboss720
- Descr: JBoss-7.2.0 specific options
+ <!--
+ Name: wildfly800
+ Descr: WildFly-8.0.0 specific options
-->
<profile>
- <id>jboss720</id>
+ <id>wildfly800</id>
<properties>
- <jboss.version>${jboss720.version}</jboss.version>
- <jbossws.integration.target>jboss720</jbossws.integration.target>
+ <jboss.version>${wildfly800.version}</jboss.version>
+ <jbossws.integration.target>wildfly800</jbossws.integration.target>
+ <remote.port>8080</remote.port>
+ <remote.protocol>http-remoting</remote.protocol>
</properties>
<dependencies>
<dependency>
- <groupId>org.jboss.as</groupId>
- <artifactId>jboss-as-webservices-tests-integration</artifactId>
- <version>${jboss.version}</version>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-wildfly800-tests-integration</artifactId>
</dependency>
</dependencies>
<build>
@@ -456,37 +475,93 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefire.jvm.args} ${surefire.jvm.management.args} ${surefire.default-mgmt-serurity.args} -Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
- <excludes>
+ <excludes combine.children="append">
<!--https://tools.oasis-open.org/issues/browse/WSBRSP-3(BSP3070)-->
<!-- # [PLFED-390] PicketLink STS chokes on WS-Policy 1.5 tags -->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase*</exclude>
<exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase*</exclude>
-
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase*</exclude>
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase*</exclude>
<!--https://tools.oasis-open.org/issues/browse/WSBRSP-4(BSP3032)-->
<!--After WSBRSP-4 is resolved we can port KerberosTestCase(with spring installed)-->
<!--this broke the WSI-Analyzer-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/*TestCase*</exclude>
<!--this broke the alogrithm conformance in wsi-bsp-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase*</exclude>
-
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase*</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
-
+
<!--
- Name: wildfly800
- Descr: WildFly 8.0.0 specific options
+ Name: wildfly810
+ Descr: WildFly-8.1.0 specific options
-->
<profile>
- <id>wildfly800</id>
+ <id>wildfly810</id>
<properties>
- <jboss.version>${wildfly800.version}</jboss.version>
- <jbossws.integration.target>wildfly800</jbossws.integration.target>
+ <jboss.version>${wildfly810.version}</jboss.version>
+ <jbossws.integration.target>wildfly810</jbossws.integration.target>
+ <remote.port>8080</remote.port>
+ <remote.protocol>http-remoting</remote.protocol>
</properties>
<dependencies>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-wildfly810-tests-integration</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArguments>
+ <endorseddirs>${project.build.directory}/endorsed</endorseddirs>
+ </compilerArguments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} ${surefire.default-mgmt-serurity.args} -Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
+ <excludes combine.children="append">
+ <!--https://tools.oasis-open.org/issues/browse/WSBRSP-3(BSP3070)-->
+ <!-- # [PLFED-390] PicketLink STS chokes on WS-Policy 1.5 tags -->
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase*</exclude>
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase*</exclude>
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase*</exclude>
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase*</exclude>
+ <!--https://tools.oasis-open.org/issues/browse/WSBRSP-4(BSP3032)-->
+ <!--After WSBRSP-4 is resolved we can port KerberosTestCase(with spring installed)-->
+ <!--this broke the WSI-Analyzer-->
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/*TestCase*</exclude>
+ <!--this broke the alogrithm conformance in wsi-bsp-->
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase*</exclude>
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: wildfly900
+ Descr: WildFly-9.0.0 specific options
+ -->
+ <profile>
+ <id>wildfly900</id>
+ <properties>
+ <jboss.version>${wildfly900.version}</jboss.version>
+ <jbossws.integration.target>wildfly900</jbossws.integration.target>
+ <remote.port>8080</remote.port>
+ <remote.protocol>http-remoting</remote.protocol>
+ </properties>
+ <dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-webservices-tests-integration</artifactId>
@@ -496,22 +571,31 @@
<build>
<plugins>
<plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArguments>
+ <endorseddirs>${project.build.directory}/endorsed</endorseddirs>
+ </compilerArguments>
+ </configuration>
+ </plugin>
+ <plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefire.jvm.args} ${surefire.jvm.management.args} ${surefire.default-mgmt-serurity.args} -Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
- <excludes>
+ <excludes combine.children="append">
<!--https://tools.oasis-open.org/issues/browse/WSBRSP-3(BSP3070)-->
<!-- # [PLFED-390] PicketLink STS chokes on WS-Policy 1.5 tags -->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase*</exclude>
<exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase*</exclude>
-
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase*</exclude>
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase*</exclude>
<!--https://tools.oasis-open.org/issues/browse/WSBRSP-4(BSP3032)-->
<!--After WSBRSP-4 is resolved we can port KerberosTestCase(with spring installed)-->
<!--this broke the WSI-Analyzer-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/*TestCase*</exclude>
<!--this broke the alogrithm conformance in wsi-bsp-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase*</exclude>
-
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase*</exclude>
</excludes>
</configuration>
</plugin>
10 years, 2 months