use of javax.xml.ws.soap.SOAPFaultException in project midpoint by Evolveum.
the class TestWSSecurity method test101GetConfigWrongPasswordDigest.
@Test
public void test101GetConfigWrongPasswordDigest() throws Exception {
final String TEST_NAME = "test101GetConfigWrongPasswordDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_ADMINISTRATOR_USERNAME, "wrongAdministratorPassword", 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, "could not be authenticated or authorized");
}
use of javax.xml.ws.soap.SOAPFaultException in project midpoint by Evolveum.
the class TestWSSecurity method test102GetConfigWrongPasswordText.
@Test
public void test102GetConfigWrongPasswordText() throws Exception {
final String TEST_NAME = "test102GetConfigWrongPasswordText";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_ADMINISTRATOR_USERNAME, "wrongAdministratorPassword", 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");
}
}
use of javax.xml.ws.soap.SOAPFaultException in project midpoint by Evolveum.
the class TestWSSecurity method test145ModifyConfigAsDarthAdder.
@Test
public void test145ModifyConfigAsDarthAdder() throws Exception {
final String TEST_NAME = "test145ModifyConfigAsDarthAdder";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
ObjectReferenceType ref = new ObjectReferenceType();
// fake
ref.setOid("c4e998e6-d903-11e4-9aaf-001e8c717e5b");
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(SystemConfigurationType.class, SystemObjectsType.SYSTEM_CONFIGURATION.value(), "globalSecurityPolicyRef", ModificationTypeType.REPLACE, ref);
try {
// WHEN
modelPort.executeChanges(deltaList, null);
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 midpoint by Evolveum.
the class TestWSSecurity method test103GetConfigEmptyPasswordDigest.
@Test
public void test103GetConfigEmptyPasswordDigest() throws Exception {
final String TEST_NAME = "test103GetConfigEmptyPasswordDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_ADMINISTRATOR_USERNAME, "", 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, "could not be authenticated or authorized");
}
use of javax.xml.ws.soap.SOAPFaultException in project midpoint by Evolveum.
the class TestWSSecurity method test122GetConfigAsNobodyEmptyPasswordDigest.
@Test
public void test122GetConfigAsNobodyEmptyPasswordDigest() throws Exception {
final String TEST_NAME = "test103GetConfigEmptyPasswordDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_NOBODY_USERNAME, "", 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");
}
Aggregations