From 0ee2ca49f61f75179f3118cbadd2406f7c72cfb3 Mon Sep 17 00:00:00 2001 From: Rashmi Pujar Date: Tue, 8 Oct 2019 14:46:09 -0400 Subject: Correct the CDS basic auth header in the request Issue-ID: POLICY-2088 Signed-off-by: Rashmi Pujar Change-Id: Ibcdfdbd1de66fcf193e52fcc14a1220c7520f140 --- .../java/org/onap/policy/cds/properties/CdsServerProperties.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'models-interactions/model-impl/cds/src/main') diff --git a/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/properties/CdsServerProperties.java b/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/properties/CdsServerProperties.java index 850531848..1b3149089 100644 --- a/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/properties/CdsServerProperties.java +++ b/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/properties/CdsServerProperties.java @@ -82,7 +82,9 @@ public class CdsServerProperties implements ParameterGroup { * @return Base64 encoded string */ public String getBasicAuth() { - return Base64.getEncoder().encodeToString(String.format("%s:%s", getUsername(), getPassword()) - .getBytes(StandardCharsets.UTF_8)); + String encodedAuth = Base64.getEncoder().encodeToString( + String.format("%s:%s", getUsername(), getPassword()).getBytes(StandardCharsets.UTF_8)); + // Return encoded basic auth header + return "Basic " + encodedAuth; } } -- cgit 1.2.3-korg