Search in sources :

Example 1 with SSOManager

use of org.wildfly.clustering.web.sso.SSOManager 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);
}
Also used : SSOManager(org.wildfly.clustering.web.sso.SSOManager) SimpleBuilder(org.wildfly.clustering.service.SimpleBuilder) SSOManagerBuilder(org.wildfly.clustering.web.undertow.sso.SSOManagerBuilder) URI(java.net.URI) SSOManagerFactory(org.wildfly.clustering.web.sso.SSOManagerFactory) ServiceName(org.jboss.msc.service.ServiceName) SessionIdGenerator(io.undertow.server.session.SessionIdGenerator) Map(java.util.Map)

Example 2 with SSOManager

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

the class DistributableSingleSignOnManagerBuilder method build.

@Override
public ServiceBuilder<SingleSignOnManager> build(ServiceTarget target, ServiceName name, CapabilityServiceSupport support, String serverName, String hostName) {
    ServiceName hostServiceName = UndertowService.virtualHostName(serverName, hostName);
    Builder<SSOManagerFactory<AuthenticatedSession, String, String, Batch>> factoryBuilder = PROVIDER.<AuthenticatedSession, String, String>getBuilder(hostName).configure(support);
    Builder<SessionIdGenerator> generatorBuilder = new SessionIdGeneratorBuilder(hostServiceName);
    Builder<SSOManager<AuthenticatedSession, String, String, Void, Batch>> managerBuilder = new SSOManagerBuilder<>(factoryBuilder.getServiceName(), generatorBuilder.getServiceName(), () -> null);
    Builder<SessionListener> listenerBuilder = new SessionListenerBuilder(managerBuilder.getServiceName());
    Builder<SessionManagerRegistry> registryBuilder = new SessionManagerRegistryBuilder(hostServiceName, listenerBuilder.getServiceName());
    Arrays.asList(factoryBuilder, generatorBuilder, managerBuilder, listenerBuilder, registryBuilder).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).addDependency(registryBuilder.getServiceName(), SessionManagerRegistry.class, this.registry).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : SSOManager(org.wildfly.clustering.web.sso.SSOManager) SSOManagerFactory(org.wildfly.clustering.web.sso.SSOManagerFactory) ValueService(org.jboss.msc.service.ValueService) ServiceName(org.jboss.msc.service.ServiceName) SessionIdGenerator(io.undertow.server.session.SessionIdGenerator) SessionListener(io.undertow.server.session.SessionListener)

Aggregations

SessionIdGenerator (io.undertow.server.session.SessionIdGenerator)2 ServiceName (org.jboss.msc.service.ServiceName)2 SSOManager (org.wildfly.clustering.web.sso.SSOManager)2 SSOManagerFactory (org.wildfly.clustering.web.sso.SSOManagerFactory)2 SessionListener (io.undertow.server.session.SessionListener)1 URI (java.net.URI)1 Map (java.util.Map)1 ValueService (org.jboss.msc.service.ValueService)1 SimpleBuilder (org.wildfly.clustering.service.SimpleBuilder)1 SSOManagerBuilder (org.wildfly.clustering.web.undertow.sso.SSOManagerBuilder)1