Search in sources :

Example 11 with InboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig in project product-is by wso2.

the class UserSessionTest method createServiceProvider.

private ServiceProvider createServiceProvider(String issuer, String serviceProviderName) throws Exception {
    ssoConfigServiceClient.addServiceProvider(createSAMLServiceProviderDTO(issuer));
    ServiceProvider serviceProvider = new ServiceProvider();
    serviceProvider.setApplicationName(serviceProviderName);
    serviceProvider.setDescription(SERVICE_PROVIDER_DESC);
    appMgtclient.createApplication(serviceProvider);
    serviceProvider = appMgtclient.getApplication(serviceProviderName);
    InboundAuthenticationRequestConfig requestConfig = new InboundAuthenticationRequestConfig();
    requestConfig.setInboundAuthKey(issuer);
    requestConfig.setInboundAuthType(SAMLSSO);
    Property attributeConsumerServiceIndexProp = new Property();
    attributeConsumerServiceIndexProp.setName("attrConsumServiceIndex");
    attributeConsumerServiceIndexProp.setValue("1239245949");
    requestConfig.setProperties(new Property[] { attributeConsumerServiceIndexProp });
    InboundAuthenticationConfig inboundAuthenticationConfig = new InboundAuthenticationConfig();
    inboundAuthenticationConfig.setInboundAuthenticationRequestConfigs(new InboundAuthenticationRequestConfig[] { requestConfig });
    serviceProvider.setInboundAuthenticationConfig(inboundAuthenticationConfig);
    RequestPathAuthenticatorConfig requestPathAuthenticatorConfig = new RequestPathAuthenticatorConfig();
    requestPathAuthenticatorConfig.setName(BASIC_AUTH_REQUEST_PATH_AUTHENTICATOR);
    serviceProvider.setRequestPathAuthenticatorConfigs(new RequestPathAuthenticatorConfig[] { requestPathAuthenticatorConfig });
    appMgtclient.updateApplicationData(serviceProvider);
    return appMgtclient.getApplication(serviceProviderName);
}
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) RequestPathAuthenticatorConfig(org.wso2.carbon.identity.application.common.model.xsd.RequestPathAuthenticatorConfig) Property(org.wso2.carbon.identity.application.common.model.xsd.Property)

Example 12 with InboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig in project product-is by wso2.

the class AbstractSAMLSSOTestCase method createApplication.

public ServiceProvider createApplication(ServiceProvider serviceProvider, SAMLConfig config, String appName) throws Exception {
    serviceProvider.setApplicationName(appName);
    serviceProvider.setDescription("This is a test Service Provider");
    applicationManagementServiceClient.createApplication(serviceProvider);
    serviceProvider = applicationManagementServiceClient.getApplication(appName);
    serviceProvider.getClaimConfig().setClaimMappings(getClaimMappings());
    InboundAuthenticationRequestConfig requestConfig = new InboundAuthenticationRequestConfig();
    requestConfig.setInboundAuthType(INBOUND_AUTH_TYPE);
    requestConfig.setInboundAuthKey(config.getApp().getArtifact());
    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 });
    if (config.httpBinding.equals(HttpBinding.HTTP_SOAP)) {
        RequestPathAuthenticatorConfig requestPathAuthenticatorConfig = new RequestPathAuthenticatorConfig();
        requestPathAuthenticatorConfig.setName("BasicAuthRequestPathAuthenticator");
        serviceProvider.setRequestPathAuthenticatorConfigs(new RequestPathAuthenticatorConfig[] { requestPathAuthenticatorConfig });
    }
    if (samlArtResolve) {
        LocalAndOutboundAuthenticationConfig localAndOutboundAuthenticationConfig = new LocalAndOutboundAuthenticationConfig();
        localAndOutboundAuthenticationConfig.setSkipConsent(true);
        serviceProvider.setLocalAndOutBoundAuthenticationConfig(localAndOutboundAuthenticationConfig);
    }
    serviceProvider.setInboundAuthenticationConfig(inboundAuthenticationConfig);
    applicationManagementServiceClient.updateApplicationData(serviceProvider);
    return serviceProvider;
}
Also used : LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig) InboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig) InboundAuthenticationRequestConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig) RequestPathAuthenticatorConfig(org.wso2.carbon.identity.application.common.model.xsd.RequestPathAuthenticatorConfig) Property(org.wso2.carbon.identity.application.common.model.xsd.Property)

Example 13 with InboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig 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 14 with InboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig 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 15 with InboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig in project product-is by wso2.

the class TenantDropDownTestCase 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(SAML_ISSUER);
    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);
    serviceProvider.setSaasApp(true);
    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)

Aggregations

InboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig)21 InboundAuthenticationRequestConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig)21 ServiceProvider (org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider)19 InboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.InboundAuthenticationConfig)16 InboundAuthenticationRequestConfig (org.wso2.carbon.identity.application.common.model.InboundAuthenticationRequestConfig)15 Property (org.wso2.carbon.identity.application.common.model.xsd.Property)15 ArrayList (java.util.ArrayList)9 Property (org.wso2.carbon.identity.application.common.model.Property)7 IdentityApplicationManagementException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)6 RequestPathAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.xsd.RequestPathAuthenticatorConfig)5 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)4 LocalAndOutboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig)4 PreparedStatement (java.sql.PreparedStatement)3 SQLException (java.sql.SQLException)3 NamedPreparedStatement (org.wso2.carbon.database.utils.jdbc.NamedPreparedStatement)3 ServiceProviderProperty (org.wso2.carbon.identity.application.common.model.ServiceProviderProperty)3 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 APIError (org.wso2.carbon.identity.api.server.common.error.APIError)2 AuthenticationStep (org.wso2.carbon.identity.application.common.model.xsd.AuthenticationStep)2