From fa5f20d91c416a855f0d6afe157db8250574617c Mon Sep 17 00:00:00 2001 From: st398c Date: Thu, 28 Mar 2019 16:30:03 -0400 Subject: Fortify, version, Junit Issue-ID: PORTAL-543, PORTAL-273, PORTAL-544 Change-Id: Ib864ef78bbd534170cab90d9314f2d8943f78872 Signed-off-by: Thota, Saisree --- ecomp-sdk/epsdk-fw/pom.xml | 4 ++-- .../core/onboarding/crossapi/SessionCommunicationService.java | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'ecomp-sdk/epsdk-fw') diff --git a/ecomp-sdk/epsdk-fw/pom.xml b/ecomp-sdk/epsdk-fw/pom.xml index cc9b66af..cc950f12 100644 --- a/ecomp-sdk/epsdk-fw/pom.xml +++ b/ecomp-sdk/epsdk-fw/pom.xml @@ -6,7 +6,7 @@ org.onap.portal.sdk epsdk-project - 2.5.0 + 2.6.0-SNAPSHOT @@ -72,7 +72,7 @@ org.onap.portal.sdk epsdk-logger - 2.5.0 + 2.6.0-SNAPSHOT org.onap.aaf.authz diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/SessionCommunicationService.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/SessionCommunicationService.java index e016db07..847707bc 100644 --- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/SessionCommunicationService.java +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/SessionCommunicationService.java @@ -41,6 +41,7 @@ import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; +import java.util.Base64; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -81,6 +82,9 @@ public class SessionCommunicationService { con.setRequestProperty("username", userName); con.setRequestProperty("password", password); con.setRequestProperty("uebkey", uebKey); + + String encoding = Base64.getEncoder().encodeToString((userName + ":" + password).getBytes()); + con.setRequestProperty("Authorization", "Basic " + encoding); int responseCode = con.getResponseCode(); if (logger.isDebugEnabled()) { @@ -138,6 +142,10 @@ public class SessionCommunicationService { con.setRequestProperty("password", password); con.setRequestProperty("uebkey", uebKey); con.setRequestProperty("sessionMap", sessionTimeoutMap); + + String encoding = Base64.getEncoder().encodeToString((userName + ":" + password).getBytes()); + con.setRequestProperty("Authorization", "Basic " + encoding); + con.setDoInput(true); con.setDoOutput(true); con.getOutputStream().write(sessionTimeoutMap.getBytes()); -- cgit 1.2.3-korg