*/
package org.onap.portalapp.portal.interceptor;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
import java.util.HashMap;
import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.mockito.internal.stubbing.answers.ThrowsException;
import org.onap.aaf.cadi.CadiWrap;
import org.onap.portalapp.controller.sessionmgt.SessionCommunicationController;
import org.onap.portalapp.portal.controller.BasicAuthenticationController;
import org.onap.portalapp.portal.controller.WebAnalyticsExtAppController;
import org.onap.portalapp.portal.domain.BasicAuthCredentials;
import org.onap.portalapp.portal.domain.EPApp;
-import org.onap.portalapp.portal.domain.EPEndpoint;
import org.onap.portalapp.portal.domain.EPUser;
import org.onap.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
import org.onap.portalapp.portal.service.AdminRolesService;
import org.onap.portalapp.portal.service.AppsCacheService;
import org.onap.portalapp.portal.service.BasicAuthenticationCredentialService;
-import org.onap.portalapp.portal.service.ExternalAccessRolesService;
import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
import org.onap.portalapp.portal.utils.EcompPortalUtils;
import org.onap.portalapp.service.RemoteWebServiceCallService;
import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
import org.onap.portalsdk.core.onboarding.util.AuthUtil;
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.onboarding.util.PortalApiConstants;
import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
import org.onap.portalsdk.core.util.SystemProperties;
throw new Exception("Invalid credentials!");
}
else {
- final String appUsername = application.getUsername();
+ final String appUsername = application.getAppBasicAuthUsername();
logger.debug(EELFLoggerDelegate.debugLogger, "appUsername : {}",appUsername);
String[] accountNamePassword = EcompPortalUtils.getUserNamePassword(authHeader);
throw new Exception("Invalid credentials!");
}
else {
- final String appUsername = application.getUsername();
- final String dbDecryptedPwd = CipherUtil.decryptPKC(application.getAppPassword());
+ final String appUsername = application.getAppBasicAuthUsername();
+ final String dbDecryptedPwd = CipherUtil.decryptPKC(application.getAppBasicAuthPassword());
if (appUsername.equals(accountNamePassword[0]) && dbDecryptedPwd.equals(accountNamePassword[1])) {
return true;
}
String result = "";
if (encrypted != null && encrypted.length() > 0) {
try {
- result = CipherUtil.decryptPKC(encrypted, SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ result = CipherUtil.decryptPKC(encrypted, KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
throw e;
if (decryptedPwd != null && decryptedPwd.length() > 0) {
try {
result = CipherUtil.encryptPKC(decryptedPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword() failed", e);
throw e;