diff options
author | st398c <st398c@research.att.com> | 2019-03-28 16:30:03 -0400 |
---|---|---|
committer | st398c <st398c@research.att.com> | 2019-03-28 16:30:03 -0400 |
commit | fa5f20d91c416a855f0d6afe157db8250574617c (patch) | |
tree | 3dd5dd3f8bccc8c0f30ca41cb2569aa4b0c5cefb /ecomp-sdk/epsdk-fw | |
parent | 1ded3bb69c5e91cd879d83e13d2b3295710cdb4f (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')
-rw-r--r-- | ecomp-sdk/epsdk-fw/pom.xml | 4 | ||||
-rw-r--r-- | ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/SessionCommunicationService.java | 8 |
2 files changed, 10 insertions, 2 deletions
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 @@ <parent> <groupId>org.onap.portal.sdk</groupId> <artifactId>epsdk-project</artifactId> - <version>2.5.0</version> + <version>2.6.0-SNAPSHOT</version> </parent> <!-- GroupId is inherited from parent --> @@ -72,7 +72,7 @@ <dependency> <groupId>org.onap.portal.sdk</groupId> <artifactId>epsdk-logger</artifactId> - <version>2.5.0</version> + <version>2.6.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.onap.aaf.authz</groupId> 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()); |