use of javax.xml.ws.soap.SOAPFaultException in project wildfly by wildfly.
the class EJBSignEncryptMultipleClientsTestCase 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", "EJBEncryptSecurityService");
URL wsdlURL = new URL(baseUrl, "/jaxws-wsse-sign-encrypt-mc/EJBEncryptSecurityService?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 test123GetConfigAsNobodyGoodPasswordDigest.
@Test
public void test123GetConfigAsNobodyGoodPasswordDigest() throws Exception {
final String TEST_NAME = "test123GetConfigAsNobodyGoodPasswordDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_NOBODY_USERNAME, USER_NOBODY_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 authorizations");
}
use of javax.xml.ws.soap.SOAPFaultException in project midpoint by Evolveum.
the class TestWSSecurity method test105GetConfigWrongUsernameDigest.
@Test
public void test105GetConfigWrongUsernameDigest() throws Exception {
final String TEST_NAME = "test105GetConfigWrongUsernameDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort("admin", 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 user");
}
use of javax.xml.ws.soap.SOAPFaultException in project midpoint by Evolveum.
the class TestWSSecurity method test104GetConfigEmptyPasswordText.
@Test
public void test104GetConfigEmptyPasswordText() throws Exception {
final String TEST_NAME = "test104GetConfigEmptyPasswordText";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_ADMINISTRATOR_USERNAME, "", WSConstants.PW_TEXT);
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, "could not be authenticated or authorized");
}
use of javax.xml.ws.soap.SOAPFaultException in project midpoint by Evolveum.
the class TestWSSecurity method test131GetConfigAsCyclopsGoodPasswordDigest.
@Test
public void test131GetConfigAsCyclopsGoodPasswordDigest() throws Exception {
final String TEST_NAME = "test131GetConfigAsCyclopsGoodPasswordDigest";
displayTestTitle(TEST_NAME);
modelPort = createModelPort(USER_CYCLOPS_USERNAME, USER_CYCLOPS_PASSWORD, WSConstants.PW_DIGEST);
Holder<ObjectType> objectHolder = new Holder<ObjectType>();
Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
LogfileTestTailer tailer = createLogTailer();
// WHEN
try {
modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
AssertJUnit.fail("Unexpected success");
} catch (SOAPFaultException e) {
assertSoapFault(e, "FailedAuthentication", "could not be authenticated or authorized");
}
tailer.tail();
assertAuditLoginLogout(tailer);
}
Aggregations