[jboss-svn-commits] JBL Code SVN: r29304 - in labs/jbossesb/workspace/dbevenius/saml_support/product: lib/ext and 24 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Sep 10 17:01:13 EDT 2009
Author: beve
Date: 2009-09-10 17:01:12 -0400 (Thu, 10 Sep 2009)
New Revision: 29304
Added:
labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-bindings-1.0.0.beta1-SNAPSHOT.jar
labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-bindings-jboss-1.0.0.beta1-SNAPSHOT.jar
labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/actions/security/
labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/actions/security/JBossSTSAction.java
labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/actions/security/
labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/actions/security/JBossSTSActionUnitTest.java
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/build.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/deployment.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbm-queue-service.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbmq-queue-service.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jboss-esb.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jboss-wsse-client.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbossesb-properties.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jndi.properties
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/lib/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/log4j.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/login-config.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/readme.txt
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/PrintSubjectAction.java
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/SendJMSMessage.java
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/SendMessage.java
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/soap_message_01.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/soap_message_02.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/webservice/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/webservice/GoodbyeWorldWS.java
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/resources/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/resources/WEB-INF/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/resources/WEB-INF/web.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/view/
labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/view/index.jsp
Modified:
labs/jbossesb/workspace/dbevenius/saml_support/product/install/build.xml
labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-fed-api-1.0.0.beta1-SNAPSHOT.jar
labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-fed-core-1.0.0.beta1-SNAPSHOT.jar
labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-fed-model-1.0.0.beta1-SNAPSHOT.jar
labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSConstants.java
labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSLoginModule.java
labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/ws/SamlAssertionExtractor.java
labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSLoginModuleUnitTest.java
labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/ws/SamlAssertionExtractorUnitTest.java
Log:
Initial work for a quickstart. This is a work in progress.
Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/install/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/install/build.xml 2009-09-10 17:14:21 UTC (rev 29303)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/install/build.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -230,7 +230,10 @@
<include name="commons-codec-*.jar"/>
<include name="jackson-core*jar"/>
</fileset>
- <fileset dir="${org.jboss.esb.dist.lib}" includes="commons-httpclient*.jar"/>
+ <fileset dir="${product.dir}/lib/ext">
+ <!-- Needed for JBoss STS Integration. Should be removed when non-snapshot jars are available -->
+ <include name="milyn-*jar"/>
+ </fileset>
</copy>
<copy todir="${deployers.dir}/esb.deployer/META-INF" overwrite="true">
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-bindings-1.0.0.beta1-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-bindings-1.0.0.beta1-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-bindings-jboss-1.0.0.beta1-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-bindings-jboss-1.0.0.beta1-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-fed-api-1.0.0.beta1-SNAPSHOT.jar
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-fed-core-1.0.0.beta1-SNAPSHOT.jar
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/lib/ext/jboss-identity-fed-model-1.0.0.beta1-SNAPSHOT.jar
===================================================================
(Binary files differ)
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/actions/security/JBossSTSAction.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/actions/security/JBossSTSAction.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/actions/security/JBossSTSAction.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,182 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.actions.security;
+
+import java.io.StringWriter;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.log4j.Logger;
+import org.jboss.identity.federation.api.wstrust.WSTrustClient;
+import org.jboss.identity.federation.api.wstrust.WSTrustClient.SecurityInfo;
+import org.jboss.identity.federation.core.exceptions.ParsingException;
+import org.jboss.identity.federation.core.wstrust.WSTrustException;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
+import org.jboss.soa.esb.services.security.auth.login.JBossSTSConstants;
+import org.jboss.util.xml.DOMUtils;
+import org.w3c.dom.Element;
+
+/**
+ * This action support validation, issueing, and renewal of SAML Assertions by
+ * calling JBossSTS (Security Token Service).
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class JBossSTSAction extends AbstractActionPipelineProcessor
+{
+ private Logger log = Logger.getLogger(JBossSTSAction.class);
+
+ private String serviceName;
+ private String portName;
+ private String endpointAddress;
+ private String username;
+ private String password;
+ private String tokenType;
+
+ private boolean lazyInit;
+
+ private WSTrustClient wsTrustClient;
+ private MessagePayloadProxy payloadProxy;
+
+ public JBossSTSAction(final ConfigTree config, final WSTrustClient wsTrustClient) throws ConfigurationException
+ {
+ this(config);
+ AssertArgument.isNotNull(wsTrustClient, "wsTrustClient");
+ this.wsTrustClient = wsTrustClient;
+ }
+
+ public JBossSTSAction(final ConfigTree config) throws ConfigurationException
+ {
+ serviceName = config.getRequiredAttribute(JBossSTSConstants.SERVICE_NAME_OPTION);
+ portName = config.getRequiredAttribute(JBossSTSConstants.PORT_NAME_OPTION);
+ endpointAddress = config.getRequiredAttribute(JBossSTSConstants.ENDPOINT_ADDRESS_OPTION);
+ username = config.getRequiredAttribute(JBossSTSConstants.USERNAME_OPTION);
+ password = config.getRequiredAttribute(JBossSTSConstants.PASSWORD_OPTION);
+ tokenType = config.getRequiredAttribute(JBossSTSConstants.TOKEN_TYPE_OPTION);
+ lazyInit = config.getBooleanAttribute("layzInit", false);
+ payloadProxy = new MessagePayloadProxy(config);
+ }
+
+ @Override
+ public void initialise() throws ActionLifecycleException
+ {
+ if (lazyInit == false)
+ {
+ try
+ {
+ initializeWSTrustClient();
+ }
+ catch (final ParsingException e)
+ {
+ throw new ActionLifecycleException("Caught ParsingException while creating WSTrustClient: ", e);
+ }
+ }
+ }
+
+ private void initializeWSTrustClient() throws ParsingException
+ {
+ if (wsTrustClient == null)
+ {
+ wsTrustClient = new WSTrustClient(serviceName, portName, endpointAddress, new SecurityInfo(username, password));
+ }
+ }
+
+ public Message process(final Message message) throws ActionProcessingException
+ {
+ AssertArgument.isNotNull(message, "message");
+ if (lazyInit)
+ {
+ try
+ {
+ initializeWSTrustClient();
+ }
+ catch (final ParsingException e)
+ {
+ throw new ActionProcessingException("Caught ParsingException while createing WSTrustClient: ", e);
+ }
+ }
+
+ try
+ {
+ final Element assertion = wsTrustClient.issueToken(tokenType);
+ logAssertion(assertion);
+ log.info("SecurityToken valid : " + wsTrustClient.validateToken(assertion));
+
+ payloadProxy.setPayload(message, assertion);
+ }
+ catch (final WSTrustException e)
+ {
+ throw new ActionProcessingException("Caught WSTrustException while calling issueToken: ", e);
+ }
+ catch (final MessageDeliverException e)
+ {
+ throw new ActionProcessingException(e.getMessage(), e);
+ }
+
+ return message;
+ }
+
+ private void logAssertion(final Element assertion)
+ {
+ try
+ {
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ Source source = new DOMSource(assertion);
+ StringWriter writer = new StringWriter();
+ Result result = new StreamResult(writer);
+ transformer.transform(source, result);
+ log.info("Assertion:");
+ log.info(writer.toString());
+ }
+ catch (TransformerConfigurationException e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ catch (TransformerFactoryConfigurationError e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ catch (TransformerException e)
+ {
+ log.error(e.getMessage(), e);
+ }
+
+ }
+
+}
Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSConstants.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSConstants.java 2009-09-10 17:14:21 UTC (rev 29303)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSConstants.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -32,7 +32,7 @@
public static final String ENDPOINT_ADDRESS_OPTION = "endpointAddress";
public static final String USERNAME_OPTION = "username";
public static final String PASSWORD_OPTION = "password";
- public static final String SAML_TOKEN_TYPE_OPTION = "samlTokenType";
+ public static final String TOKEN_TYPE_OPTION = "tokenType";
private JBossSTSConstants()
{
Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSLoginModule.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSLoginModule.java 2009-09-10 17:14:21 UTC (rev 29303)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSLoginModule.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -34,10 +34,10 @@
import org.apache.log4j.Logger;
import org.jboss.identity.federation.api.wstrust.WSTrustClient;
-import org.jboss.identity.federation.api.wstrust.WSTrustException;
import org.jboss.identity.federation.api.wstrust.WSTrustClient.SecurityInfo;
-import org.jboss.identity.federation.api.wstrust.plugins.saml.SAMLUtil;
import org.jboss.identity.federation.core.exceptions.ParsingException;
+import org.jboss.identity.federation.core.wstrust.WSTrustException;
+import org.jboss.identity.federation.core.wstrust.plugins.saml.SAMLUtil;
import org.jboss.identity.federation.saml.v2.assertion.AssertionType;
import org.jboss.identity.federation.saml.v2.assertion.SubjectType;
import org.jboss.security.auth.callback.ObjectCallback;
@@ -50,6 +50,11 @@
* This LoginModule only performs validation of existing SAML
* Assertions and does not issue and such Assertions.
*
+ * Configuration example:
+ * <pre>
+ * </pre>
+ *
+ *
* @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
*/
public class JBossSTSLoginModule implements LoginModule
Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/ws/SamlAssertionExtractor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/ws/SamlAssertionExtractor.java 2009-09-10 17:14:21 UTC (rev 29303)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/services/security/auth/ws/SamlAssertionExtractor.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -97,6 +97,7 @@
{
return null;
}
+
Node samlToken;
try
{
@@ -106,8 +107,15 @@
{
throw new SecurityException("Could not extract saml token info from :" + soap, e);
}
-
- return new AuthenticationRequestImpl.Builder(new SamlPrincipal((Element) samlToken), null).build();
+
+ if (samlToken != null)
+ {
+ return new AuthenticationRequestImpl.Builder(new SamlPrincipal((Element) samlToken), null).build();
+ }
+ else
+ {
+ return null;
+ }
}
private void createSmooks(final String configFile)
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/actions/security/JBossSTSActionUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/actions/security/JBossSTSActionUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/actions/security/JBossSTSActionUnitTest.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.actions.security;
+
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.identity.federation.api.wstrust.WSTrustClient;
+import org.jboss.identity.federation.core.wstrust.plugins.saml.SAMLUtil;
+import org.jboss.identity.federation.saml.v2.assertion.AssertionType;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.security.auth.login.JBossSTSConstants;
+import org.junit.Test;
+import org.w3c.dom.Element;
+
+/**
+ * Unit test for {@link JBossSTSAction}.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class JBossSTSActionUnitTest
+{
+ @Test
+ public void initialiseWSTrustClient() throws Exception
+ {
+ WSTrustClient mockWSTrustclient = mock(WSTrustClient.class);
+ Element securityToken = SAMLUtil.toElement(new AssertionType());
+ when(mockWSTrustclient.issueToken((any(String.class)))).thenReturn(securityToken);
+
+ ConfigTree config = new ConfigBuilder().serviceName("dummy").portName("dummy").endpointAddress("dummy").tokenType("dummy").username("dummy").password("dummy").build();
+ JBossSTSAction stsAction = new JBossSTSAction(config, mockWSTrustclient);
+ stsAction.initialise();
+
+ Message message = MessageFactory.getInstance().getMessage();
+ Message processed = stsAction.process(message);
+ Object object = processed.getBody().get();
+ assertTrue(object instanceof Element);
+
+ }
+
+ @Test (expected = ConfigurationException.class)
+ public void shouldThrowIfServiceNameIsMissing() throws ConfigurationException
+ {
+ new JBossSTSAction(new ConfigBuilder().portName("dummy").endpointAddress("dummy").tokenType("dummy").username("dummy").password("dummy").build());
+ }
+
+ @Test (expected = ConfigurationException.class)
+ public void shouldThrowIfPortNameIsMissing() throws ConfigurationException
+ {
+ new JBossSTSAction(new ConfigBuilder().serviceName("dummy").endpointAddress("dummy").tokenType("dummy").username("dummy").password("dummy").build());
+ }
+
+ @Test (expected = ConfigurationException.class)
+ public void shouldThrowIfEndpointAddresIsMissing() throws ConfigurationException
+ {
+ new JBossSTSAction(new ConfigBuilder().serviceName("dummy").portName("dummy").tokenType("dummy").username("dummy").password("dummy").build());
+ }
+
+ @Test (expected = ConfigurationException.class)
+ public void shouldThrowIfUsernameIsMissing() throws ConfigurationException
+ {
+ new JBossSTSAction(new ConfigBuilder().serviceName("dummy").portName("dummy").endpointAddress("dummy").tokenType("dummy").password("dummy").build());
+ }
+
+ @Test (expected = ConfigurationException.class)
+ public void shouldThrowIfPasswordIsMissing() throws ConfigurationException
+ {
+ new JBossSTSAction(new ConfigBuilder().serviceName("dummy").portName("dummy").endpointAddress("dummy").tokenType("dummy").username("dummy").build());
+ }
+
+ @Test (expected = ConfigurationException.class)
+ public void shouldThrowIfTokenTypeIsMissing() throws ConfigurationException
+ {
+ new JBossSTSAction(new ConfigBuilder().serviceName("dummy").portName("dummy").endpointAddress("dummy").username("dummy").build());
+ }
+
+ private static class ConfigBuilder
+ {
+ private ConfigTree config;
+
+ public ConfigBuilder()
+ {
+ config = new ConfigTree(getClass().getSimpleName());
+ }
+
+ public ConfigBuilder serviceName(final String serviceName)
+ {
+ config.setAttribute(JBossSTSConstants.SERVICE_NAME_OPTION, serviceName);
+ return this;
+ }
+
+ public ConfigBuilder portName(final String portname)
+ {
+ config.setAttribute(JBossSTSConstants.PORT_NAME_OPTION, portname);
+ return this;
+ }
+
+ public ConfigBuilder endpointAddress(final String endpoint)
+ {
+ config.setAttribute(JBossSTSConstants.ENDPOINT_ADDRESS_OPTION, endpoint);
+ return this;
+ }
+
+ public ConfigBuilder tokenType(final String tokenType)
+ {
+ config.setAttribute(JBossSTSConstants.TOKEN_TYPE_OPTION, tokenType);
+ return this;
+ }
+
+ public ConfigBuilder username(final String username)
+ {
+ config.setAttribute(JBossSTSConstants.USERNAME_OPTION, username);
+ return this;
+ }
+
+ public ConfigBuilder password(final String password)
+ {
+ config.setAttribute(JBossSTSConstants.PASSWORD_OPTION, password);
+ return this;
+ }
+
+ public ConfigTree build()
+ {
+ return config;
+ }
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(JBossSTSActionUnitTest.class);
+ }
+
+}
Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSLoginModuleUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSLoginModuleUnitTest.java 2009-09-10 17:14:21 UTC (rev 29303)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/JBossSTSLoginModuleUnitTest.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -34,7 +34,7 @@
import junit.framework.JUnit4TestAdapter;
import org.jboss.identity.federation.api.wstrust.WSTrustClient;
-import org.jboss.identity.federation.api.wstrust.plugins.saml.SAMLUtil;
+import org.jboss.identity.federation.core.wstrust.plugins.saml.SAMLUtil;
import org.jboss.identity.federation.saml.v2.assertion.AssertionType;
import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
@@ -217,7 +217,7 @@
public OptionsBuilder samlTokenType(final String type)
{
- options.put(JBossSTSConstants.SAML_TOKEN_TYPE_OPTION, type);
+ options.put(JBossSTSConstants.TOKEN_TYPE_OPTION, type);
return this;
}
Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/ws/SamlAssertionExtractorUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/ws/SamlAssertionExtractorUnitTest.java 2009-09-10 17:14:21 UTC (rev 29303)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/ws/SamlAssertionExtractorUnitTest.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -29,7 +29,7 @@
import junit.framework.JUnit4TestAdapter;
-import org.jboss.identity.federation.api.wstrust.WSTrustException;
+import org.jboss.identity.federation.core.wstrust.WSTrustException;
import org.jboss.internal.soa.esb.util.StreamUtils;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.util.ClassUtil;
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/build.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/build.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,88 @@
+<project name="Quickstart_Security_Saml" default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- additional deploys -->
+ <property name="additional.deploys" value="jboss-wsse-client.xml"/>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="quickstart-specific-checks" depends="assert-ws-available"/>
+
+
+ <target name="quickstart-specific-dependencies">
+ <path id="quickstart-dependencies-classpath">
+ <fileset dir="${org.jboss.esb.server.home}/client" includes="jbossws-client.jar,jboss-remoting.jar" />
+ </path>
+ </target>
+
+ <target name="quickstart-specific-assemblies">
+ <!-- Overriden from the target of the same name in base-build.xml. -->
+ <!-- Called by the "deploy" target. Don't call directly!! -->
+
+ <!-- Build the webservice... -->
+ <war warfile="build/${ant.project.name}.war"
+ webxml="${basedir}/war/resources/WEB-INF/web.xml">
+ <fileset dir="${basedir}/war/view">
+ <include name="**/*"/>
+ </fileset>
+ </war>
+ </target>
+
+ <target name="runtest" depends="compile" description="sends a JMS message to queue/quickstart_security_saml_gw">
+ <echo>Runs Test JMS Sender</echo>
+ <!--
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securitysaml.test.SendMessage" failonerror="true">
+ <arg value="01" />
+ <arg value="8767" />
+ <classpath refid="exec-classpath" />
+ </java>
+ -->
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securitysaml.test.SendJMSMessage" failonerror="true">
+ <arg value="queue/quickstart_security_saml_gw"/>
+ <arg value="Dummy message payload"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <!--target name="runtest" depends="compile" description="run tests over jms, http, and socket">
+ <antcall target="saygoodbye_over_http" />
+ </target-->
+
+ <target name="saygoodbye_over_http" depends="compile">
+ <echo></echo>
+ <echo>Invoke JBR Gateway with successful login</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securitysaml.test.SendMessage" failonerror="true">
+ <arg value="01" />
+ <arg value="8765" />
+ <classpath refid="exec-classpath" />
+ </java>
+ <echo></echo>
+ <echo></echo>
+ <echo>Invoke JBR Gateway with unsuccessful login</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securitysaml.test.SendMessage" failonerror="true">
+ <arg value="02" />
+ <arg value="8765" />
+ <classpath refid="exec-classpath" />
+ </java>
+ </target>
+
+ <target name="quickstart-specific-deploys">
+ <copy todir="${build.dir}" filtering="true" overwrite="true">
+
+ <filterset>
+ <filter token="KEYSTORE_PATH" value="${basedir}/keystore"/>
+ <filter token="ROLES_FILE_PATH" value="${basedir}/roles.properties"/>
+ </filterset>
+ <fileset dir="${basedir}">
+ <include name="login-config.xml"/>
+ </fileset>
+ </copy>
+ </target>
+
+
+</project>
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/deployment.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/deployment.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,7 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=soap.esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_saml_gw</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_saml_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_saml_esb_reply
+ </depends>
+</jbossesb-deployment>
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbm-queue-service.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_saml_gw"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_saml_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_saml_esb_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbmq-queue-service.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_saml_gw">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_saml_esb">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_saml_esb_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jboss-esb.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,66 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
+ xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
+ parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMessageing" connection-factory="ConnectionFactory">
+ <jms-bus busid="quickstartGatewayChannel">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_security_saml_gw"/>
+ </jms-bus>
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_security_saml_esb"/>
+ </jms-bus>
+ </jms-provider>
+
+ <jbr-provider name="JBR-Http" protocol="http" host="localhost">
+ <jbr-bus busid="Http-1" port="8765" />
+ </jbr-provider>
+
+ </providers>
+
+ <services>
+
+ <service category="SamlSecurityQuickstart" name="unsecuredService" description="" invmScope="GLOBAL">
+ <listeners>
+ <jms-listener name="JMSGatewayListener" busidref="quickstartGatewayChannel" is-gateway="true"/>
+ </listeners>
+
+ <actions mep="OneWay">
+ <action name="print-before" class="org.jboss.soa.esb.samples.quickstart.securitysaml.PrintSubjectAction"/>
+
+ <action name="issueToken" class="org.jboss.soa.esb.actions.security.JBossSTSAction">
+ <property name="serviceName" value="JBossSTS"/>
+ <property name="portName" value="JBossSTSPort"/>
+ <property name="endpointAddress" value="http://localhost:8080/jboss-sts/JBossSTS"/>
+ <property name="username" value="beve"/>
+ <property name="password" value="beve"/>
+ <property name="tokenType" value="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"/>
+ <property name="lazyInit" value="false"/>
+ </action>
+
+ </actions>
+ </service>
+
+
+ <service category="SamlSecurityQuickstart" name="securedService" description="">
+ <security moduleName="jbossesb-saml" rolesAllowed="admin" callbackHandler="org.jboss.soa.esb.services.security.auth.login.JBossSTSCallbackHandler"/>
+
+ <listeners>
+ <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true"/>
+ <jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel"/>
+ </listeners>
+ <actions>
+
+ <action name="print-before" class="org.jboss.soa.esb.samples.quickstart.securitysaml.PrintSubjectAction"/>
+
+ <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
+ <property name="jbossws-endpoint" value="GoodbyeWorldWS"/>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+ </actions>
+ </service>
+
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jboss-wsse-client.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jboss-wsse-client.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jboss-wsse-client.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <config>
+ <username/>
+ </config>
+</jboss-ws-security>
+
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jbossesb-properties.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2006, JBoss Inc., and others contributors as indicated
+ by the @authors tag. All rights reserved.
+ See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ 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,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+ (C) 2005-2006,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="${jboss.esb.bind.address}:1099"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="org.jboss.soa.esb.loadbalancer.policy" value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
+ </properties>
+ <properties name="security">
+ <property name="org.jboss.soa.esb.services.security.implementationClass" value="org.jboss.internal.soa.esb.services.security.JaasSecurityService"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.registry.local.PublishService#publish"/>
+ <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password" value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ <property name="org.jboss.soa.esb.mail.smtp.auth" value="true"/>
+ <property name="org.jboss.soa.esb.ftp.localdir" value="/tmp"/>
+ <property name="org.jboss.soa.esb.ftp.remotedir" value="/tmp"/>
+ <property name="org.jboss.soa.esb.jms.connectionPool" value="20"/>
+ <property name="org.jboss.soa.esb.jms.sessionSleep" value="30"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool-size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+
+ <!-- connection manager type -->
+ <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/> -->
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
+
+ <!-- this property is only used if using the j2ee connection manager -->
+ <property name="org.jboss.soa.esb.persistence.db.datasource.name" value="java:/JBossESBDS"/>
+
+ <!-- standalone connection pooling settings -->
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+
+ </properties>
+ <properties name="filters">
+ <property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
+ <property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
+ </properties>
+</esb>
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jndi.properties
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jndi.properties (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/jndi.properties 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/log4j.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/log4j.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="INFO"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/login-config.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/login-config.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/login-config.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,24 @@
+ <!-- Copy+Paste *into* <server>/<configname>/conf/login-config.xml -->
+
+ <application-policy name = "CertLogin">
+ <authentication>
+ <login-module code = "org.jboss.soa.esb.services.security.auth.login.CertificateLoginModule" flag = "required" >
+ <module-option name = "keyStoreURL">file://@KEYSTORE_PATH@</module-option>
+ <module-option name = "keyStorePassword">storepassword</module-option>
+ <module-option name = "rolesPropertiesFile">file://@ROLES_FILE_PATH@</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <application-policy name = "jbossesb-saml">
+ <authentication>
+ <login-module code="org.jboss.soa.esb.services.security.auth.login.JBossSTSLoginModule" flag="required">
+ <module-option name="serviceName">JBossSTS</module-option>
+ <module-option name="portName">JBossSTSPort</module-option>
+ <module-option name="endpointAddress">http://localhost:8080/jboss-sts/JBossSTS</module-option>
+ <module-option name="username">admin</module-option>
+ <module-option name="password">admin</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/readme.txt
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/readme.txt (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/readme.txt 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,55 @@
+Overview:
+=========
+ This quickstart demonstrates JBossESB support for SAML. The SAML support is provided by
+ JBoss Security Token Service (JBossSTS).
+
+ The following will be demonstrated by this quickstart:
+ * Configuring a service to use JBossSTSLoginModule to validate a SAML Assertion.
+ * Calling WS gateway with a SAML Assertion previously requested from JBossSTS
+
+ * Using the JBossSTSAction to request a SAML Assertion from JBossSTS
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run:
+===========================
+ 1. Type 'ant deploy'.
+ 1. Copy+Paste the contents of ./login-config.xml *into* <server>/<configname>/conf/login-config.xml
+ 2. Deploy jboss-sts.war to the application server by copying it into the deploy directory.
+ 3. Start the server.
+ 5. 'ant runtest' will send a HTTP request to a JBossRemoting Gatway
+ 6. 'ant sendesb' will invoke the Service directly using the ServiceInvoker
+
+What to look for in this quickstart
+===================================
+ # Security configuration
+ <service category="Security" name="SimpleListenerSecured" description="Hello World">
+ <security moduleName="jbossesb" rolesAllowed="esbrole"/>
+ The security element declares that this service requires authentication to be executed and that the
+ authenticated users be a member in the role 'esbrole'. The role is determined by the JAAS login
+ module being used, in this case by the 'jbossesb' module specified in login-config.xml.
+
+ # src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/HttpClient.java
+ This is a JBossRemoting client that uses http to invoke the JBossRemoting gateway.
+
+ # src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/SendEsbMessage.java
+ This class uses the ServiceInvoker to invoke the ESB service directly, by-passing the gateway.
+ You can see how an AuthenticationRequest is created then encrypted, and passed to the ESB
+ by attaching the authentication request to the ESB Message object.
+
+ # src/org/jboss/soa/esb/samples/quickstart/securitybasic/MyListenerAction.java
+ This ESB Action show how the currently autenticated JAAS Subject can be accessed:
+ System.out.println("Subject in MyListenerAction : " + Subject.getSubject(AccessController.getContext()));
+
+ # esb-users-properties
+ User/password configuration.
+
+ # esb-roles.properties
+ Roles/users configuration.
+
+ # Please refer to the "Security" section of the ServiceGuide.pdf for more details on the security features of JBossESB.
+
+
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/PrintSubjectAction.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/PrintSubjectAction.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/PrintSubjectAction.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.securitysaml;
+
+
+import java.net.URL;
+import java.io.File;
+import java.io.FilePermission;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.CodeSource;
+import java.security.Permissions;
+import java.security.PermissionCollection;
+import java.security.Policy;
+
+import javax.security.auth.Subject;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class PrintSubjectAction extends AbstractActionLifecycle
+{
+
+ protected ConfigTree config;
+
+ public PrintSubjectAction(ConfigTree config) throws ConfigurationException
+ {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception
+ {
+ System.out.println("SecurityContext " + message.getProperties().getProperty("org.jboss.soa.esb.services.security.context"));
+ System.out.println("Subject : " + Subject.getSubject(AccessController.getContext()));
+ return message;
+ }
+
+}
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/SendJMSMessage.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.securitysaml.test;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.Client;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.net.InetAddress;
+
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+ public void sendMessageOverJMS(String message, String destination) throws JMSException, NamingException {
+ QueueSender sender = null;
+
+ setupJMSConnection(destination);
+ try {
+ ObjectMessage tm = null;
+
+ sender = session.createSender(que);
+ tm = session.createObjectMessage(message);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "SecuritySamlTest.log");
+ sender.send(tm);
+ } finally {
+ if(sender != null) {
+ sender.close();
+ }
+ cleanupJMSConnection();
+ }
+ }
+
+ public void setupJMSConnection(final String destination) throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup(destination);
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ }
+
+ public void cleanupJMSConnection() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public static void main(String... args) throws Throwable
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ String destination = args[0];
+ String payload = args[1];
+
+ try
+ {
+ sm.sendMessageOverJMS(payload, destination);
+ }
+ catch(final Exception e)
+ {
+ System.err.println("Call was not successful. See server.log for details. Exception was:");
+ e.printStackTrace();
+ }
+ }
+}
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/SendMessage.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/SendMessage.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/SendMessage.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.securitysaml.test;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.Client;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.net.InetAddress;
+
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
+public class SendMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+ public void sendMessageOverJMS(String message) throws JMSException, NamingException {
+ QueueSender sender = null;
+
+ setupJMSConnection();
+ try {
+ ObjectMessage tm = null;
+
+ sender = session.createSender(que);
+ tm = session.createObjectMessage(message);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "WebServiceProducerTest.log");
+ sender.send(tm);
+ } finally {
+ if(sender != null) {
+ sender.close();
+ }
+ cleanupJMSConnection();
+ }
+ }
+
+ private void sendMessageToJBRListener(String protocol, int port, String message) throws Throwable {
+ String locatorURI = protocol + "://localhost:" + port;
+ InvokerLocator locator = new InvokerLocator(locatorURI);
+ System.out.println("Calling JBoss Remoting Listener using locator URI: " + locatorURI);
+
+ Client remotingClient = null;
+ try {
+ remotingClient = new Client(locator);
+ remotingClient.connect();
+
+ // Deliver the message to the listener...
+ Object response = remotingClient.invoke(message);
+ System.out.println("JBR Class: " + response.getClass().getName());
+ System.out.println("Response from JBoss Remoting Listener '" + locatorURI + "' was '" + response + "'.");
+ } finally {
+ if(remotingClient != null) {
+ remotingClient.disconnect();
+ }
+ }
+ }
+
+ public void setupJMSConnection() throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_security_cert_secured_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ }
+
+ public void cleanupJMSConnection() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ private static String getMessage(String messageNum) {
+ String msg = new String(StreamUtils.readStream(SendMessage.class.getResourceAsStream("soap_message_" + messageNum + ".xml")));
+ return msg;
+ }
+
+ public static void main(String args[]) throws Throwable
+ {
+ SendMessage sm = new SendMessage();
+ String msg = getMessage(args[0]);
+
+ try
+ {
+ sm.sendMessageToJBRListener("http", Integer.parseInt(args[1]), msg);
+ }
+ catch(final Exception e)
+ {
+ System.err.println("Call was not successful. See server.log for details. Exception was:");
+ e.printStackTrace();
+ }
+ }
+}
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/soap_message_01.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/soap_message_01.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/soap_message_01.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,22 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://security_cert/goodbyeworld">
+ <soapenv:Header>
+ <wsse:Security xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'>
+ <wsse:BinarySecurityToken EncodingType='wsse:Base64Binary' ValueType='wsse:X509v3'>MIICVDCCAb0CBEj0PZ4wDQYJKoZIhvcNAQEEBQAwcTELMAkGA1UEBhMCU0UxEjAQBgNVBAgTCVN0
+b2NraG9sbTESMBAGA1UEBxMJU3RvY2tob2xtMRAwDgYDVQQKEwdSZWQgSGF0MQ4wDAYDVQQLEwVK
+Qm9zczEYMBYGA1UEAxMPRGFuaWVsIEJldmVuaXVzMB4XDTA4MTAxNDA2MzUxMFoXDTExMDcxMDA2
+MzUxMFowcTELMAkGA1UEBhMCU0UxEjAQBgNVBAgTCVN0b2NraG9sbTESMBAGA1UEBxMJU3RvY2to
+b2xtMRAwDgYDVQQKEwdSZWQgSGF0MQ4wDAYDVQQLEwVKQm9zczEYMBYGA1UEAxMPRGFuaWVsIEJl
+dmVuaXVzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCPwfTNhUsBYIi+h5mt/tzcHRl2Uh//
+/alzFsGint0rlFRRa/LJ/6XSwviVbMXitpqUCw3Qknf6e4xRFJpfv35FALqyRJmwMjsgpy9GjWM9
+HHpCXetrpop7sWF3C8etwfv1T/mKk6jcQ4tX2So2Wjv1Lb3zqj/5Pgj8Pcy+oecZfwIDAQABMA0G
+CSqGSIb3DQEBBAUAA4GBADWjrmaDi01ZUAIAHim6hnNbuh9X+uszrkwglSjVDOKkuPjX8lgrlR9i
+jNP7gnwGg2+bQXW4P17BViwN9Kd00+hNkXw9smimPvUnGRAbX/I8ntQqfKs3dq1E3yBT4NZmb3Bc
+h6tJtOWrUv0mEl1pkOGFcDvP5Gsq70jAtwC/9Cge</wsse:BinarySecurityToken>
+ </wsse:Security>
+ </soapenv:Header>
+ <soapenv:Body>
+ <good:sayGoodbye>
+ <message>Goodbye!!</message>
+ </good:sayGoodbye>
+ </soapenv:Body>
+</soapenv:Envelope>
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/soap_message_02.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/soap_message_02.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/test/soap_message_02.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,21 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://security_cert/goodbyeworld">
+ <soapenv:Header>
+ <wsse:Security xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'>
+ <wsse:BinarySecurityToken EncodingType='wsse:Base64Binary' ValueType='wsse:X509v3'>MIICIjCCAYsCBEj0TGMwDQYJKoZIhvcNAQEEBQAwWDELMAkGA1UEBhMCQkIxDDAKBgNVBAgTA0Jh
+ZDEMMAoGA1UEBxMDQmFkMQwwCgYDVQQKEwNCYWQxDDAKBgNVBAsTA0JhZDERMA8GA1UEAxMIQmFk
+IHVzZXIwHhcNMDgxMDE0MDczODExWhcNMTEwNzEwMDczODExWjBYMQswCQYDVQQGEwJCQjEMMAoG
+A1UECBMDQmFkMQwwCgYDVQQHEwNCYWQxDDAKBgNVBAoTA0JhZDEMMAoGA1UECxMDQmFkMREwDwYD
+VQQDEwhCYWQgdXNlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAhlb/SagmAPrp5+CqSexB
+/X/GhdtaYXQHY0rKvyE/E2g5bKsXDcNAUu9ZwHmUHIPoyHTGTdQbYgQVbehOPys2RiyQr7MOP1L7
+X+H2YC6Fce55eydFliIFDKq9+991fmPSOZ6lz/vYnfN4fEwMuw4CbJ2Zlt+vb44AvVVyZHZpZykC
+AwEAATANBgkqhkiG9w0BAQQFAAOBgQB5fMiT7ApyoUoP3dq9rmpjrUxKIxBvbkWCWrR9KyN7kPT6
+/zDcqlmljjhVWZdOEQ6dTOmuA56fvNE8WO1xLq6F+OZZni3IDQ/cPgqEa/REOuv+tFGK08Te0WIe
+3Ff5vodp0s+H/X75X2Sy3ZbZMXCV115q5rASRbOjsxE5fVaRMw==</wsse:BinarySecurityToken>
+ </wsse:Security>
+ </soapenv:Header>
+ <soapenv:Body>
+ <good:sayGoodbyeWithoutResponse>
+ <message>Goodbye!!</message>
+ </good:sayGoodbyeWithoutResponse>
+ </soapenv:Body>
+</soapenv:Envelope>
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/webservice/GoodbyeWorldWS.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/webservice/GoodbyeWorldWS.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/src/org/jboss/soa/esb/samples/quickstart/securitysaml/webservice/GoodbyeWorldWS.java 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,54 @@
+package org.jboss.soa.esb.samples.quickstart.securitysaml.webservice;
+
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.jws.Oneway;
+import javax.jws.WebParam;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.actions.soap.SOAPProcessor;
+
+/**
+ * @author
+ */
+ at WebService(name = "GoodbyeWorldWS", targetNamespace="http://security_saml/goodbyeworld")
+public class GoodbyeWorldWS {
+
+ @WebMethod
+ public String sayGoodbye(@WebParam(name="message") String message) {
+
+ Message esbMessage = SOAPProcessor.getMessage();
+ if(esbMessage != null) {
+ System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
+ // System.out.println("\n" + esbMessage.toString() + "\n");
+ }
+ System.out.println("Web Service Parameter - message=" + message);
+ return "... Ah Goodbye then!!!! - " + message;
+ }
+
+ @WebMethod
+ public String sayAdios(String message) {
+ Message esbMessage = SOAPProcessor.getMessage();
+ if(esbMessage != null) {
+ System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
+ // System.out.println("\n" + esbMessage.toString() + "\n");
+ }
+ System.out.println("Web Service Parameter - message=" + message);
+ return "... Adios Amigo!!!! - " + message;
+ }
+
+ @WebMethod
+ @Oneway
+ public void sayGoodbyeWithoutResponse(@WebParam(name="message") String message) {
+
+ Message esbMessage = SOAPProcessor.getMessage();
+ if(esbMessage != null) {
+ System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
+ }
+ System.out.println("Web Service Parameter - message=" + message);
+ }
+
+}
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/resources/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/resources/WEB-INF/web.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/resources/WEB-INF/web.xml 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>GoodbyeWorldWS</servlet-name>
+ <servlet-class>org.jboss.soa.esb.samples.quickstart.securitycert.webservice.GoodbyeWorldWS</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>GoodbyeWorldWS</servlet-name>
+ <url-pattern>/GoodbyeWorldWS</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added: labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/view/index.jsp
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/view/index.jsp (rev 0)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/samples/quickstarts/security_saml/war/view/index.jsp 2009-09-10 21:01:12 UTC (rev 29304)
@@ -0,0 +1,9 @@
+<html>
+ <body>
+ This is just a place holder.<br>
+ Verify the that the WS has been deployed by hitting
+ <a href="http://localhost:8080/jbossws">
+ http://localhost:8080/jbossws
+ </a>
+ </body>
+</html>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list