Search in sources :

Example 1 with DefaultTicketFactory

use of org.apereo.cas.ticket.factory.DefaultTicketFactory in project cas by apereo.

the class CentralAuthenticationServiceImplWithMockitoTests method getTicketFactory.

private TicketFactory getTicketFactory() {
    final DefaultTicketFactory factory = new DefaultTicketFactory();
    factory.addTicketFactory(ProxyGrantingTicket.class, new DefaultProxyGrantingTicketFactory(null, null, null));
    factory.addTicketFactory(TicketGrantingTicket.class, new DefaultTicketGrantingTicketFactory(null, null, null));
    factory.addTicketFactory(ServiceTicket.class, new DefaultServiceTicketFactory(new NeverExpiresExpirationPolicy(), new HashMap<>(0), false, null));
    factory.addTicketFactory(ProxyTicket.class, new DefaultProxyTicketFactory(null, new HashMap<>(0), null, true));
    factory.addTicketFactory(TransientSessionTicket.class, new DefaultTransientSessionTicketFactory(new NeverExpiresExpirationPolicy()));
    return factory;
}
Also used : DefaultServiceTicketFactory(org.apereo.cas.ticket.factory.DefaultServiceTicketFactory) NeverExpiresExpirationPolicy(org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy) HashMap(java.util.HashMap) DefaultProxyTicketFactory(org.apereo.cas.ticket.factory.DefaultProxyTicketFactory) DefaultTicketGrantingTicketFactory(org.apereo.cas.ticket.factory.DefaultTicketGrantingTicketFactory) DefaultTicketFactory(org.apereo.cas.ticket.factory.DefaultTicketFactory) DefaultTransientSessionTicketFactory(org.apereo.cas.ticket.factory.DefaultTransientSessionTicketFactory) DefaultProxyGrantingTicketFactory(org.apereo.cas.ticket.factory.DefaultProxyGrantingTicketFactory)

Example 2 with DefaultTicketFactory

use of org.apereo.cas.ticket.factory.DefaultTicketFactory in project cas by apereo.

the class CasCoreTicketsConfiguration method defaultTicketFactory.

@ConditionalOnMissingBean(name = "defaultTicketFactory")
@Bean
public TicketFactory defaultTicketFactory() {
    final DefaultTicketFactory factory = new DefaultTicketFactory();
    factory.addTicketFactory(TransientSessionTicket.class, defaultTransientSessionTicketFactory()).addTicketFactory(ProxyGrantingTicket.class, defaultProxyGrantingTicketFactory()).addTicketFactory(TicketGrantingTicket.class, defaultTicketGrantingTicketFactory()).addTicketFactory(ServiceTicket.class, defaultServiceTicketFactory()).addTicketFactory(ProxyTicket.class, defaultProxyTicketFactory());
    return factory;
}
Also used : DefaultTicketFactory(org.apereo.cas.ticket.factory.DefaultTicketFactory) ServiceTicket(org.apereo.cas.ticket.ServiceTicket) ProxyGrantingTicket(org.apereo.cas.ticket.proxy.ProxyGrantingTicket) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with DefaultTicketFactory

use of org.apereo.cas.ticket.factory.DefaultTicketFactory in project cas by apereo.

the class DefaultCentralAuthenticationServiceMockitoTests method getTicketFactory.

private static TicketFactory getTicketFactory() {
    val factory = new DefaultTicketFactory();
    factory.addTicketFactory(ProxyGrantingTicket.class, new DefaultProxyGrantingTicketFactory(null, null, CipherExecutor.noOpOfStringToString(), mock(ServicesManager.class)));
    factory.addTicketFactory(TicketGrantingTicket.class, new DefaultTicketGrantingTicketFactory(null, null, CipherExecutor.noOpOfSerializableToString(), mock(ServicesManager.class)));
    factory.addTicketFactory(ServiceTicket.class, new DefaultServiceTicketFactory(neverExpiresExpirationPolicyBuilder(), new HashMap<>(0), false, CipherExecutor.noOpOfStringToString(), mock(ServicesManager.class)));
    factory.addTicketFactory(ProxyTicket.class, new DefaultProxyTicketFactory(null, new HashMap<>(0), CipherExecutor.noOpOfStringToString(), true, mock(ServicesManager.class)));
    factory.addTicketFactory(TransientSessionTicket.class, new DefaultTransientSessionTicketFactory(neverExpiresExpirationPolicyBuilder()));
    assertEquals(Ticket.class, factory.getTicketType());
    return factory;
}
Also used : lombok.val(lombok.val) DefaultServiceTicketFactory(org.apereo.cas.ticket.factory.DefaultServiceTicketFactory) HashMap(java.util.HashMap) DefaultProxyTicketFactory(org.apereo.cas.ticket.factory.DefaultProxyTicketFactory) DefaultTicketGrantingTicketFactory(org.apereo.cas.ticket.factory.DefaultTicketGrantingTicketFactory) DefaultTicketFactory(org.apereo.cas.ticket.factory.DefaultTicketFactory) DefaultTransientSessionTicketFactory(org.apereo.cas.ticket.factory.DefaultTransientSessionTicketFactory) DefaultProxyGrantingTicketFactory(org.apereo.cas.ticket.factory.DefaultProxyGrantingTicketFactory)

Aggregations

DefaultTicketFactory (org.apereo.cas.ticket.factory.DefaultTicketFactory)3 HashMap (java.util.HashMap)2 DefaultProxyGrantingTicketFactory (org.apereo.cas.ticket.factory.DefaultProxyGrantingTicketFactory)2 DefaultProxyTicketFactory (org.apereo.cas.ticket.factory.DefaultProxyTicketFactory)2 DefaultServiceTicketFactory (org.apereo.cas.ticket.factory.DefaultServiceTicketFactory)2 DefaultTicketGrantingTicketFactory (org.apereo.cas.ticket.factory.DefaultTicketGrantingTicketFactory)2 DefaultTransientSessionTicketFactory (org.apereo.cas.ticket.factory.DefaultTransientSessionTicketFactory)2 lombok.val (lombok.val)1 ServiceTicket (org.apereo.cas.ticket.ServiceTicket)1 ProxyGrantingTicket (org.apereo.cas.ticket.proxy.ProxyGrantingTicket)1 NeverExpiresExpirationPolicy (org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1