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.authentication.AuthenticationServiceSelectionPlan |
authenticationRequestServiceSelectionStrategies
The service selection strategy during validation events.
|
protected org.apereo.cas.CipherExecutor<java.lang.String,java.lang.String> |
cipherExecutor
Cipher executor to handle ticket validation.
|
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.audit.AuditableExecution |
registeredServiceAccessStrategyEnforcer
Enforce registered service access in an auditable way
since the access strategy is not usually managed as a Spring bean.
|
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. |
| Constructor and Description |
|---|
AbstractCentralAuthenticationService() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteTicket(java.lang.String ticketId) |
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.
|
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(java.util.function.Predicate<org.apereo.cas.ticket.Ticket> predicate) |
protected boolean |
isTicketAuthenticityVerified(java.lang.String ticketId)
Verify the ticket id received is actually legitimate
before contacting downstream systems to find and process it.
|
protected org.apereo.cas.authentication.principal.Service |
resolveServiceFromAuthenticationRequest(org.apereo.cas.authentication.principal.Service service)
Resolve service from authentication request.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected org.springframework.context.ApplicationEventPublisher applicationEventPublisher
protected final org.apereo.cas.ticket.registry.TicketRegistry ticketRegistry
TicketRegistry for storing and retrieving tickets as needed.protected final org.apereo.cas.services.ServicesManager servicesManager
protected final org.apereo.cas.logout.LogoutManager logoutManager
protected final org.apereo.cas.ticket.TicketFactory ticketFactory
protected final org.apereo.cas.authentication.AuthenticationServiceSelectionPlan authenticationRequestServiceSelectionStrategies
protected final org.apereo.cas.authentication.ContextualAuthenticationPolicyFactory<org.apereo.cas.services.ServiceContext> serviceContextAuthenticationPolicyFactory
protected final org.apereo.cas.authentication.principal.PrincipalFactory principalFactory
protected final org.apereo.cas.CipherExecutor<java.lang.String,java.lang.String> cipherExecutor
protected final org.apereo.cas.audit.AuditableExecution registeredServiceAccessStrategyEnforcer
public AbstractCentralAuthenticationService()
protected void doPublishEvent(org.springframework.context.ApplicationEvent e)
e - the event@Transactional(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 org.apereo.cas.ticket.Ticket getTicket(@NonNull
java.lang.String ticketId)
throws org.apereo.cas.ticket.InvalidTicketException
getTicket in interface org.apereo.cas.CentralAuthenticationServiceorg.apereo.cas.ticket.InvalidTicketException@Transactional(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(@NonNull
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(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(java.util.function.Predicate<org.apereo.cas.ticket.Ticket> predicate)
getTickets in interface org.apereo.cas.CentralAuthenticationService@Transactional(transactionManager="ticketTransactionManager")
@Timed(name="DELETE_TICKET_TIMER")
@Metered(name="DELETE_TICKET_METER")
@Counted(name="DELETE_TICKET_COUNTER",
monotonic=true)
public void deleteTicket(java.lang.String ticketId)
deleteTicket 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.CentralAuthenticationServiceprotected org.apereo.cas.authentication.principal.Service resolveServiceFromAuthenticationRequest(org.apereo.cas.authentication.principal.Service service)
service - the serviceprotected boolean isTicketAuthenticityVerified(java.lang.String ticketId)
ticketId - the ticket id