Search in sources :

Example 11 with InboundProvisioningConfig

use of org.wso2.carbon.identity.application.common.model.InboundProvisioningConfig in project identity-api-server by wso2.

the class UpdateProvisioningConfiguration method apply.

@Override
public void apply(ServiceProvider application, ProvisioningConfiguration provisioningConfigApiModel) {
    if (provisioningConfigApiModel != null) {
        InboundSCIMProvisioningConfiguration inboundProvisioningModel = provisioningConfigApiModel.getInboundProvisioning();
        if (inboundProvisioningModel != null) {
            InboundProvisioningConfig inboundProvisioningConfig = getInboundProvisioningConfig(application);
            setIfNotNull(inboundProvisioningModel.getProxyMode(), inboundProvisioningConfig::setDumbMode);
            setIfNotNull(inboundProvisioningModel.getProvisioningUserstoreDomain(), inboundProvisioningConfig::setProvisioningUserStore);
            application.setInboundProvisioningConfig(inboundProvisioningConfig);
        }
        List<OutboundProvisioningConfiguration> outboundProvisioningIdps = provisioningConfigApiModel.getOutboundProvisioningIdps();
        if (outboundProvisioningIdps != null) {
            OutboundProvisioningConfig outboundProvisioningConfig = getOutboundProvisionConfig(application);
            IdentityProvider[] identityProviders = getProvisioningIdps(outboundProvisioningIdps);
            outboundProvisioningConfig.setProvisioningIdentityProviders(identityProviders);
            application.setOutboundProvisioningConfig(outboundProvisioningConfig);
        }
    }
}
Also used : InboundProvisioningConfig(org.wso2.carbon.identity.application.common.model.InboundProvisioningConfig) InboundSCIMProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.InboundSCIMProvisioningConfiguration) IdentityProvider(org.wso2.carbon.identity.application.common.model.IdentityProvider) OutboundProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.OutboundProvisioningConfiguration) OutboundProvisioningConfig(org.wso2.carbon.identity.application.common.model.OutboundProvisioningConfig)

Example 12 with InboundProvisioningConfig

use of org.wso2.carbon.identity.application.common.model.InboundProvisioningConfig in project identity-api-server by wso2.

the class ServerConfigManagementService method updateInboundScimConfigs.

/**
 * Update SCIM Inbound Provisioning Configurations.
 *
 * @param scimConfig ScimConfig.
 */
public void updateInboundScimConfigs(ScimConfig scimConfig) {
    ServiceProvider application = getResidentApplication();
    if (scimConfig != null) {
        InboundProvisioningConfig inboundProvisioningConfig = new InboundProvisioningConfig();
        inboundProvisioningConfig.setDumbMode(scimConfig.getEnableProxyMode());
        if (!scimConfig.getEnableProxyMode()) {
            inboundProvisioningConfig.setProvisioningEnabled(true);
            inboundProvisioningConfig.setProvisioningUserStore(scimConfig.getProvisioningUserstore());
        }
        ServiceProvider applicationClone = createApplicationClone(application);
        applicationClone.setInboundProvisioningConfig(inboundProvisioningConfig);
        try {
            ConfigsServiceHolder.getInstance().getApplicationManagementService().updateApplicationByResourceId(applicationClone.getApplicationResourceId(), applicationClone, ContextLoader.getTenantDomainFromContext(), ContextLoader.getUsernameFromContext());
        } catch (IdentityApplicationManagementException e) {
            throw handleApplicationMgtException(e, Constants.ErrorMessage.ERROR_CODE_ERROR_RETRIEVING_CONFIGS, null);
        }
    }
}
Also used : InboundProvisioningConfig(org.wso2.carbon.identity.application.common.model.InboundProvisioningConfig) ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider) IdentityApplicationManagementException(org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)

Aggregations

InboundProvisioningConfig (org.wso2.carbon.identity.application.common.model.InboundProvisioningConfig)6 ArrayList (java.util.ArrayList)4 InboundProvisioningConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundProvisioningConfig)4 Test (org.testng.annotations.Test)3 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)3 JustInTimeProvisioningConfig (org.wso2.carbon.identity.application.common.model.xsd.JustInTimeProvisioningConfig)3 OutboundProvisioningConfig (org.wso2.carbon.identity.application.common.model.xsd.OutboundProvisioningConfig)3 ServiceProvider (org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider)3 PreparedStatement (java.sql.PreparedStatement)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 NamedPreparedStatement (org.wso2.carbon.database.utils.jdbc.NamedPreparedStatement)2 IdentityProvider (org.wso2.carbon.identity.application.common.model.IdentityProvider)2 OutboundProvisioningConfig (org.wso2.carbon.identity.application.common.model.OutboundProvisioningConfig)2 IdentityProvider (org.wso2.carbon.identity.application.common.model.xsd.IdentityProvider)2 ProvisioningConnectorConfig (org.wso2.carbon.identity.application.common.model.xsd.ProvisioningConnectorConfig)2 AbstractUserStoreManager (org.wso2.carbon.user.core.common.AbstractUserStoreManager)2 User (org.wso2.charon3.core.objects.User)2 ResultSet (java.sql.ResultSet)1 HashMap (java.util.HashMap)1 XPathExpressionException (javax.xml.xpath.XPathExpressionException)1