use of javax.xml.ws.soap.SOAPFaultException in project midpoint by Evolveum.
the class TestWSSecurity method test143GetConfigAsDarthAdderGoodPasswordDigest.
@Test
public void test143GetConfigAsDarthAdderGoodPasswordDigest() throws Exception {
final String TEST_NAME = "test143GetConfigAsDarthAdderGoodPasswordDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD, WSConstants.PW_DIGEST);
Holder<ObjectType> objectHolder = new Holder<ObjectType>();
Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
try {
/// WHEN
modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
AssertJUnit.fail("Unexpected success");
} catch (SOAPFaultException e) {
assertSoapSecurityFault(e, "FailedAuthentication", "could not be authenticated or authorized");
}
// THEN
tailer.tail();
assertAuditLoginFailed(tailer, "user disabled");
}
use of javax.xml.ws.soap.SOAPFaultException in project wildfly by wildfly.
the class EJBEndpoint method helloError.
public String helloError(String input) {
try {
SOAPFault fault = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL).createFault(input, SOAPConstants.SOAP_VERSIONMISMATCH_FAULT);
fault.setFaultActor("mr.actor");
fault.addDetail().addChildElement("test");
fault.appendFaultSubcode(new QName("http://ws.gss.redhat.com/", "NullPointerException"));
fault.appendFaultSubcode(new QName("http://ws.gss.redhat.com/", "OperatorNotFound"));
throw new SOAPFaultException(fault);
} catch (SOAPException ex) {
ex.printStackTrace();
}
return "Failure!";
}
use of javax.xml.ws.soap.SOAPFaultException in project wildfly by wildfly.
the class SignEncryptMultipleClientsTestCase method encryptedAndSignedRequestFromUntrustedMax.
/*
* Max's public key is not trusted in Bob's keystore
* Max's keystore contain's Bob's public key as trusted.
*/
@Test
public void encryptedAndSignedRequestFromUntrustedMax() throws Exception {
QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "EncryptSecurityService");
URL wsdlURL = new URL(baseUrl.toString() + "EncryptSecurityService?wsdl");
//use a new bus to avoid any possible clash with other tests
Service service = Service.create(wsdlURL, serviceName, new UseNewBusFeature());
ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
setupWsse(proxy, "max");
try {
proxy.sayHello();
Assert.fail("Max shouldn't invoke this service");
} catch (SOAPFaultException ex) {
// expected failure because max isn't trusted
}
}
use of javax.xml.ws.soap.SOAPFaultException in project midpoint by Evolveum.
the class TestWSSecurity method test107GetConfigBlankUsernameDigest.
@Test
public void test107GetConfigBlankUsernameDigest() throws Exception {
final String TEST_NAME = "test107GetConfigBlankUsernameDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(" ", USER_ADMINISTRATOR_PASSWORD, WSConstants.PW_DIGEST);
Holder<ObjectType> objectHolder = new Holder<ObjectType>();
Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
// WHEN
try {
modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
AssertJUnit.fail("Unexpected success");
} catch (SOAPFaultException e) {
assertSoapSecurityFault(e, "FailedAuthentication", "could not be authenticated or authorized");
}
tailer.tail();
assertAuditLoginFailed(tailer, "no username");
}
use of javax.xml.ws.soap.SOAPFaultException in project midpoint by Evolveum.
the class TestWSSecurity method test166GetConfigAsDarthAdder.
/**
* Darth Adder has no password.
*/
@Test
public void test166GetConfigAsDarthAdder() throws Exception {
final String TEST_NAME = "test166GetConfigAsDarthAdder";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD_NEW2, WSConstants.PW_DIGEST);
Holder<ObjectType> objectHolder = new Holder<ObjectType>();
Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
try {
/// WHEN
modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
AssertJUnit.fail("Unexpected success");
} catch (SOAPFaultException e) {
assertSoapSecurityFault(e, "FailedAuthentication", "could not be authenticated or authorized");
}
// THEN
tailer.tail();
assertAuditLoginFailed(tailer, "no credentials in user");
}
Aggregations