Java Code Examples for org.wso2.carbon.identity.application.common.util.IdentityApplicationManagementUtil#concatArrays()
The following examples show how to use
org.wso2.carbon.identity.application.common.util.IdentityApplicationManagementUtil#concatArrays() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProvisioningConnectorConfig.java From carbon-identity-framework with Apache License 2.0 | 5 votes |
/** * @param provisioningProperties */ public void setProvisioningProperties(Property[] provisioningProperties) { if (this.provisioningProperties != null && this.provisioningProperties.length > 0 && provisioningProperties != null) { this.provisioningProperties = IdentityApplicationManagementUtil.concatArrays( this.provisioningProperties, provisioningProperties); } else { this.provisioningProperties = provisioningProperties; } }
Example 2
Source File: ProvisioningConnectorConfig.java From carbon-identity with Apache License 2.0 | 5 votes |
/** * @param provisioningProperties */ public void setProvisioningProperties(Property[] provisioningProperties) { if (this.provisioningProperties != null && this.provisioningProperties.length > 0 && provisioningProperties != null) { this.provisioningProperties = IdentityApplicationManagementUtil.concatArrays( this.provisioningProperties, provisioningProperties); } else { this.provisioningProperties = provisioningProperties; } }
Example 3
Source File: OutboundProvisioningManager.java From carbon-identity-framework with Apache License 2.0 | 4 votes |
/** * @param fIdP * @param registeredConnectorFactories * @param tenantDomainName * @param enableJitProvisioning * @return * @throws IdentityProviderManagementException * @throws UserStoreException */ private AbstractOutboundProvisioningConnector getOutboundProvisioningConnector( IdentityProvider fIdP, Map<String, AbstractProvisioningConnectorFactory> registeredConnectorFactories, String tenantDomainName, boolean enableJitProvisioning) throws IdentityProviderManagementException, IdentityProvisioningException { String idpName = fIdP.getIdentityProviderName(); // name of the default provisioning connector. String connectorType = fIdP.getDefaultProvisioningConnectorConfig().getName(); // get identity provider configuration. fIdP = IdentityProviderManager.getInstance().getEnabledIdPByName(idpName, tenantDomainName); if (fIdP == null) { // This is an exceptional situation. If service provider has connected to an // identity provider, that identity provider must be present in the system. // If not its an exception. throw new IdentityProvisioningException( "Provisioning identity provider not available in the system. Idp Name : " + idpName); } // get a list of provisioning connectors associated with the provisioning // identity provider. ProvisioningConnectorConfig[] provisioningConfigs = fIdP.getProvisioningConnectorConfigs(); if (provisioningConfigs != null && provisioningConfigs.length > 0) { for (ProvisioningConnectorConfig defaultProvisioningConfig : provisioningConfigs) { if (!connectorType.equals(defaultProvisioningConfig.getName()) || !defaultProvisioningConfig.isEnabled()) { // we need to find the provisioning connector selected by the service provider. continue; } // this is how we match the configuration to the runtime. the provisioning // connector factory should be registered with the system, with the exact // name available in the corresponding configuration. AbstractProvisioningConnectorFactory factory = registeredConnectorFactories .get(connectorType); // get the provisioning properties associated with a given provisioning // connector. Property[] provisioningProperties = defaultProvisioningConfig .getProvisioningProperties(); if (enableJitProvisioning) { Property jitEnabled = new Property(); jitEnabled.setName(IdentityProvisioningConstants.JIT_PROVISIONING_ENABLED); jitEnabled.setValue("1"); provisioningProperties = IdentityApplicationManagementUtil.concatArrays( provisioningProperties, new Property[]{jitEnabled}); } Property userIdClaimURL = new Property(); userIdClaimURL.setName("userIdClaimUri"); if (fIdP.getClaimConfig() != null && fIdP.getClaimConfig().getUserClaimURI() != null) { userIdClaimURL.setValue(fIdP.getClaimConfig().getUserClaimURI()); } else { userIdClaimURL.setValue(""); } List<Property> provisioningPropertiesList = new ArrayList<>(Arrays.asList(provisioningProperties)); provisioningPropertiesList.add(userIdClaimURL); provisioningProperties = new Property[provisioningPropertiesList.size()]; provisioningProperties = provisioningPropertiesList.toArray(provisioningProperties); // get the runtime provisioning connector associate the provisioning // identity provider. any given time, a given provisioning identity provider // can only be associated with a single provisioning connector. return factory.getConnector(idpName, provisioningProperties, tenantDomainName); } } return null; }
Example 4
Source File: OutboundProvisioningManager.java From carbon-identity with Apache License 2.0 | 4 votes |
/** * @param fIdP * @param registeredConnectorFactories * @param tenantDomainName * @param enableJitProvisioning * @return * @throws IdentityProviderManagementException * @throws UserStoreException */ private AbstractOutboundProvisioningConnector getOutboundProvisioningConnector( IdentityProvider fIdP, Map<String, AbstractProvisioningConnectorFactory> registeredConnectorFactories, String tenantDomainName, boolean enableJitProvisioning) throws IdentityProviderManagementException, IdentityProvisioningException { String idpName = fIdP.getIdentityProviderName(); // name of the default provisioning connector. String connectorType = fIdP.getDefaultProvisioningConnectorConfig().getName(); // get identity provider configuration. fIdP = IdentityProviderManager.getInstance().getEnabledIdPByName(idpName, tenantDomainName); if (fIdP == null) { // This is an exceptional situation. If service provider has connected to an // identity provider, that identity provider must be present in the system. // If not its an exception. throw new IdentityProvisioningException( "Provisioning identity provider not available in the system. Idp Name : " + idpName); } // get a list of provisioning connectors associated with the provisioning // identity provider. ProvisioningConnectorConfig[] provisioningConfigs = fIdP.getProvisioningConnectorConfigs(); if (provisioningConfigs != null && provisioningConfigs.length > 0) { for (ProvisioningConnectorConfig defaultProvisioningConfig : provisioningConfigs) { if (!connectorType.equals(defaultProvisioningConfig.getName()) || !defaultProvisioningConfig.isEnabled()) { // we need to find the provisioning connector selected by the service provider. continue; } // this is how we match the configuration to the runtime. the provisioning // connector factory should be registered with the system, with the exact // name available in the corresponding configuration. AbstractProvisioningConnectorFactory factory = registeredConnectorFactories .get(connectorType); // get the provisioning properties associated with a given provisioning // connector. Property[] provisioningProperties = defaultProvisioningConfig .getProvisioningProperties(); if (enableJitProvisioning) { Property jitEnabled = new Property(); jitEnabled.setName(IdentityProvisioningConstants.JIT_PROVISIONING_ENABLED); jitEnabled.setValue("1"); provisioningProperties = IdentityApplicationManagementUtil.concatArrays( provisioningProperties, new Property[]{jitEnabled}); } Property userIdClaimURL = new Property(); userIdClaimURL.setName("userIdClaimUri"); if (fIdP.getClaimConfig() != null && fIdP.getClaimConfig().getUserClaimURI() != null) { userIdClaimURL.setValue(fIdP.getClaimConfig().getUserClaimURI()); } else { userIdClaimURL.setValue(""); } List<Property> provisioningPropertiesList = new ArrayList<>(Arrays.asList(provisioningProperties)); provisioningPropertiesList.add(userIdClaimURL); provisioningProperties = new Property[provisioningPropertiesList.size()]; provisioningProperties = provisioningPropertiesList.toArray(provisioningProperties); // get the runtime provisioning connector associate the provisioning // identity provider. any given time, a given provisioning identity provider // can only be associated with a single provisioning connector. return factory.getConnector(idpName, provisioningProperties, tenantDomainName); } } return null; }