+
+ public Map<String,String> getHeaders(OnboardingApp app)
+ {
+ String encriptedPwdDB = "";
+ String appUserName = "";
+
+
+ Map<String,String> headersMap = new HashMap<>();
+ EPApp externalApp = null;
+
+ if(app.getAppBasicAuthPassword().isEmpty() || app.getAppBasicAuthPassword()==null){
+ logger.debug(EELFLoggerDelegate.debugLogger, "Entering in the externalApp get app password contains null : {}");
+ externalApp = appsCacheService.getApp(1L);
+ logger.debug(EELFLoggerDelegate.debugLogger, "external App Information : {}",externalApp);
+
+ String mechidUsername=externalApp.getAppBasicAuthUsername();
+ logger.debug(EELFLoggerDelegate.debugLogger, "external App mechidUsername Information : {}",mechidUsername);
+
+ String password=externalApp.getAppBasicAuthPassword();
+ String decreptedexternalAppPwd = StringUtils.EMPTY;
+ try {
+ decreptedexternalAppPwd = CipherUtil.decryptPKC(password,
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
+ } catch (CipherUtilException e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "failed to decreptedexternalAppPwd when external app pwd is null", e);
+ }
+
+ appUserName =mechidUsername;
+ encriptedPwdDB = decreptedexternalAppPwd;
+
+ }else{
+ appUserName = app.getAppBasicAuthUsername();
+ encriptedPwdDB = app.getAppBasicAuthPassword();
+ }
+
+ headersMap.put("username", appUserName);
+ headersMap.put("password", encriptedPwdDB);
+ return headersMap;
+ }
+}
\ No newline at end of file