From c691a7d27dfc5416c2776e960bad5607308395b9 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 28 Jun 2019 13:12:57 +0200 Subject: remove work-around for A-Trust --- .../sl20/tasks/AbstractReceiveQualeIDTask.java | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'eaaf_modules/eaaf_module_auth_sl20/src') 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 reqParameters = new HashMap(); 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(); -- cgit v1.2.3