Search in sources :

Example 1 with SPConfiguration

use of org.wildfly.extension.picketlink.federation.config.SPConfiguration 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 SPConfiguration

use of org.wildfly.extension.picketlink.federation.config.SPConfiguration in project wildfly by wildfly.

the class ServiceProviderAddHandler method launchService.

public static void launchService(OperationContext context, PathAddress pathAddress, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
    String alias = pathAddress.getLastElement().getValue();
    ServiceProviderService service = new ServiceProviderService(toSPConfig(context, model, alias));
    ServiceBuilder<ServiceProviderService> serviceBuilder = context.getServiceTarget().addService(ServiceProviderService.createServiceName(alias), service);
    String federationAlias = pathAddress.subAddress(0, pathAddress.size() - 1).getLastElement().getValue();
    serviceBuilder.addDependency(FederationService.createServiceName(federationAlias), FederationService.class, service.getFederationService());
    configureHandler(context, model, service);
    SPConfiguration configuration = service.getConfiguration();
    serviceBuilder.addDependency(SecurityDomainService.SERVICE_NAME.append(configuration.getSecurityDomain()));
    if (verificationHandler != null) {
        serviceBuilder.addListener(verificationHandler);
    }
    ServiceController<ServiceProviderService> controller = serviceBuilder.install();
    if (newControllers != null) {
        newControllers.add(controller);
    }
}
Also used : ServiceProviderService(org.wildfly.extension.picketlink.federation.service.ServiceProviderService) SPConfiguration(org.wildfly.extension.picketlink.federation.config.SPConfiguration)

Example 3 with SPConfiguration

use of org.wildfly.extension.picketlink.federation.config.SPConfiguration in project wildfly by wildfly.

the class ServiceProviderAddHandler method toSPConfig.

static SPConfiguration toSPConfig(OperationContext context, ModelNode fromModel, String alias) throws OperationFailedException {
    SPConfiguration spType = new SPConfiguration(alias);
    String url = ServiceProviderResourceDefinition.URL.resolveModelAttribute(context, fromModel).asString();
    spType.setServiceURL(url);
    String securityDomain = ServiceProviderResourceDefinition.SECURITY_DOMAIN.resolveModelAttribute(context, fromModel).asString();
    spType.setSecurityDomain(securityDomain);
    boolean postBinding = ServiceProviderResourceDefinition.POST_BINDING.resolveModelAttribute(context, fromModel).asBoolean();
    spType.setPostBinding(postBinding);
    boolean supportsSignatures = ServiceProviderResourceDefinition.SUPPORT_SIGNATURES.resolveModelAttribute(context, fromModel).asBoolean();
    spType.setSupportsSignature(supportsSignatures);
    boolean supportsMetadata = ServiceProviderResourceDefinition.SUPPORT_METADATA.resolveModelAttribute(context, fromModel).asBoolean();
    spType.setSupportMetadata(supportsMetadata);
    boolean strictPostBinding = ServiceProviderResourceDefinition.STRICT_POST_BINDING.resolveModelAttribute(context, fromModel).asBoolean();
    spType.setIdpUsesPostBinding(strictPostBinding);
    String errorPage = ServiceProviderResourceDefinition.ERROR_PAGE.resolveModelAttribute(context, fromModel).asString();
    spType.setErrorPage(errorPage);
    String logoutPage = ServiceProviderResourceDefinition.LOGOUT_PAGE.resolveModelAttribute(context, fromModel).asString();
    spType.setLogOutPage(logoutPage);
    return spType;
}
Also used : SPConfiguration(org.wildfly.extension.picketlink.federation.config.SPConfiguration)

Aggregations

SPConfiguration (org.wildfly.extension.picketlink.federation.config.SPConfiguration)3 ProcessingException (org.picketlink.common.exceptions.ProcessingException)1 ProviderType (org.picketlink.config.federation.ProviderType)1 SPType (org.picketlink.config.federation.SPType)1 SPPostMetadataConfigurationProvider (org.picketlink.identity.federation.web.config.SPPostMetadataConfigurationProvider)1 SPRedirectMetadataConfigurationProvider (org.picketlink.identity.federation.web.config.SPRedirectMetadataConfigurationProvider)1 ServiceProviderService (org.wildfly.extension.picketlink.federation.service.ServiceProviderService)1