Package org.apereo.cas.ticket
Interface TicketGrantingTicket
-
- All Superinterfaces:
AuthenticationAwareTicket,java.lang.Comparable<Ticket>,java.io.Serializable,Ticket,TicketGrantingTicketAwareTicket
- All Known Subinterfaces:
ProxyGrantingTicket
public interface TicketGrantingTicket extends AuthenticationAwareTicket, TicketGrantingTicketAwareTicket
Interface for a ticket granting ticket. A TicketGrantingTicket is the main access into the CAS service layer. Without a TicketGrantingTicket, a user of CAS cannot do anything.- Since:
- 3.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPREFIXThe prefix to use when generating an id for a Ticket Granting Ticket.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<org.apereo.cas.authentication.Authentication>getChainedAuthentications()Gets all authentications (AuthenticationAwareTicket.getAuthentication()from this instance and all dependent tickets that reference this one.default java.util.Collection<java.lang.String>getDescendantTickets()Gets descendant tickets.org.apereo.cas.authentication.principal.ServicegetProxiedBy()Gets the service that produced a proxy-granting ticket.java.util.Map<java.lang.String,org.apereo.cas.authentication.principal.Service>getProxyGrantingTickets()Gets proxy granting tickets created by this TGT.TicketGrantingTicketgetRoot()Gets the ticket-granting ticket at the root of the ticket hierarchy.java.util.Map<java.lang.String,org.apereo.cas.authentication.principal.Service>getServices()Gets an immutable map of service ticket and services accessed by this ticket-granting ticket.ServiceTicketgrantServiceTicket(java.lang.String id, org.apereo.cas.authentication.principal.Service service, ExpirationPolicy expirationPolicy, boolean credentialProvided, boolean onlyTrackMostRecentSession)Grant a ServiceTicket for a specific service.booleanisRoot()Convenience method to determine if the TicketGrantingTicket is the root of the hierarchy of tickets.voidremoveAllServices()Remove all services of the TGT (at logout).voidtrackService(java.lang.String id, org.apereo.cas.authentication.principal.Service service, boolean onlyTrackMostRecentSession)Update service and track session.-
Methods inherited from interface org.apereo.cas.ticket.AuthenticationAwareTicket
getAuthentication
-
Methods inherited from interface org.apereo.cas.ticket.Ticket
getCountOfUses, getCreationTime, getExpirationPolicy, getId, getPrefix, isExpired, markTicketExpired
-
Methods inherited from interface org.apereo.cas.ticket.TicketGrantingTicketAwareTicket
getTicketGrantingTicket
-
-
-
-
Field Detail
-
PREFIX
static final java.lang.String PREFIX
The prefix to use when generating an id for a Ticket Granting Ticket.- See Also:
- Constant Field Values
-
-
Method Detail
-
trackService
void trackService(java.lang.String id, org.apereo.cas.authentication.principal.Service service, boolean onlyTrackMostRecentSession)Update service and track session.- Parameters:
id- the idservice- the serviceonlyTrackMostRecentSession- the only track most recent session
-
grantServiceTicket
ServiceTicket grantServiceTicket(java.lang.String id, org.apereo.cas.authentication.principal.Service service, ExpirationPolicy expirationPolicy, boolean credentialProvided, boolean onlyTrackMostRecentSession)
Grant a ServiceTicket for a specific service.- Parameters:
id- The unique identifier for this ticket.service- The service for which we are granting a ticketexpirationPolicy- the expiration policy.credentialProvided- current credential event for issuing this ticket. Could be null.onlyTrackMostRecentSession- track the most recent session by keeping the latest service ticket- Returns:
- the service ticket granted to a specific service for the principal of the TicketGrantingTicket
-
getServices
java.util.Map<java.lang.String,org.apereo.cas.authentication.principal.Service> getServices()
Gets an immutable map of service ticket and services accessed by this ticket-granting ticket.- Returns:
- an immutable map of service ticket and services accessed by this ticket-granting ticket.
-
getProxyGrantingTickets
java.util.Map<java.lang.String,org.apereo.cas.authentication.principal.Service> getProxyGrantingTickets()
Gets proxy granting tickets created by this TGT.- Returns:
- the proxy granting tickets
-
removeAllServices
void removeAllServices()
Remove all services of the TGT (at logout).
-
isRoot
boolean isRoot()
Convenience method to determine if the TicketGrantingTicket is the root of the hierarchy of tickets.- Returns:
- true if it has no parent, false otherwise.
-
getRoot
TicketGrantingTicket getRoot()
Gets the ticket-granting ticket at the root of the ticket hierarchy.- Returns:
- Non -null root ticket-granting ticket.
-
getChainedAuthentications
java.util.List<org.apereo.cas.authentication.Authentication> getChainedAuthentications()
Gets all authentications (AuthenticationAwareTicket.getAuthentication()from this instance and all dependent tickets that reference this one.- Returns:
- Non -null list of authentication associated with this ticket in leaf-first order.
-
getProxiedBy
org.apereo.cas.authentication.principal.Service getProxiedBy()
Gets the service that produced a proxy-granting ticket.- Returns:
- Service that produced proxy-granting ticket or null if this is not a proxy-granting ticket.
- Since:
- 4.1
-
getDescendantTickets
default java.util.Collection<java.lang.String> getDescendantTickets()
Gets descendant tickets. These are generally ticket ids whose life-line is separate from the TGT until and unless the TGT goes away entirely. Things such as OAuth access tokens are a good example of such linked tickets.- Returns:
- the descendant tickets
- Since:
- 5.1
-
-