use of org.wso2.carbon.identity.application.common.model.idp.xsd.JustInTimeProvisioningConfig in project product-is by wso2.
the class JustInTimeProvisioningTestCase method updateIdentityProviderJitConfiguration.
/**
* To update the Identity provider JIT configuration.
*
* @param isModifyUserNameAllowed To mention whether isModifyUserNameAllowed.
* @throws Exception Exception.
*/
private void updateIdentityProviderJitConfiguration(boolean isPasswordProvisioningEnabled, boolean isModifyUserNameAllowed, boolean isPromptConsent, String userStore) throws Exception {
IdentityProvider identityProvider = super.getIdentityProvider(PORT_OFFSET_0, IDENTITY_PROVIDER_NAME);
JustInTimeProvisioningConfig justInTimeProvisioningConfig = identityProvider.getJustInTimeProvisioningConfig();
justInTimeProvisioningConfig.setPasswordProvisioningEnabled(isPasswordProvisioningEnabled);
justInTimeProvisioningConfig.setModifyUserNameAllowed(isModifyUserNameAllowed);
justInTimeProvisioningConfig.setPromptConsent(isPromptConsent);
justInTimeProvisioningConfig.setProvisioningUserStore(userStore);
identityProvider.setJustInTimeProvisioningConfig(justInTimeProvisioningConfig);
super.updateIdentityProvider(PORT_OFFSET_0, IDENTITY_PROVIDER_NAME, identityProvider);
}
use of org.wso2.carbon.identity.application.common.model.idp.xsd.JustInTimeProvisioningConfig in project product-is by wso2.
the class ProvisioningTestCase method addSP.
private void addSP(int portOffset) throws Exception {
ServiceProvider serviceProvider = applicationManagementServiceClients.get(portOffset).getApplication("wso2carbon-local-sp");
if (serviceProvider == null) {
serviceProvider = new ServiceProvider();
serviceProvider.setApplicationName("wso2carbon-local-sp");
try {
applicationManagementServiceClients.get(portOffset).createApplication(serviceProvider);
serviceProvider = applicationManagementServiceClients.get(portOffset).getApplication("wso2carbon-local-sp");
} catch (Exception ex) {
// log.error("Error occurred during obtaining applicationManagementServiceClients", ex);
throw new Exception("Error occurred during obtaining applicationManagementServiceClients", ex);
}
}
InboundProvisioningConfig inBoundProConfig = new InboundProvisioningConfig();
inBoundProConfig.setProvisioningUserStore("");
serviceProvider.setInboundProvisioningConfig(inBoundProConfig);
String proProvider = SAMPLE_IDENTITY_PROVIDER_NAME + "_" + Integer.toString(portOffset);
String connector = "scim";
JustInTimeProvisioningConfig jitpro = new JustInTimeProvisioningConfig();
jitpro.setProvisioningEnabled(false);
org.wso2.carbon.identity.application.common.model.xsd.IdentityProvider proIdp = new org.wso2.carbon.identity.application.common.model.xsd.IdentityProvider();
proIdp.setIdentityProviderName(proProvider);
org.wso2.carbon.identity.application.common.model.xsd.ProvisioningConnectorConfig proCon = new org.wso2.carbon.identity.application.common.model.xsd.ProvisioningConnectorConfig();
proCon.setBlocking(true);
proCon.setName(connector);
proIdp.setJustInTimeProvisioningConfig(jitpro);
proIdp.setDefaultProvisioningConnectorConfig(proCon);
List<org.wso2.carbon.identity.application.common.model.xsd.IdentityProvider> provisioningIdps = new ArrayList<org.wso2.carbon.identity.application.common.model.xsd.IdentityProvider>();
provisioningIdps.add(proIdp);
if (provisioningIdps.size() > 0) {
OutboundProvisioningConfig outboundProConfig = new OutboundProvisioningConfig();
outboundProConfig.setProvisioningIdentityProviders(provisioningIdps.toArray(new org.wso2.carbon.identity.application.common.model.xsd.IdentityProvider[provisioningIdps.size()]));
serviceProvider.setOutboundProvisioningConfig(outboundProConfig);
}
applicationManagementServiceClients.get(portOffset).updateApplicationData(serviceProvider);
}
use of org.wso2.carbon.identity.application.common.model.idp.xsd.JustInTimeProvisioningConfig in project product-is by wso2.
the class OIDCFederatedIdpInitLogoutTest method createIdentityProviderInPrimaryIS.
private void createIdentityProviderInPrimaryIS() throws Exception {
IdentityProvider identityProvider = new IdentityProvider();
identityProvider.setIdentityProviderName(PRIMARY_IS_IDP_NAME);
// Set JWKS Uri to identity provider.
IdentityProviderProperty jwksUriProperty = new IdentityProviderProperty();
jwksUriProperty.setName("jwksUri");
jwksUriProperty.setValue(SECONDARY_IS_JWKS_URI);
IdentityProviderProperty issuerProperty = new IdentityProviderProperty();
issuerProperty.setName("idpIssuerName");
issuerProperty.setValue(SECONDARY_IS_TOKEN_ENDPOINT);
IdentityProviderProperty[] properties = { jwksUriProperty, issuerProperty };
identityProvider.setIdpProperties(properties);
FederatedAuthenticatorConfig oidcAuthnConfig = new FederatedAuthenticatorConfig();
oidcAuthnConfig.setName(PRIMARY_IS_IDP_AUTHENTICATOR_NAME_OIDC);
oidcAuthnConfig.setDisplayName("openidconnect");
oidcAuthnConfig.setEnabled(true);
oidcAuthnConfig.setProperties(getOIDCAuthnConfigProperties());
identityProvider.setDefaultAuthenticatorConfig(oidcAuthnConfig);
identityProvider.setFederatedAuthenticatorConfigs(new FederatedAuthenticatorConfig[] { oidcAuthnConfig });
JustInTimeProvisioningConfig jitConfig = new JustInTimeProvisioningConfig();
jitConfig.setProvisioningEnabled(true);
jitConfig.setProvisioningUserStore("PRIMARY");
identityProvider.setJustInTimeProvisioningConfig(jitConfig);
super.addIdentityProvider(PORT_OFFSET_0, identityProvider);
Assert.assertNotNull(getIdentityProvider(PORT_OFFSET_0, PRIMARY_IS_IDP_NAME), "Failed to create " + "Identity Provider 'trustedIdP' in primary IS");
}
use of org.wso2.carbon.identity.application.common.model.idp.xsd.JustInTimeProvisioningConfig in project product-is by wso2.
the class ApplicationManagementTestCase method testUpdateOutboundProvisioningData.
@Test(alwaysRun = true, description = "2.1.2.7")
public void testUpdateOutboundProvisioningData() {
String applicationName = "TestServiceProvider";
try {
ServiceProvider serviceProvider = applicationManagementServiceClient.getApplication(applicationName);
List<IdentityProvider> provisioningIdps = new ArrayList<IdentityProvider>();
String connector = "provisioning_con_idp_test";
IdentityProvider proIdp = new IdentityProvider();
proIdp.setIdentityProviderName("idp_test");
JustInTimeProvisioningConfig jitpro = new JustInTimeProvisioningConfig();
jitpro.setProvisioningEnabled(true);
proIdp.setJustInTimeProvisioningConfig(jitpro);
ProvisioningConnectorConfig proCon = new ProvisioningConnectorConfig();
proCon.setBlocking(true);
proCon.setName(connector);
proIdp.setDefaultProvisioningConnectorConfig(proCon);
provisioningIdps.add(proIdp);
OutboundProvisioningConfig outboundProConfig = new OutboundProvisioningConfig();
outboundProConfig.setProvisioningIdentityProviders(provisioningIdps.toArray(new IdentityProvider[provisioningIdps.size()]));
serviceProvider.setOutboundProvisioningConfig(outboundProConfig);
applicationManagementServiceClient.updateApplicationData(serviceProvider);
ServiceProvider updatedServiceProvider = applicationManagementServiceClient.getApplication(applicationName);
IdentityProvider identityProvider = updatedServiceProvider.getOutboundProvisioningConfig().getProvisioningIdentityProviders()[0];
Assert.assertEquals(identityProvider.getIdentityProviderName(), "idp_test", "Update IDP failed");
Assert.assertEquals(identityProvider.getJustInTimeProvisioningConfig().getProvisioningEnabled(), true, "Update JIT provisioning config failed");
Assert.assertEquals(identityProvider.getDefaultProvisioningConnectorConfig().getBlocking(), true, "Set provisioning connector blocking failed");
Assert.assertEquals(identityProvider.getDefaultProvisioningConnectorConfig().getName(), connector, "Set default provisioning connector failed");
} catch (Exception e) {
Assert.fail("Error while trying to update outbound provisioning data", e);
}
}
use of org.wso2.carbon.identity.application.common.model.idp.xsd.JustInTimeProvisioningConfig in project identity-api-server by wso2.
the class ServerIdpManagementService method updateJIT.
private void updateJIT(IdentityProvider identityProvider, JustInTimeProvisioning jit) {
if (jit != null) {
JustInTimeProvisioning.SchemeEnum schemeEnum = jit.getScheme();
JustInTimeProvisioningConfig jitConfig = new JustInTimeProvisioningConfig();
jitConfig.setProvisioningEnabled(jit.getIsEnabled());
jitConfig.setProvisioningUserStore(jit.getUserstore());
switch(schemeEnum) {
case PROMPT_USERNAME_PASSWORD_CONSENT:
jitConfig.setModifyUserNameAllowed(true);
jitConfig.setPasswordProvisioningEnabled(true);
jitConfig.setPromptConsent(true);
break;
case PROMPT_PASSWORD_CONSENT:
jitConfig.setModifyUserNameAllowed(false);
jitConfig.setPasswordProvisioningEnabled(true);
jitConfig.setPromptConsent(true);
break;
case PROMPT_CONSENT:
jitConfig.setModifyUserNameAllowed(false);
jitConfig.setPasswordProvisioningEnabled(false);
jitConfig.setPromptConsent(true);
break;
case PROVISION_SILENTLY:
jitConfig.setModifyUserNameAllowed(false);
jitConfig.setPasswordProvisioningEnabled(false);
jitConfig.setPromptConsent(false);
break;
}
identityProvider.setJustInTimeProvisioningConfig(jitConfig);
}
}
Aggregations