CAS Central Authentication Service


Miscellaneous

1. "Remember Me" feature

When user wants the CAS to remember his credentials, he should opt for "Remember Me" feature. If the user had opted for "Remember Me" feature, he will not be redirected to login form to enter credentials, instead CAS will get the details from cookie and auto logs in the user into the network.

Configuring Remember Me
deployerConfigContext.xml

An AuthenticationMetaDataPopulator needs to be added to the AuthenticationManager. Add the following property to the AuthenticationManager configured in the deployerConfigContext.xml:
<property name="authenticationMetaDataPopulators">
<list>
<bean class="org.jasig.cas.authentication.principal.RememberMeAuthenticationMetaDataPopulator" />
</list>
</property>


cas-servlet.xml

Locate the bean "authenticationViaForm", it should look something like this:

<bean id="authenticationViaFormAction" class="org.jasig.cas.web.flow.AuthenticationViaFormAction"
p:centralAuthenticationService-ref="centralAuthenticationService"
p:warnCookieGenerator-ref="warnCookieGenerator" />

Change it to something similar to this:

<bean id="authenticationViaFormAction" class="org.jasig.cas.web.flow.AuthenticationViaFormAction"
p:centralAuthenticationService-ref="centralAuthenticationService"
p:formObjectClass="org.jasig.cas.authentication.principal.RememberMeUsernamePasswordCredentials"
p:formObjectName="credentials"
p:validator-ref="UsernamePasswordCredentialsValidator"
p:warnCookieGenerator-ref="warnCookieGenerator" />

And add the "UsernamePasswordCredentialsValidator" bean:

<bean id="UsernamePasswordCredentialsValidator" class="org.jasig.cas.validation.UsernamePasswordCredentialsValidator" />



ticketExpirationPolicies.xml

The ticket expiration policy entitled "grantingTicketExpirationPolicy" would need to be changed to the RememberMeDelegatingExpirationPolicy.

You would have something similar to the following:

<bean id="grantingTicketExpirationPolicy" class="org.jasig.cas.ticket.support.RememberMeDelegatingExpirationPolicy">
<property name="sessionExpirationPolicy">
<bean class="org.jasig.cas.ticket.support.TimeoutExpirationPolicy">
<constructor-arg index="0" value="XXXXXXXX" />
</bean>
</property>
<property name="rememberMeExpirationPolicy">
<bean class="org.jasig.cas.ticket.support.TimeoutExpirationPolicy">
<constructor-arg index="0" value="XXXXXXXX" />
</bean>
</property>
</bean>


(optional) ticketGrantingTicketCookieGenerator.xml

Allows you to specify the "rememberMeMaxAge" property (default 3 months) as well as other properties for the cookie.

Users may need to add one field to the login page. Something such as the following would need to be added to the casLoginView.jsp

<input type="checkbox" name="rememberMe" id="rememberMe" value="true" /> <label for="rememberMe">Remember Me</label>

 

<<Previous page Next page>>


blog comments powered by Disqus