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;
}
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);
}
}
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;
}
Aggregations