X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-os%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fconf%2FExternalAppConfig.java;h=ac7c3f72fb81bf1fbfe640374d06cda8fe1baa39;hb=2c658b3e35fa4f0c7b87bbd211de6bedbbe13852;hp=ee53eba05bca73b7d741a7bc4232e97e85d136b0;hpb=d84a85d705b38d90b73809ead3e5034b8c066ca9;p=portal.git diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java index ee53eba0..ac7c3f72 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java @@ -161,6 +161,7 @@ public class ExternalAppConfig extends AppConfig implements Configurable { MDC.put(MDC_SERVICE_INSTANCE_ID, ""); MDC.put(MDC_ALERT_SEVERITY, AlarmSeverityEnum.INFORMATIONAL.severity()); MDC.put(MDC_INSTANCE_UUID, SystemProperties.getProperty(SystemProperties.INSTANCE_UUID)); + if("true".equalsIgnoreCase(remotecentralizedsystemaccess)){ importFromExternalAuth(); } @@ -169,12 +170,7 @@ public class ExternalAppConfig extends AppConfig implements Configurable { } } - /** - * Does a sync on functions, roles and role functions based on namespace - * for all the centralized applications between AAF and ONAP, updates - * fn_user and fn_user_role with user information from AAF. - * - */ + private void importFromExternalAuth() throws Exception { JSONArray aafAppRoles = new JSONArray(); JSONArray aafUserList = new JSONArray(); @@ -191,8 +187,8 @@ public class ExternalAppConfig extends AppConfig implements Configurable { for(int j = 0; j < aafAppRoles.length(); j++){ ObjectMapper mapper = new ObjectMapper(); String name = aafAppRoles.getJSONObject(j).getString("name"); - String desc = aafAppRoles.getJSONObject(j).getString("description"); - ExternalRoleDescription externalRoleDescription = mapper.readValue(desc, ExternalRoleDescription.class); + //String desc = aafAppRoles.getJSONObject(j).getString("description"); + //ExternalRoleDescription externalRoleDescription = mapper.readValue(desc, ExternalRoleDescription.class); aafUserList = externalAccessRolesService.getAllUsersByRole(name); if(aafUserList != null && aafUserList.length() > 0){ for(int k = 0; k < aafUserList.length(); k++){