|
CAS supports a pluggable and extensible policy framework to control the expiration policy of ticket-granting tickets (TGT) and service tickets (ST). Both TGT and ST expiration policy beans are defined in the /cas-server-webapp/src/main/webapp/WEB-INF/spring-configuration/ticketExpirationPolicies.xml file in the CAS distribution.
Ticket-Granting Ticket PoliciesTGT expiration policy governs the time span during which an authenticated user may grant STs with a valid (non-expired) TGT without having to reauthenticate. An attempt to grant a ST with an expired TGT would require the user to reauthenticate to obtain a new (valid) TGT. TimeoutExpirationPolicyThe default expiration policy applied to TGTs provides for most-recently-used expiration policy, similar to a Web server session timeout. For example, a 3-hour time span with this policy in effect would require a TGT to be used every 3 hours or less, otherwise it would be marked as expired. Constructor Parameters
Usage Example<!-- TGT expires after 2 hours in inactivity --> <bean id="grantingTicketExpirationPolicy" class="org.jasig.cas.ticket.support.TimeoutExpirationPolicy"> <constructor-arg index="0" value="7200000" /> </bean> HardTimeoutExpirationPolicyThe hard timeout policy provides for finite ticket lifetime as measured from the time of creation. For example, a 4-hour time span for this policy means that a ticket created at 1PM may be used up until 5PM; subsequent attempts to use it will mark it expired and the user will be forced to reauthenticate. Constructor Parameters
Usage Example<!-- TGT expires 4 hours after creation --> <bean id="grantingTicketExpirationPolicy" class="org.jasig.cas.ticket.support.HardTimeoutExpirationPolicy"> <constructor-arg index="0" value="14400000" /> </bean> ThrottledUseAndTimeoutExpirationPolicyThe throttled timeout policy extends the TimeoutExpirationPolicy with the concept of throttling where a ticket may be used at most every N seconds. This policy was designed to thwart denial of service conditions where a rogue or misconfigured client attempts to consume CAS server resources by requesting high volumes of service tickets in a short time. Ticket Properties
Usage Example<!-- TGT expires under one of two conditions: * More than 3 hours of inactivity * Used consecutively where less than 5 seconds has elapsed from the first use --> <bean id="grantingTicketExpirationPolicy" class="org.jasig.cas.ticket.support.ThrottledUseAndTimeoutExpirationPolicy" p:timeToKillInMilliSeconds="10800000" p:timeInBetweenUsesInMilliSeconds="5000" /> NeverExpiresExpirationPolicyThe never expires policy allows tickets to exist indefinitely.
Usage Example<!-- TGT never expires --> <bean id="grantingTicketExpirationPolicy" class="org.jasig.cas.ticket.support.NeverExpiresExpirationPolicy" /> RememberMeDelegatingExpirationPolicyThis policy implements the "Remember Me" feature for long-term ticket-granting tickets. Use of this policy is slightly more involved and is described fully on the Remember Me page. Service Ticket PoliciesMultiTimeUseOrTimeoutExpirationPolicyThis is the default policy applied to service tickets where a ticket is expired after a fixed number of uses or after a maximum period of inactivity elapses. Constructor Parameters
Usage Example<!-- ST may be used exactly once and must be validated within 5 minutes. --> <bean id="serviceTicketExpirationPolicy" class="org.jasig.cas.ticket.support.MultiTimeUseOrTimeoutExpirationPolicy"> <constructor-arg index="0" value="1" /> <constructor-arg index="1" value="300000" /> </bean> |