Fix SP configurations on IS change randomly without reason
@@ -182,6 +182,7 @@ public class ApplicationManagementServiceImpl extends ApplicationManagementServi
public ServiceProvider getApplicationExcludingFileBasedSPs(String applicationName, String tenantDomain)
throws IdentityApplicationManagementException {
+ ServiceProvider serviceProvider;
// invoking the listeners
Collection<ApplicationMgtListener> listeners = ApplicationMgtListenerServiceComponent.getApplicationMgtListeners();
for (ApplicationMgtListener listener : listeners) {
@@ -190,8 +191,13 @@ public class ApplicationManagementServiceImpl extends ApplicationManagementServi
}
}
+ try {
+ ApplicationMgtUtil.startTenantFlow(tenantDomain);
ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO();
- ServiceProvider serviceProvider = appDAO.getApplication(applicationName, tenantDomain);
+ serviceProvider = appDAO.getApplication(applicationName, tenantDomain);
+ } finally {
+ ApplicationMgtUtil.endTenantFlow();
+ }
// invoking the listeners
for (ApplicationMgtListener listener : listeners) {
@@ -953,6 +959,9 @@ public class ApplicationManagementServiceImpl extends ApplicationManagementServi
ServiceProvider serviceProvider = null;
serviceProviderName = getServiceProviderNameByClientId(clientId, clientType, tenantDomain);
+
+ try {
+ ApplicationMgtUtil.startTenantFlow(tenantDomain);
ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO();
serviceProvider = appDAO.getApplication(serviceProviderName, tenantDomain);
@@ -978,6 +987,9 @@ public class ApplicationManagementServiceImpl extends ApplicationManagementServi
}
}
}
+ } finally {
+ ApplicationMgtUtil.endTenantFlow();
+ }
if (serviceProvider == null && serviceProviderName != null && ApplicationManagementServiceComponent
.getFileBasedSPs().containsKey(serviceProviderName)) {
