diff --git a/components/org.wso2.carbon.identity.organization.management.application/src/main/java/org/wso2/carbon/identity/organization/management/application/listener/FragmentApplicationMgtListener.java b/components/org.wso2.carbon.identity.organization.management.application/src/main/java/org/wso2/carbon/identity/organization/management/application/listener/FragmentApplicationMgtListener.java index 1e95796fe..283639620 100644 --- a/components/org.wso2.carbon.identity.organization.management.application/src/main/java/org/wso2/carbon/identity/organization/management/application/listener/FragmentApplicationMgtListener.java +++ b/components/org.wso2.carbon.identity.organization.management.application/src/main/java/org/wso2/carbon/identity/organization/management/application/listener/FragmentApplicationMgtListener.java @@ -300,8 +300,7 @@ public boolean doPostGetServiceProvider(ServiceProvider serviceProvider, String inheritAPIBasedAuthenticationEnabledProperty(mainApplication, serviceProvider); // Inherit Application enabled property from the main application. inheritApplicationEnabledProperty(mainApplication, serviceProvider); - // Inherit discoverable property from the main application. - serviceProvider.setDiscoverable(mainApplication.isDiscoverable()); + inheritDiscoverabilityProperty(mainApplication, serviceProvider); /* If the shared application doesn't have a configured access URL, @@ -319,6 +318,11 @@ public boolean doPostGetServiceProvider(ServiceProvider serviceProvider, String return super.doPostGetServiceProvider(serviceProvider, applicationName, tenantDomain); } + private void inheritDiscoverabilityProperty(ServiceProvider mainApplication, ServiceProvider sharedApplication) { + + sharedApplication.setDiscoverable(mainApplication.isDiscoverable() || sharedApplication.isDiscoverable()); + } + private void inheritAPIBasedAuthenticationEnabledProperty(ServiceProvider mainApplication, ServiceProvider sharedApplication) {