summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2019-06-28 13:12:57 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2019-06-28 13:12:57 +0200
commitc691a7d27dfc5416c2776e960bad5607308395b9 (patch)
treec36972d651b274f2b9170f21df47b41dd21ae33b
parent8556c8dce6b5ab9053a40b01817b5a2f29eeccd5 (diff)
downloadEAAF-Components-c691a7d27dfc5416c2776e960bad5607308395b9.tar.gz
EAAF-Components-c691a7d27dfc5416c2776e960bad5607308395b9.tar.bz2
EAAF-Components-c691a7d27dfc5416c2776e960bad5607308395b9.zip
remove work-around for A-Trust
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualeIDTask.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualeIDTask.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualeIDTask.java
index 761c8b24..cb9f54e3 100644
--- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualeIDTask.java
+++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualeIDTask.java
@@ -60,7 +60,7 @@ public abstract class AbstractReceiveQualeIDTask extends AbstractAuthServletTask
//A-Trust does not SET http-header 'SL2ClientType' with value 'native'
//If A-trust sends an error, its maybe FrontChannel on DataURL
- boolean aTrustErrorWorkAround = false;
+ //boolean aTrustErrorWorkAround = false;
try {
//get SL2.0 command or result from HTTP request
@@ -108,7 +108,7 @@ public abstract class AbstractReceiveQualeIDTask extends AbstractAuthServletTask
SL20Constants.SL20_COMMAND_PARAM_GENERAL_RESPONSE_ERRORMESSAGE, false);
log.info("Receiving errorcode: {} with msg: {} from VDA! Stopping auth-process ... ");
- aTrustErrorWorkAround = true;
+ //aTrustErrorWorkAround = true;
throw new SL20Exception("sl20.08", new Object[] {errorCode, errorMsg});
} else {
@@ -174,7 +174,8 @@ public abstract class AbstractReceiveQualeIDTask extends AbstractAuthServletTask
//write SL2.0 response
if (sl20ReqObj != null)
- buildResponse(request, response, sl20ReqObj, aTrustErrorWorkAround);
+ //buildResponse(request, response, sl20ReqObj, aTrustErrorWorkAround);
+ buildResponse(request, response, sl20ReqObj);
else
buildErrorResponse(request, response, "2000", "General transport Binding error");
@@ -206,13 +207,16 @@ public abstract class AbstractReceiveQualeIDTask extends AbstractAuthServletTask
private void buildErrorResponse(HttpServletRequest request, HttpServletResponse response, String errorCode, String errorMsg) throws Exception {
final ObjectNode error = SL20JSONBuilderUtils.createErrorCommandResult(errorCode, errorMsg);
- final ObjectNode respContainer = SL20JSONBuilderUtils.createGenericRequest(
- UUID.randomUUID().toString(),
+ final ObjectNode errorCommand = SL20JSONBuilderUtils.createCommandResponse(SL20Constants.SL20_COMMAND_IDENTIFIER_ERROR, error, null);
+
+
+ final ObjectNode respContainer = SL20JSONBuilderUtils.createGenericResponse(
+ UUID.randomUUID().toString(),
+ null,
null,
- error ,
+ errorCommand ,
null);
-
- log.debug("Client request containts 'native client' header ... ");
+
log.trace("SL20 response to VDA: " + respContainer);
final StringWriter writer = new StringWriter();
writer.write(respContainer.toString());
@@ -224,7 +228,7 @@ public abstract class AbstractReceiveQualeIDTask extends AbstractAuthServletTask
}
- private void buildResponse(HttpServletRequest request, HttpServletResponse response, JsonNode sl20ReqObj, boolean aTrustErrorWorkAround) throws IOException, SL20Exception, URISyntaxException {
+ private void buildResponse(HttpServletRequest request, HttpServletResponse response, JsonNode sl20ReqObj) throws IOException, SL20Exception, URISyntaxException {
//create response
final Map<String, String> reqParameters = new HashMap<String, String>();
reqParameters.put(EAAFConstants.PARAM_HTTP_TARGET_PENDINGREQUESTID, pendingReq.getPendingRequestId());
@@ -257,8 +261,7 @@ public abstract class AbstractReceiveQualeIDTask extends AbstractAuthServletTask
//workaround for A-Trust
if (request.getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE) != null &&
- request.getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE).equals(SL20Constants.HTTP_HEADER_VALUE_NATIVE)
- || !aTrustErrorWorkAround) {
+ request.getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE).equals(SL20Constants.HTTP_HEADER_VALUE_NATIVE)) {
log.debug("Client request containts 'native client' header ... ");
log.trace("SL20 response to VDA: " + respContainer);
final StringWriter writer = new StringWriter();