From 5a5dc6298559ca0cbd3f60923f779f0d3a4e3de9 Mon Sep 17 00:00:00 2001 From: “Kruthi Date: Thu, 4 Jun 2020 20:32:59 +0530 Subject: Resubmitting KeyProperties changes Change-Id: Ifdf5d90b6773ef3260572eb8d8a65238262d361f Issue-ID: PORTAL-914 Signed-off-by: krutbhat@att.com --- .../src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ecomp-sdk/epsdk-app-os') diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java index 074311dc..d8076a71 100644 --- a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java +++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java @@ -47,6 +47,8 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.exception.CipherUtilException; import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.web.servlet.ModelAndView; @@ -100,9 +102,9 @@ public class LoginStrategyImpl extends LoginStrategy { Cookie userIdCookie = getCookie(request, USER_ID); if (userIdCookie != null) { final String cookieValue = userIdCookie.getValue(); - if (!SystemProperties.containsProperty(SystemProperties.Decryption_Key)) - throw new IllegalStateException("Failed to find property " + SystemProperties.Decryption_Key); - final String decryptionKey = SystemProperties.getProperty(SystemProperties.Decryption_Key); + if ((null == KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)) || ("".equalsIgnoreCase(KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)))) + throw new IllegalStateException("Failed to find property " + KeyConstants.CIPHER_ENCRYPTION_KEY); + final String decryptionKey = KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY); userId = CipherUtil.decrypt(cookieValue, decryptionKey); logger.debug(EELFLoggerDelegate.debugLogger, "getUserIdFromCookie: decrypted as {}", userId); } -- cgit 1.2.3-korg