summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-fw/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-fw/src/main/java')
-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());