use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.
the class TransportBindingTest method testSAML2.
@org.junit.Test
public void testSAML2() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = TransportBindingTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = TransportBindingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportSAML2Port");
DoubleItPortType transportSaml2Port = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml2Port, test.getPort());
TokenTestUtils.updateSTSPort((BindingProvider) transportSaml2Port, test.getStsPort());
if (test.isStreaming()) {
SecurityTestUtil.enableStreaming(transportSaml2Port);
}
doubleIt(transportSaml2Port, 25);
((java.io.Closeable) transportSaml2Port).close();
bus.shutdown(true);
}
use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.
the class TransportBindingTest method testSAML2SymmetricEndorsingDerived.
@org.junit.Test
public void testSAML2SymmetricEndorsingDerived() throws Exception {
// Only works for DOM (clients)
if (test.isStreaming()) {
return;
}
SpringBusFactory bf = new SpringBusFactory();
URL busFile = TransportBindingTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = TransportBindingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportSAML2SymmetricEndorsingDerivedPort");
DoubleItPortType transportSaml1Port = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml1Port, test.getPort());
TokenTestUtils.updateSTSPort((BindingProvider) transportSaml1Port, test.getStsPort());
if (test.isStreaming()) {
SecurityTestUtil.enableStreaming(transportSaml1Port);
}
doubleIt(transportSaml1Port, 25);
((java.io.Closeable) transportSaml1Port).close();
bus.shutdown(true);
}
use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.
the class TransportBindingTest method testSAML1Endorsing.
@org.junit.Test
public void testSAML1Endorsing() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = TransportBindingTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = TransportBindingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportSAML1EndorsingPort");
DoubleItPortType transportSaml1Port = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml1Port, test.getPort());
TokenTestUtils.updateSTSPort((BindingProvider) transportSaml1Port, test.getStsPort());
if (test.isStreaming()) {
SecurityTestUtil.enableStreaming(transportSaml1Port);
}
doubleIt(transportSaml1Port, 25);
((java.io.Closeable) transportSaml1Port).close();
bus.shutdown(true);
}
use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.
the class TransportBindingTest method testUnknownClient.
/**
* In this test-case, the client sends another cert to the STS for inclusion in the
* SAML Assertion and connects via 2-way TLS as normal to the service provider. The
* service provider will fail, as the TLS cert does not match the cert provided in
* the SAML Assertion.
*/
@org.junit.Test
public void testUnknownClient() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = TransportBindingTest.class.getResource("cxf-bad-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = TransportBindingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportSAML1Port");
DoubleItPortType transportSaml1Port = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml1Port, test.getPort());
TokenTestUtils.updateSTSPort((BindingProvider) transportSaml1Port, test.getStsPort());
if (test.isStreaming()) {
SecurityTestUtil.enableStreaming(transportSaml1Port);
}
try {
doubleIt(transportSaml1Port, 35);
fail("Expected failure on an unknown client");
} catch (javax.xml.ws.soap.SOAPFaultException fault) {
// expected
}
((java.io.Closeable) transportSaml1Port).close();
bus.shutdown(true);
}
use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.
the class TransportBindingTest method testSAML2SymmetricEndorsing.
@org.junit.Test
public void testSAML2SymmetricEndorsing() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = TransportBindingTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = TransportBindingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportSAML2SymmetricEndorsingPort");
DoubleItPortType transportSaml1Port = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml1Port, test.getPort());
TokenTestUtils.updateSTSPort((BindingProvider) transportSaml1Port, test.getStsPort());
if (test.isStreaming()) {
SecurityTestUtil.enableStreaming(transportSaml1Port);
}
doubleIt(transportSaml1Port, 25);
((java.io.Closeable) transportSaml1Port).close();
bus.shutdown(true);
}
Aggregations