Search in sources :

Example 1 with ProcessingException

use of org.picketlink.common.exceptions.ProcessingException in project wildfly by wildfly.

the class DomainModelConfigProvider method getSPConfiguration.

@Override
public SPType getSPConfiguration() {
    ProviderType providerType = this.getPicketLinkConfiguration().getIdpOrSP();
    if (providerType instanceof SPConfiguration) {
        SPConfiguration configuration = (SPConfiguration) providerType;
        if (configuration.isSupportMetadata()) {
            try {
                SPType metadataConfig;
                if (configuration.isPostBinding()) {
                    metadataConfig = new SPPostMetadataConfigurationProvider().getSPConfiguration();
                } else {
                    metadataConfig = new SPRedirectMetadataConfigurationProvider().getSPConfiguration();
                }
                metadataConfig.importFrom(configuration);
                providerType = metadataConfig;
            } catch (ProcessingException e) {
                throw PicketLinkLogger.ROOT_LOGGER.federationSAMLMetadataConfigError(configuration.getAlias(), e);
            }
        }
        if (configParsedSPType != null) {
            configuration.importFrom(configParsedSPType);
        }
        return (SPType) providerType;
    }
    return null;
}
Also used : SPPostMetadataConfigurationProvider(org.picketlink.identity.federation.web.config.SPPostMetadataConfigurationProvider) SPType(org.picketlink.config.federation.SPType) ProviderType(org.picketlink.config.federation.ProviderType) SPRedirectMetadataConfigurationProvider(org.picketlink.identity.federation.web.config.SPRedirectMetadataConfigurationProvider) SPConfiguration(org.wildfly.extension.picketlink.federation.config.SPConfiguration) ProcessingException(org.picketlink.common.exceptions.ProcessingException)

Example 2 with ProcessingException

use of org.picketlink.common.exceptions.ProcessingException in project wildfly by wildfly.

the class DomainModelConfigProvider method getIDPConfiguration.

@Override
public IDPType getIDPConfiguration() {
    ProviderType providerType = getPicketLinkConfiguration().getIdpOrSP();
    if (providerType instanceof IDPConfiguration) {
        IDPConfiguration configuration = (IDPConfiguration) providerType;
        if (configuration.isSupportMetadata()) {
            try {
                IDPType metadataConfig = new IDPMetadataConfigurationProvider().getIDPConfiguration();
                metadataConfig.importFrom(configuration);
                providerType = metadataConfig;
            } catch (ProcessingException e) {
                throw PicketLinkLogger.ROOT_LOGGER.federationSAMLMetadataConfigError(configuration.getAlias(), e);
            }
        }
        if (configParsedIDPType != null) {
            configuration.importFrom(configParsedIDPType);
        }
        return (IDPType) providerType;
    }
    return null;
}
Also used : IDPType(org.picketlink.config.federation.IDPType) IDPConfiguration(org.wildfly.extension.picketlink.federation.config.IDPConfiguration) ProviderType(org.picketlink.config.federation.ProviderType) IDPMetadataConfigurationProvider(org.picketlink.identity.federation.web.config.IDPMetadataConfigurationProvider) ProcessingException(org.picketlink.common.exceptions.ProcessingException)

Aggregations

ProcessingException (org.picketlink.common.exceptions.ProcessingException)2 ProviderType (org.picketlink.config.federation.ProviderType)2 IDPType (org.picketlink.config.federation.IDPType)1 SPType (org.picketlink.config.federation.SPType)1 IDPMetadataConfigurationProvider (org.picketlink.identity.federation.web.config.IDPMetadataConfigurationProvider)1 SPPostMetadataConfigurationProvider (org.picketlink.identity.federation.web.config.SPPostMetadataConfigurationProvider)1 SPRedirectMetadataConfigurationProvider (org.picketlink.identity.federation.web.config.SPRedirectMetadataConfigurationProvider)1 IDPConfiguration (org.wildfly.extension.picketlink.federation.config.IDPConfiguration)1 SPConfiguration (org.wildfly.extension.picketlink.federation.config.SPConfiguration)1