summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-fw/src
diff options
context:
space:
mode:
authorst398c <st398c@research.att.com>2019-03-28 16:30:03 -0400
committerst398c <st398c@research.att.com>2019-03-28 16:30:03 -0400
commitfa5f20d91c416a855f0d6afe157db8250574617c (patch)
tree3dd5dd3f8bccc8c0f30ca41cb2569aa4b0c5cefb /ecomp-sdk/epsdk-fw/src
parent1ded3bb69c5e91cd879d83e13d2b3295710cdb4f (diff)
Fortify, version, Junit
Issue-ID: PORTAL-543, PORTAL-273, PORTAL-544 Change-Id: Ib864ef78bbd534170cab90d9314f2d8943f78872 Signed-off-by: Thota, Saisree <st398c@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-fw/src')
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/SessionCommunicationService.java8
1 files changed, 8 insertions, 0 deletions
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());