Skip to content

Commit

Permalink
Disable application based outbound provisioning by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanikaRuchini committed Feb 16, 2024
1 parent cb8d557 commit 279171c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class IdentityProvisioningConstants {

// Outbound provisioning constants.
public static final String USE_USER_TENANT_DOMAIN_FOR_OUTBOUND_PROVISIONING_IN_SAAS_APPS = "OutboundProvisioning.useUserTenantDomainInSaasApps";
public static final String APPLICATION_BASED_OUTBOUND_PROVISIONING_ENABLED = "OutboundProvisioning.enableApplicationBasedOutboundProvisioning";

public static class SQLQueries {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import static org.wso2.carbon.identity.provisioning.IdentityProvisioningConstants.ASK_PASSWORD_CLAIM;
import static org.wso2.carbon.identity.provisioning.IdentityProvisioningConstants.GROUP_CLAIM_URI;
import static org.wso2.carbon.identity.provisioning.IdentityProvisioningConstants.SELF_SIGNUP_ROLE;
import static org.wso2.carbon.identity.provisioning.ProvisioningUtil.isApplicationBasedOutboundProvisioningEnabled;
import static org.wso2.carbon.identity.provisioning.ProvisioningUtil.isUserTenantBasedOutboundProvisioningEnabled;

/**
Expand Down Expand Up @@ -347,7 +348,9 @@ public void provision(ProvisioningEntity provisioningEntity, String serviceProvi
}

// Any provisioning request coming via Console, considered as coming from the resident SP.
if (StringUtils.equals(CONSOLE_APPLICATION_NAME, serviceProviderIdentifier)) {
// If the application based outbound provisioning is disabled, resident SP configuration will be used.
if (StringUtils.equals(CONSOLE_APPLICATION_NAME, serviceProviderIdentifier) ||
!isApplicationBasedOutboundProvisioningEnabled()) {
serviceProviderIdentifier = LOCAL_SP;
inboundClaimDialect = IdentityProvisioningConstants.WSO2_CARBON_DIALECT;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.util.List;
import java.util.Map;

import static org.wso2.carbon.identity.provisioning.IdentityProvisioningConstants.APPLICATION_BASED_OUTBOUND_PROVISIONING_ENABLED;
import static org.wso2.carbon.identity.provisioning.IdentityProvisioningConstants.USE_USER_TENANT_DOMAIN_FOR_OUTBOUND_PROVISIONING_IN_SAAS_APPS;

public class ProvisioningUtil {
Expand Down Expand Up @@ -586,4 +587,21 @@ public static boolean isOutboundProvisioningEnabled(String serviceProviderIdenti
}
return true;
}

/**
* Check whether the application based outbound provisioning is enabled.
*
* @return true if applicationBasedOutboundProvisioningEnabled config is enabled.
*/
public static boolean isApplicationBasedOutboundProvisioningEnabled() {

boolean applicationBasedOutboundProvisioningEnabled = false;

if (StringUtils.isNotEmpty(
IdentityUtil.getProperty(APPLICATION_BASED_OUTBOUND_PROVISIONING_ENABLED))) {
applicationBasedOutboundProvisioningEnabled = Boolean
.parseBoolean(IdentityUtil.getProperty(APPLICATION_BASED_OUTBOUND_PROVISIONING_ENABLED));
}
return applicationBasedOutboundProvisioningEnabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,7 @@

<OutboundProvisioning>
<ResetProvisioningEntitiesOnConfigUpdate>true</ResetProvisioningEntitiesOnConfigUpdate>
<enableApplicationBasedOutboundProvisioning>false</enableApplicationBasedOutboundProvisioning>
</OutboundProvisioning>

<EventListeners>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1841,6 +1841,7 @@
-->
<useUserTenantDomainInSaasApps>{{outbound_provisioning_management.use_user_tenant_domain_in_saas_apps}}</useUserTenantDomainInSaasApps>
{% endif %}
<enableApplicationBasedOutboundProvisioning>{{outbound_provisioning_management.enable_application_based_outbound_provisioning}}</enableApplicationBasedOutboundProvisioning>
</OutboundProvisioning>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@
"idp_role_management.return_only_mapped_local_roles": true,
"idp_role_management.return_manually_added_local_roles": true,
"outbound_provisioning_management.reset_provisioning_entities_on_config_update": true,
"outbound_provisioning_management.enable_application_based_outbound_provisioning": false,

"authentication_policy.check_account_exist": true,
"authentication.jit_provisioning.username_provisioning_url": "/accountrecoveryendpoint/register.do",
Expand Down

0 comments on commit 279171c

Please sign in to comment.