Search in sources :

Example 21 with InboundAuthenticationRequestConfig

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);
}
Also used : InboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig) ServiceProvider(org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider) InboundAuthenticationRequestConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig) Property(org.wso2.carbon.identity.application.common.model.xsd.Property)

Example 22 with InboundAuthenticationRequestConfig

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);
}
Also used : InboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig) ServiceProvider(org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider) InboundAuthenticationRequestConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig)

Example 23 with InboundAuthenticationRequestConfig

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");
}
Also used : ServiceProvider(org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider) InboundAuthenticationRequestConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig) Test(org.testng.annotations.Test)

Example 24 with InboundAuthenticationRequestConfig

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.");
}
Also used : ArrayList(java.util.ArrayList) InboundAuthenticationRequestConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig) Test(org.testng.annotations.Test) ISIntegrationTest(org.wso2.identity.integration.common.utils.ISIntegrationTest)

Example 25 with InboundAuthenticationRequestConfig

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 });
}
Also used : InboundAuthenticationRequestConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig) Property(org.wso2.carbon.identity.application.common.model.idp.xsd.Property)

Aggregations

InboundAuthenticationRequestConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig)54 InboundAuthenticationRequestConfig (org.wso2.carbon.identity.application.common.model.InboundAuthenticationRequestConfig)39 ServiceProvider (org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider)37 ArrayList (java.util.ArrayList)24 Property (org.wso2.carbon.identity.application.common.model.xsd.Property)23 InboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig)21 InboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.InboundAuthenticationConfig)15 Property (org.wso2.carbon.identity.application.common.model.Property)14 IdentityApplicationManagementException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)13 Test (org.testng.annotations.Test)12 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)12 Property (org.wso2.carbon.identity.application.common.model.idp.xsd.Property)9 OutboundProvisioningConfig (org.wso2.carbon.identity.application.common.model.xsd.OutboundProvisioningConfig)9 IdentityOAuthAdminException (org.wso2.carbon.identity.oauth.IdentityOAuthAdminException)7 OAuthConsumerAppDTO (org.wso2.carbon.identity.oauth.stub.dto.OAuthConsumerAppDTO)7 FederatedAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.idp.xsd.FederatedAuthenticatorConfig)6 IdentityProvider (org.wso2.carbon.identity.application.common.model.idp.xsd.IdentityProvider)6 AuthenticationStep (org.wso2.carbon.identity.application.common.model.xsd.AuthenticationStep)6 Claim (org.wso2.carbon.identity.application.common.model.xsd.Claim)6 ClaimConfig (org.wso2.carbon.identity.application.common.model.xsd.ClaimConfig)6