Search in sources :

Example 1 with UpdateProvisioningConfiguration

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

Aggregations

SAML2ServiceProvider (org.wso2.carbon.identity.api.server.application.management.v1.SAML2ServiceProvider)1 ApiModelToServiceProvider (org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.ApiModelToServiceProvider)1 UpdateServiceProvider (org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.UpdateServiceProvider)1 UpdateProvisioningConfiguration (org.wso2.carbon.identity.api.server.application.management.v1.core.functions.application.provisioning.UpdateProvisioningConfiguration)1 IdentityApplicationManagementException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)1 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)1