Search in sources :

Example 1 with DistributableSSOManagementProvider

use of org.wildfly.clustering.web.sso.DistributableSSOManagementProvider in project wildfly by wildfly.

the class DistributableSingleSignOnManagerServiceConfigurator method configure.

@Override
public ServiceConfigurator configure(OperationContext context) {
    String securityDomainName = this.configuration.getSecurityDomainName();
    Supplier<String> generator = this.configuration.getIdentifierGenerator();
    CapabilityServiceSupport support = context.getCapabilityServiceSupport();
    SupplierDependency<DistributableSSOManagementProvider> provider = getProvider(context, securityDomainName);
    ServiceName managerServiceName = this.getServiceName().append("manager");
    this.manager = new ServiceSupplierDependency<>(managerServiceName);
    this.provider = provider;
    this.installer = new Consumer<ServiceTarget>() {

        @Override
        public void accept(ServiceTarget target) {
            ServiceConfigurator factoryConfigurator = provider.get().getServiceConfigurator(securityDomainName).configure(support);
            factoryConfigurator.build(target).install();
            SupplierDependency<SSOManagerFactory<ElytronAuthentication, String, Map.Entry<String, URI>, Batch>> factoryDependency = new ServiceSupplierDependency<>(factoryConfigurator);
            SupplierDependency<SessionIdGenerator> generatorDependency = new SimpleSupplierDependency<>(new SessionIdGeneratorAdapter(generator));
            new SSOManagerServiceConfigurator<>(managerServiceName, factoryDependency, generatorDependency, new LocalSSOContextFactory()).configure(support).build(target).install();
        }
    };
    return this;
}
Also used : ServiceTarget(org.jboss.msc.service.ServiceTarget) SupplierDependency(org.wildfly.clustering.service.SupplierDependency) SimpleSupplierDependency(org.wildfly.clustering.service.SimpleSupplierDependency) ServiceSupplierDependency(org.wildfly.clustering.service.ServiceSupplierDependency) SSOManagerServiceConfigurator(org.wildfly.clustering.web.undertow.sso.SSOManagerServiceConfigurator) DistributableSSOManagementProvider(org.wildfly.clustering.web.sso.DistributableSSOManagementProvider) CapabilityServiceSupport(org.jboss.as.controller.capability.CapabilityServiceSupport) Entry(java.util.Map.Entry) ServiceName(org.jboss.msc.service.ServiceName) Batch(org.wildfly.clustering.ee.Batch) ServiceConfigurator(org.wildfly.clustering.service.ServiceConfigurator) SSOManagerServiceConfigurator(org.wildfly.clustering.web.undertow.sso.SSOManagerServiceConfigurator) CapabilityServiceConfigurator(org.jboss.as.clustering.controller.CapabilityServiceConfigurator)

Example 2 with DistributableSSOManagementProvider

use of org.wildfly.clustering.web.sso.DistributableSSOManagementProvider in project wildfly by wildfly.

the class SSOManagementServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceName name = this.getServiceName();
    ServiceBuilder<?> builder = target.addService(name);
    Consumer<DistributableSSOManagementProvider> provider = builder.provides(name);
    Service service = Service.newInstance(provider, this.get());
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) Service(org.jboss.msc.Service) DistributableSSOManagementProvider(org.wildfly.clustering.web.sso.DistributableSSOManagementProvider)

Aggregations

ServiceName (org.jboss.msc.service.ServiceName)2 DistributableSSOManagementProvider (org.wildfly.clustering.web.sso.DistributableSSOManagementProvider)2 Entry (java.util.Map.Entry)1 CapabilityServiceConfigurator (org.jboss.as.clustering.controller.CapabilityServiceConfigurator)1 CapabilityServiceSupport (org.jboss.as.controller.capability.CapabilityServiceSupport)1 Service (org.jboss.msc.Service)1 ServiceTarget (org.jboss.msc.service.ServiceTarget)1 Batch (org.wildfly.clustering.ee.Batch)1 ServiceConfigurator (org.wildfly.clustering.service.ServiceConfigurator)1 ServiceSupplierDependency (org.wildfly.clustering.service.ServiceSupplierDependency)1 SimpleSupplierDependency (org.wildfly.clustering.service.SimpleSupplierDependency)1 SupplierDependency (org.wildfly.clustering.service.SupplierDependency)1 SSOManagerServiceConfigurator (org.wildfly.clustering.web.undertow.sso.SSOManagerServiceConfigurator)1