public abstract class AbstractCentralAuthenticationService
extends java.lang.Object
implements org.apereo.cas.CentralAuthenticationService, java.io.Serializable, org.springframework.context.ApplicationEventPublisherAware
CentralAuthenticationService that provides access to
the needed scaffolding and services that are necessary to CAS, such as ticket registry, service registry, etc.
The intention here is to allow extensions to easily benefit these already-configured components
without having to to duplicate them again.| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ApplicationEventPublisher |
applicationEventPublisher
Application event publisher.
|
protected org.apereo.cas.CipherExecutor<java.lang.String,java.lang.String> |
cipherExecutor
Cipher executor to handle ticket validation.
|
protected org.slf4j.Logger |
logger
Log instance for logging events, info, warnings, errors, etc.
|
protected org.apereo.cas.logout.LogoutManager |
logoutManager
The logout manager.
|
protected org.apereo.cas.authentication.principal.PrincipalFactory |
principalFactory
Factory to create the principal type.
|
protected org.apereo.cas.authentication.ContextualAuthenticationPolicyFactory<org.apereo.cas.services.ServiceContext> |
serviceContextAuthenticationPolicyFactory
Authentication policy that uses a service context to produce stateful security policies to apply when
authenticating credentials.
|
protected org.apereo.cas.services.ServicesManager |
servicesManager
Implementation of Service Manager.
|
protected org.apereo.cas.ticket.TicketFactory |
ticketFactory
The ticket factory.
|
protected org.apereo.cas.ticket.registry.TicketRegistry |
ticketRegistry
TicketRegistry for storing and retrieving tickets as needed. |
protected java.util.List<org.apereo.cas.validation.ValidationServiceSelectionStrategy> |
validationServiceSelectionStrategies
The service selection strategy during validation events.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCentralAuthenticationService()
Instantiates a new Central authentication service impl.
|
|
AbstractCentralAuthenticationService(org.apereo.cas.ticket.registry.TicketRegistry ticketRegistry,
org.apereo.cas.ticket.TicketFactory ticketFactory,
org.apereo.cas.services.ServicesManager servicesManager,
org.apereo.cas.logout.LogoutManager logoutManager)
Build the central authentication service implementation.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doPublishEvent(org.springframework.context.ApplicationEvent e)
Publish CAS events.
|
protected void |
evaluateProxiedServiceIfNeeded(org.apereo.cas.authentication.principal.Service service,
org.apereo.cas.ticket.TicketGrantingTicket ticketGrantingTicket,
org.apereo.cas.services.RegisteredService registeredService)
Evaluate proxied service if needed.
|
protected org.apereo.cas.authentication.Authentication |
getAuthenticationSatisfiedByPolicy(org.apereo.cas.authentication.Authentication authentication,
org.apereo.cas.services.ServiceContext context)
Gets the authentication satisfied by policy.
|
<T extends org.apereo.cas.ticket.Ticket> |
getTicket(java.lang.String ticketId) |
<T extends org.apereo.cas.ticket.Ticket> |
getTicket(java.lang.String ticketId,
java.lang.Class<T> clazz) |
java.util.Collection<org.apereo.cas.ticket.Ticket> |
getTickets(com.google.common.base.Predicate<org.apereo.cas.ticket.Ticket> predicate) |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
setCipherExecutor(org.apereo.cas.CipherExecutor<java.lang.String,java.lang.String> cipherExecutor) |
void |
setLogoutManager(org.apereo.cas.logout.LogoutManager logoutManager) |
void |
setPrincipalFactory(org.apereo.cas.authentication.principal.PrincipalFactory principalFactory)
Sets principal factory to create principal objects.
|
void |
setServiceContextAuthenticationPolicyFactory(org.apereo.cas.authentication.ContextualAuthenticationPolicyFactory<org.apereo.cas.services.ServiceContext> policy) |
void |
setServicesManager(org.apereo.cas.services.ServicesManager servicesManager) |
void |
setTicketFactory(org.apereo.cas.ticket.TicketFactory ticketFactory) |
void |
setTicketRegistry(org.apereo.cas.ticket.registry.TicketRegistry ticketRegistry) |
void |
setValidationServiceSelectionStrategies(java.util.List list) |
org.apereo.cas.ticket.Ticket |
updateTicket(org.apereo.cas.ticket.Ticket ticket) |
protected void |
verifyTicketState(org.apereo.cas.ticket.Ticket ticket,
java.lang.String id,
java.lang.Class clazz)
Validate ticket expiration policy and throws exception if ticket is no longer valid.
|
protected transient org.slf4j.Logger logger
@Autowired protected org.springframework.context.ApplicationEventPublisher applicationEventPublisher
protected org.apereo.cas.ticket.registry.TicketRegistry ticketRegistry
TicketRegistry for storing and retrieving tickets as needed.protected org.apereo.cas.services.ServicesManager servicesManager
protected org.apereo.cas.logout.LogoutManager logoutManager
protected org.apereo.cas.ticket.TicketFactory ticketFactory
protected java.util.List<org.apereo.cas.validation.ValidationServiceSelectionStrategy> validationServiceSelectionStrategies
protected org.apereo.cas.authentication.ContextualAuthenticationPolicyFactory<org.apereo.cas.services.ServiceContext> serviceContextAuthenticationPolicyFactory
protected org.apereo.cas.authentication.principal.PrincipalFactory principalFactory
protected org.apereo.cas.CipherExecutor<java.lang.String,java.lang.String> cipherExecutor
protected AbstractCentralAuthenticationService()
public AbstractCentralAuthenticationService(org.apereo.cas.ticket.registry.TicketRegistry ticketRegistry,
org.apereo.cas.ticket.TicketFactory ticketFactory,
org.apereo.cas.services.ServicesManager servicesManager,
org.apereo.cas.logout.LogoutManager logoutManager)
ticketRegistry - the tickets registry.ticketFactory - the ticket factoryservicesManager - the services manager.logoutManager - the logout manager.public void setServiceContextAuthenticationPolicyFactory(org.apereo.cas.authentication.ContextualAuthenticationPolicyFactory<org.apereo.cas.services.ServiceContext> policy)
public void setTicketFactory(org.apereo.cas.ticket.TicketFactory ticketFactory)
public void setPrincipalFactory(org.apereo.cas.authentication.principal.PrincipalFactory principalFactory)
principalFactory - the principal factoryprotected void doPublishEvent(org.springframework.context.ApplicationEvent e)
e - the event@Transactional(readOnly=true,
transactionManager="ticketTransactionManager",
noRollbackFor=org.apereo.cas.ticket.InvalidTicketException.class)
@Timed(name="GET_TICKET_TIMER")
@Metered(name="GET_TICKET_METER")
@Counted(name="GET_TICKET_COUNTER",
monotonic=true)
public <T extends org.apereo.cas.ticket.Ticket> T getTicket(java.lang.String ticketId)
throws org.apereo.cas.ticket.InvalidTicketException
getTicket in interface org.apereo.cas.CentralAuthenticationServiceorg.apereo.cas.ticket.InvalidTicketException@Transactional(readOnly=true,
transactionManager="ticketTransactionManager",
noRollbackFor=org.apereo.cas.ticket.InvalidTicketException.class)
@Timed(name="GET_TICKET_TIMER")
@Metered(name="GET_TICKET_METER")
@Counted(name="GET_TICKET_COUNTER",
monotonic=true)
public <T extends org.apereo.cas.ticket.Ticket> T getTicket(java.lang.String ticketId,
java.lang.Class<T> clazz)
throws org.apereo.cas.ticket.InvalidTicketException
Note: Synchronization on ticket object in case of cache based registry doesn't serialize access to critical section. The reason is that cache pulls serialized data and builds new object, most likely for each pull. Is this synchronization needed here?
getTicket in interface org.apereo.cas.CentralAuthenticationServiceorg.apereo.cas.ticket.InvalidTicketException@Transactional(readOnly=true,
transactionManager="ticketTransactionManager")
@Timed(name="GET_TICKETS_TIMER")
@Metered(name="GET_TICKETS_METER")
@Counted(name="GET_TICKETS_COUNTER",
monotonic=true)
public java.util.Collection<org.apereo.cas.ticket.Ticket> getTickets(com.google.common.base.Predicate<org.apereo.cas.ticket.Ticket> predicate)
getTickets in interface org.apereo.cas.CentralAuthenticationServiceprotected org.apereo.cas.authentication.Authentication getAuthenticationSatisfiedByPolicy(org.apereo.cas.authentication.Authentication authentication,
org.apereo.cas.services.ServiceContext context)
throws org.apereo.cas.ticket.AbstractTicketException
authentication - the authenticationcontext - the contextorg.apereo.cas.ticket.AbstractTicketException - the ticket exceptionprotected void evaluateProxiedServiceIfNeeded(org.apereo.cas.authentication.principal.Service service,
org.apereo.cas.ticket.TicketGrantingTicket ticketGrantingTicket,
org.apereo.cas.services.RegisteredService registeredService)
service - the serviceticketGrantingTicket - the ticket granting ticketregisteredService - the registered serviceprotected void verifyTicketState(org.apereo.cas.ticket.Ticket ticket,
java.lang.String id,
java.lang.Class clazz)
ticket - the ticketid - the original idclazz - the clazzpublic org.apereo.cas.ticket.Ticket updateTicket(org.apereo.cas.ticket.Ticket ticket)
updateTicket in interface org.apereo.cas.CentralAuthenticationServicepublic void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwarepublic void setTicketRegistry(org.apereo.cas.ticket.registry.TicketRegistry ticketRegistry)
public void setServicesManager(org.apereo.cas.services.ServicesManager servicesManager)
public void setLogoutManager(org.apereo.cas.logout.LogoutManager logoutManager)
public void setValidationServiceSelectionStrategies(java.util.List list)
public void setCipherExecutor(org.apereo.cas.CipherExecutor<java.lang.String,java.lang.String> cipherExecutor)