Search in sources :

Example 1 with ProvisioningConfiguration

use of org.wso2.carbon.identity.api.server.application.management.v1.ProvisioningConfiguration in project identity-api-server by wso2.

the class ServerApplicationManagementService method updateResidentApplication.

public ResidentApplication updateResidentApplication(ProvisioningConfiguration provisioningConfig) {
    String tenantDomain = ContextLoader.getTenantDomainFromContext();
    try {
        ServiceProvider application = getResidentSp(tenantDomain);
        String residentSpResourceId = application.getApplicationResourceId();
        ServiceProvider applicationToUpdate = cloneApplication(residentSpResourceId);
        // Add provisioning configs to resident SP.
        if (provisioningConfig != null) {
            new UpdateProvisioningConfiguration().apply(applicationToUpdate, provisioningConfig);
        }
        updateServiceProvider(residentSpResourceId, applicationToUpdate);
        return getResidentApplication(tenantDomain);
    } catch (IdentityApplicationManagementException e) {
        String msg = "Error updating resident application of tenantDomain: " + tenantDomain;
        throw handleIdentityApplicationManagementException(e, msg);
    }
}
Also used : UpdateProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.provisioning.UpdateProvisioningConfiguration) ApiModelToServiceProvider(org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.ApiModelToServiceProvider) UpdateServiceProvider(org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.UpdateServiceProvider) ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider) SAML2ServiceProvider(org.wso2.carbon.identity.api.server.application.management.v1.SAML2ServiceProvider) IdentityApplicationManagementException(org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)

Example 2 with ProvisioningConfiguration

use of org.wso2.carbon.identity.api.server.application.management.v1.ProvisioningConfiguration in project identity-api-server by wso2.

the class ServerApplicationManagementService method getResidentApplication.

private ResidentApplication getResidentApplication(String tenantDomain) {
    try {
        ServiceProvider application = getResidentSp(tenantDomain);
        ProvisioningConfiguration provisioningConfig = new BuildProvisioningConfiguration().apply(application);
        return new ResidentApplication().provisioningConfigurations(provisioningConfig);
    } catch (IdentityApplicationManagementException e) {
        String msg = "Error retrieving resident application of tenantDomain: " + tenantDomain;
        throw handleIdentityApplicationManagementException(e, msg);
    }
}
Also used : BuildProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.provisioning.BuildProvisioningConfiguration) ProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.ProvisioningConfiguration) UpdateProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.provisioning.UpdateProvisioningConfiguration) ResidentApplication(org.wso2.carbon.identity.api.server.application.management.v1.ResidentApplication) ApiModelToServiceProvider(org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.ApiModelToServiceProvider) UpdateServiceProvider(org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.UpdateServiceProvider) ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider) SAML2ServiceProvider(org.wso2.carbon.identity.api.server.application.management.v1.SAML2ServiceProvider) IdentityApplicationManagementException(org.wso2.carbon.identity.application.common.IdentityApplicationManagementException) BuildProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.provisioning.BuildProvisioningConfiguration)

Example 3 with ProvisioningConfiguration

use of org.wso2.carbon.identity.api.server.application.management.v1.ProvisioningConfiguration in project identity-api-server by wso2.

the class BuildProvisioningConfiguration method apply.

@Override
public ProvisioningConfiguration apply(ServiceProvider application) {
    ProvisioningConfiguration config = new ProvisioningConfiguration();
    if (application.getInboundProvisioningConfig() != null) {
        config.inboundProvisioning(buildInboundProvisioningConfig(application.getInboundProvisioningConfig()));
    }
    if (application.getOutboundProvisioningConfig() != null) {
        List<OutboundProvisioningConfiguration> provisioningIdps = buildOutboundProvisioningConfig(application.getOutboundProvisioningConfig());
        config.outboundProvisioningIdps(provisioningIdps);
    }
    return config;
}
Also used : OutboundProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.OutboundProvisioningConfiguration) InboundSCIMProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.InboundSCIMProvisioningConfiguration) ProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.ProvisioningConfiguration) OutboundProvisioningConfiguration(org.wso2.carbon.identity.api.server.application.management.v1.OutboundProvisioningConfiguration)

Example 4 with ProvisioningConfiguration

use of org.wso2.carbon.identity.api.server.application.management.v1.ProvisioningConfiguration 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)

Aggregations

InboundSCIMProvisioningConfiguration (org.wso2.carbon.identity.api.server.application.management.v1.InboundSCIMProvisioningConfiguration)2 OutboundProvisioningConfiguration (org.wso2.carbon.identity.api.server.application.management.v1.OutboundProvisioningConfiguration)2 ProvisioningConfiguration (org.wso2.carbon.identity.api.server.application.management.v1.ProvisioningConfiguration)2 SAML2ServiceProvider (org.wso2.carbon.identity.api.server.application.management.v1.SAML2ServiceProvider)2 ApiModelToServiceProvider (org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.ApiModelToServiceProvider)2 UpdateServiceProvider (org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.UpdateServiceProvider)2 UpdateProvisioningConfiguration (org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.provisioning.UpdateProvisioningConfiguration)2 IdentityApplicationManagementException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)2 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)2 ResidentApplication (org.wso2.carbon.identity.api.server.application.management.v1.ResidentApplication)1 BuildProvisioningConfiguration (org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.provisioning.BuildProvisioningConfiguration)1 IdentityProvider (org.wso2.carbon.identity.application.common.model.IdentityProvider)1 InboundProvisioningConfig (org.wso2.carbon.identity.application.common.model.InboundProvisioningConfig)1 OutboundProvisioningConfig (org.wso2.carbon.identity.application.common.model.OutboundProvisioningConfig)1