if(authType == null){
inError = true;
error.setErrorText("Could not determine auth-type from request.");
} else {
if(authType.equals(AuthType.BASIC)){
BasicAuth basicAuth = auth.getBasicAuth();
if(basicAuth == null){
inError = true;
error.setErrorText("Request did not contain BasicAuth info.");
} else {
if(basicAuth.getUsername() == null || basicAuth.getUsername().isEmpty()){
inError = true;
error.setErrorText("Username must not be empty for Basic authentication type.");
}
if(basicAuth.getPassword() == null || basicAuth.getPassword().length <= 0){
inError = true;
error.setErrorText(error.getErrorText()+" Password must not be empty for Basic authentication type.");
}
}
}
else if(authType.equals(AuthType.WSSE)){
WSSEAuth basicAuth = auth.getWsseAuth();
if(basicAuth == null){
inError = true;
error.setErrorText("Request did not contain WsseAuth info.");
} else {
if(basicAuth.getUsername() == null || basicAuth.getUsername().isEmpty()){
inError = true;
error.setErrorText("Username must not be empty for WSSE authentication type.");
}
if(basicAuth.getPassword() == null || basicAuth.getPassword().length <= 0){
inError = true;
error.setErrorText(error.getErrorText()+" Passowrd must not be empty for WSSE authentication type.");
}
}
}