aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-SDK-APP/src/main/java/org/openecomp
diff options
context:
space:
mode:
authorrb7147 <rb7147@att.com>2017-10-19 15:15:48 -0400
committerrb7147 <rb7147@att.com>2017-10-19 16:22:07 -0400
commit33f0e2b71ead3a57e90832dcac89168c79609587 (patch)
treec280e5ac495694c0611feeb7bb43f70ab75f8ba9 /ONAP-SDK-APP/src/main/java/org/openecomp
parent12226fb1b44192bde4e51cb674e33947bc60a77e (diff)
Resolved the License issue in Policy
Updated epsdk version from 1.1.0 to 1.3.1 to resolve the flexslider. Added Exclusions to resolve the mysql and iText. Issue-ID: POLICY-355 Change-Id: Iffb052bee37aa3c10f634db1b5bdb2985e9f176b Signed-off-by: rb7147 <rb7147@att.com>
Diffstat (limited to 'ONAP-SDK-APP/src/main/java/org/openecomp')
-rw-r--r--ONAP-SDK-APP/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java36
1 files changed, 17 insertions, 19 deletions
diff --git a/ONAP-SDK-APP/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java b/ONAP-SDK-APP/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java
index 567fbb7cf..3b38f1d8e 100644
--- a/ONAP-SDK-APP/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java
+++ b/ONAP-SDK-APP/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java
@@ -26,10 +26,10 @@ import javax.servlet.http.HttpServletResponse;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.openecomp.portalsdk.core.auth.LoginStrategy;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
+import org.openecomp.portalsdk.core.util.SystemProperties;
import org.springframework.web.servlet.ModelAndView;
public class LoginStrategyImpl extends LoginStrategy {
@@ -58,23 +58,21 @@ public class LoginStrategyImpl extends LoginStrategy {
}
private static String getUserIdFromCookie(HttpServletRequest request) throws PortalAPIException {
- String userId = "";
- Cookie[] cookies = request.getCookies();
- Cookie userIdcookie = null;
- if (cookies != null)
- for (Cookie cookie : cookies)
- if (cookie.getName().equals(USER_ID))
- userIdcookie = cookie;
- if (userIdcookie != null) {
- try {
- userId = CipherUtil.decrypt(userIdcookie.getValue(),
- PortalApiProperties.getProperty(PortalApiConstants.Decryption_Key));
- } catch (Exception e) {
- throw new PortalAPIException(e);
- }
- }
- return userId;
-
+ String userId = "";
+ 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);
+ try {
+ userId = CipherUtil.decrypt(cookieValue, decryptionKey);
+ LOGGER.debug("getUserIdFromCookie: decrypted as {}" +userId);
+ } catch (Exception e) {
+ LOGGER.error("Exception Occured in getUserIdFromCookie" + e);
+ }
+ }
+ return userId;
}
private static boolean isLoginCookieExist(HttpServletRequest request) {