use of org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig in project product-is by wso2.
the class RegistryMountTestCase method createApplication.
private void createApplication() throws Exception {
ServiceProvider serviceProvider = new ServiceProvider();
serviceProvider.setApplicationName(APPLICATION_NAME);
serviceProvider.setDescription("This is a test Service Provider");
applicationManagementServiceClient.createApplication(serviceProvider);
serviceProvider = applicationManagementServiceClient.getApplication(APPLICATION_NAME);
serviceProvider.getClaimConfig().setClaimMappings(getClaimMappings());
InboundAuthenticationRequestConfig requestConfig = new InboundAuthenticationRequestConfig();
requestConfig.setInboundAuthType(INBOUND_AUTH_TYPE);
requestConfig.setInboundAuthKey(artifact);
Property attributeConsumerServiceIndexProp = new Property();
attributeConsumerServiceIndexProp.setName(ATTRIBUTE_CS_INDEX_NAME);
attributeConsumerServiceIndexProp.setValue(ATTRIBUTE_CS_INDEX_VALUE);
requestConfig.setProperties(new Property[] { attributeConsumerServiceIndexProp });
InboundAuthenticationConfig inboundAuthenticationConfig = new InboundAuthenticationConfig();
inboundAuthenticationConfig.setInboundAuthenticationRequestConfigs(new InboundAuthenticationRequestConfig[] { requestConfig });
serviceProvider.setInboundAuthenticationConfig(inboundAuthenticationConfig);
applicationManagementServiceClient.updateApplicationData(serviceProvider);
}
use of org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig in project product-is by wso2.
the class SAMLErrorResponseTestCase method createApplication.
private void createApplication() throws Exception {
ServiceProvider serviceProvider = new ServiceProvider();
serviceProvider.setApplicationName(APPLICATION_NAME);
serviceProvider.setDescription("This is a test Service Provider");
applicationManagementServiceClient.createApplication(serviceProvider);
serviceProvider = applicationManagementServiceClient.getApplication(APPLICATION_NAME);
InboundAuthenticationRequestConfig requestConfig = new InboundAuthenticationRequestConfig();
requestConfig.setInboundAuthType(INBOUND_AUTH_TYPE);
requestConfig.setInboundAuthKey(ARTIFACT_ID);
InboundAuthenticationConfig inboundAuthenticationConfig = new InboundAuthenticationConfig();
inboundAuthenticationConfig.setInboundAuthenticationRequestConfigs(new InboundAuthenticationRequestConfig[] { requestConfig });
serviceProvider.setInboundAuthenticationConfig(inboundAuthenticationConfig);
applicationManagementServiceClient.updateApplicationData(serviceProvider);
}
use of org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig in project product-is by wso2.
the class SAMLFederationWithFileBasedSPAndIDPTestCase method testCreateServiceProviderInSecondaryIS.
@Test(groups = "wso2.is", description = "Check create service provider in secondary IS")
public void testCreateServiceProviderInSecondaryIS() throws Exception {
super.addServiceProvider(PORT_OFFSET_1, SECONDARY_IS_SERVICE_PROVIDER_NAME);
ServiceProvider serviceProvider = getServiceProvider(PORT_OFFSET_1, SECONDARY_IS_SERVICE_PROVIDER_NAME);
Assert.assertNotNull(serviceProvider, "Failed to create service provider 'secondarySP' in secondary IS");
// Set SAML configurations
updateServiceProviderWithSAMLConfigs(PORT_OFFSET_1, SECONDARY_IS_SAML_ISSUER_NAME, String.format(COMMON_AUTH_URL, DEFAULT_PORT + PORT_OFFSET_0), serviceProvider);
// Set claim configurations
serviceProvider.getClaimConfig().setLocalClaimDialect(false);
serviceProvider.getClaimConfig().setClaimMappings(getClaimMappingsForSPInSecondaryIS());
updateServiceProvider(PORT_OFFSET_1, serviceProvider);
serviceProvider = getServiceProvider(PORT_OFFSET_1, SECONDARY_IS_SERVICE_PROVIDER_NAME);
InboundAuthenticationRequestConfig[] configs = serviceProvider.getInboundAuthenticationConfig().getInboundAuthenticationRequestConfigs();
boolean success = false;
if (configs != null) {
for (InboundAuthenticationRequestConfig config : configs) {
if (SECONDARY_IS_SAML_ISSUER_NAME.equals(config.getInboundAuthKey()) && INBOUND_AUTH_TYPE.equals(config.getInboundAuthType())) {
success = true;
break;
}
}
}
Assert.assertTrue(success, "Failed to update service provider with inbound SAML2 configs in secondary IS");
}
use of org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig in project product-is by wso2.
the class ActiveSTSTestCase method testUpdateSP.
@Test(alwaysRun = true, description = "Update service provider with the required configurations.", dependsOnMethods = { "testAddSP" })
public void testUpdateSP() throws Exception {
List<InboundAuthenticationRequestConfig> inboundAuthenticationRequestConfigs = new ArrayList<>();
InboundAuthenticationRequestConfig inboundAuthenticationRequestConfig = new InboundAuthenticationRequestConfig();
inboundAuthenticationRequestConfig.setInboundAuthKey(ENDPOINT_ADDRESS_VALUE);
inboundAuthenticationRequestConfig.setInboundAuthType(WS_TRUST_AUTH_TYPE);
inboundAuthenticationRequestConfig.setInboundConfigType(INBOUND_CONFIG_TYPE);
inboundAuthenticationRequestConfigs.add(inboundAuthenticationRequestConfig);
serviceProvider.getInboundAuthenticationConfig().setInboundAuthenticationRequestConfigs(inboundAuthenticationRequestConfigs.toArray(new InboundAuthenticationRequestConfig[0]));
applicationManagementServiceClient.updateApplicationData(serviceProvider);
Assert.assertNotEquals(applicationManagementServiceClient.getApplication(SERVICE_PROVIDER_NAME).getInboundAuthenticationConfig().getInboundAuthenticationRequestConfigs().length, 0, "Fail to update service provider with active STS configurations.");
}
use of org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig in project product-is by wso2.
the class TestPassiveSTSFederation method updateServiceProviderWithSAMLConfigs.
private void updateServiceProviderWithSAMLConfigs(int portOffset, String issuerName, String acsUrl, ServiceProvider serviceProvider) throws Exception {
String attributeConsumingServiceIndex = super.createSAML2WebSSOConfiguration(portOffset, getSAMLSSOServiceProviderDTO(issuerName, acsUrl));
Assert.assertNotNull(attributeConsumingServiceIndex, "Failed to create SAML2 Web SSO configuration for issuer '" + issuerName + "'");
InboundAuthenticationRequestConfig samlAuthenticationRequestConfig = new InboundAuthenticationRequestConfig();
samlAuthenticationRequestConfig.setInboundAuthKey(issuerName);
samlAuthenticationRequestConfig.setInboundAuthType(INBOUND_AUTH_TYPE);
org.wso2.carbon.identity.application.common.model.xsd.Property property = new org.wso2.carbon.identity.application.common.model.xsd.Property();
property.setName("attrConsumServiceIndex");
property.setValue(attributeConsumingServiceIndex);
samlAuthenticationRequestConfig.setProperties(new org.wso2.carbon.identity.application.common.model.xsd.Property[] { property });
serviceProvider.getInboundAuthenticationConfig().setInboundAuthenticationRequestConfigs(new InboundAuthenticationRequestConfig[] { samlAuthenticationRequestConfig });
}
Aggregations