Merge branch 'jenkins_with_weblogic' of ssh://git@192.168.240.178:18081/eapim/elink-online-common.git into jenkins_with_weblogic
This commit is contained in:
+9
-9
@@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
//import org.apache.commons.net.util.Base64;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.JSONValue;
|
||||
|
||||
@@ -157,18 +158,17 @@ public class HmacSha256VerifyFilterKjb implements HttpAdapterFilter {
|
||||
String outboundBody = (String) resultMessage;
|
||||
|
||||
try {
|
||||
|
||||
if (outboundBody.startsWith(KJB_ROOTLESS_ARRAY)) {
|
||||
outboundBody = outboundBody.substring(KJB_ROOTLESS_ARRAY.length());
|
||||
|
||||
if (outboundBody.endsWith("}")) {
|
||||
outboundBody = outboundBody.substring(0, outboundBody.length() - 1);
|
||||
}
|
||||
|
||||
Object root = JSONValue.parse(outboundBody);
|
||||
|
||||
if (root instanceof JSONObject && ((JSONObject) root).containsKey("KJB_ROOTLESS_ARRAY")) {
|
||||
JSONArray jsonArray = (JSONArray) ((JSONObject) root).get("KJB_ROOTLESS_ARRAY");
|
||||
outboundBody = jsonArray.toJSONString();
|
||||
}
|
||||
|
||||
|
||||
String clientSecret = assignClientSecret(prop, request);
|
||||
String macBody = calculateHMAC(outboundBody, clientSecret);
|
||||
|
||||
|
||||
response.addHeader("x-obp-signature-body", macBody);
|
||||
response.addHeader("x-obp-partnercode", request.getHeader("x-obp-partnercode"));
|
||||
response.addHeader("x-obp-txid", prop.getProperty(TransactionContextKeys.TRANSACTION_UUID,""));
|
||||
|
||||
Reference in New Issue
Block a user