From 9f1d16678d03d5b59af2f790c06db5a703e8f5cb Mon Sep 17 00:00:00 2001 From: statta Date: Mon, 18 May 2020 19:11:11 -0400 Subject: Graceful Fallback if no decryption Issue-ID: PORTAL-894 Change-Id: I69c7b1d8c499af023200799104838bf5ab485608 Signed-off-by: statta (cherry picked from commit 8e3d0ff5ce27cd87a257a2a95430add3dd3596ce) --- .../java/org/onap/portalapp/portal/utils/EcompPortalUtils.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ecomp-portal-BE-common') diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java index 7c9aa76b..db984a67 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java @@ -420,7 +420,13 @@ public class EcompPortalUtils { decryptedPass = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_PASSWORD); userName = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_USER_NAME); } - String decPass = decrypted(decryptedPass); + String decPass; + try { + decPass = decrypted(decryptedPass); + } catch (Exception e) { + logger.warn(EELFLoggerDelegate.errorLogger, "decryptedPassword failed using non decrypted pwd from the Properties file", e); + decPass = decryptedPass; + } String usernamePass = userName + ":" + decPass; String encToBase64 = String.valueOf((DatatypeConverter.printBase64Binary(usernamePass.getBytes()))); HttpHeaders headers = new HttpHeaders(); -- cgit 1.2.3-korg