Long Term Authentication
This feature, also known as Remember Me, extends the length of the SSO session beyond the typical period of hours such that users can go days or weeks without having to log in to CAS. See the security guide for discussion of security concerns related to long term authentication.
Policy and Deployment Considerations
While users can elect to establish a long term authentication session, the duration is established through configuration as a matter of security policy. Deployers must determine the length of long term authentication sessions by weighing convenience against security risks. The length of the long term authentication session is configured (somewhat unhelpfully) in seconds, but the Google calculator provides a convenient converter:
The use of long term authentication sessions dramatically increases the length of time ticket-granting tickets are
stored in the ticket registry. Loss of a ticket-granting ticket corresponding to a long-term SSO session would require
the user to re-authenticate to CAS. A security policy that requires that long term authentication sessions MUST NOT
be terminated prior to their natural expiration would mandate a ticket registry component that provides for durable storage, such as the JpaTicketRegistry
.
Component Configuration
Long term authentication requires configuring CAS components in Spring configuration, modification of the CAS login webflow, and UI customization of the login form. The length of the long term authentication session is represented in following sections by the following property:
1
2
# Long term authentication session length in seconds
rememberMeDuration=1209600
The duration of the long term authentication session is configured in two different places:
ticketExpirationPolicies.xml
ticketGrantingTicketCookieGenerator.xml
Update the ticket-granting ticket expiration policy in ticketExpirationPolicies.xml
to accommodate both long term
and stardard sessions.
Update the CASTGC cookie expiration in ticketGrantingTicketCookieGenerator.xml
to match the long term authentication
duration:
Modify the PolicyBasedAuthenticationManager
bean in deployerConfigContext.xml
to include the
RememberMeAuthenticationMetaDataPopulator
component that flags long-term SSO sessions:
Webflow Configuration
Two sections of login-webflow.xml
require changes:
credential
variable declarationviewLoginForm
action state
Change the credential
variable declaration as follows:
Change the viewLoginForm
action state as follows:
User Interface Customization
A checkbox or other suitable control must be added to the CAS login form to allow user selection of long term
authentication. We recommend adding a checkbox control to casLoginView.jsp
as in the following code snippet.
The only functional consideration is that the name of the form element is rememberMe.