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/wssecuri...
name="SecurityService"
+
xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecuritypoli...
+
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-w...
+
xmlns:wsaws="http://www.w3.org/2005/08/addressing">
+ <types>
+ <xsd:schema>
+ <xsd:import
namespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypoli...
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/...
+ <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/wssecuri...
xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecuritypoli...
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