use of org.wildfly.clustering.web.undertow.sso.SSOManagerBuilder in project wildfly by wildfly.
the class DistributableSingleSignOnManagerBuilder method build.
@Override
public ServiceBuilder<SingleSignOnManager> build(ServiceTarget target, ServiceName name, CapabilityServiceSupport support, String securityDomainName, SessionIdGenerator generator) {
ServiceName securityDomainServiceName = support.getCapabilityServiceName(ApplicationSecurityDomainDefinition.APPLICATION_SECURITY_DOMAIN_CAPABILITY, securityDomainName);
Builder<SSOManagerFactory<ElytronAuthentication, String, Map.Entry<String, URI>, Batch>> factoryBuilder = PROVIDER.<ElytronAuthentication, String, Map.Entry<String, URI>>getBuilder(securityDomainName).configure(support);
Builder<SessionIdGenerator> generatorBuilder = new SimpleBuilder<>(securityDomainServiceName.append("generator"), generator);
Builder<SSOManager<ElytronAuthentication, String, Map.Entry<String, URI>, LocalSSOContext, Batch>> managerBuilder = new SSOManagerBuilder<>(factoryBuilder.getServiceName(), generatorBuilder.getServiceName(), new LocalSSOContextFactory());
Arrays.asList(factoryBuilder, generatorBuilder, managerBuilder).forEach(builder -> builder.build(target).setInitialMode(ServiceController.Mode.ON_DEMAND).install());
return target.addService(name, new ValueService<>(this)).addDependency(managerBuilder.getServiceName(), SSOManager.class, this.manager).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Aggregations