Lately I read blog Spring Security 3 and ICEfaces 2 where Ben Simpson introduced JsfRedirectStrategy (see source attachment there). I realized that there are at least 2 situations in CAS environment when the session could expire: due to timeout and due to expiration of service ticket. Both situations should take care of AJAX request as well.
Unfortunatelly, the CasAuthenticationEntryPoint has currently really bad design because its commence() method is final. preCommence() method is not sufficient enough in this situation, it serves to only response headers change. I'd like to suggest rearrangement of that in the next versions of Spring Security:
Code:
public class CasAuthenticationEntryPoint implements AuthenticationEntryPoint, InitializingBean {
private RedirectStrategy redirectStrategy = new JsfAwareRedirectStrategy();
...
/**
* @see org.springframework.security.web.AuthenticationEntryPoint#commence(javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse, org.springframework.security.core.AuthenticationException)
*/
public void commence(final HttpServletRequest servletRequest, final HttpServletResponse response, final AuthenticationException authenticationException) throws IOException, ServletException {
final String urlEncodedService = createServiceUrl(servletRequest, response);
final String redirectUrl = createRedirectUrl(urlEncodedService);
preCommence(servletRequest, response);
if (this.redirectStrategy == null) {
response.sendRedirect(redirectUrl);
} else {
redirectStrategy.sendRedirect(servletRequest, response, redirectUrl);
}
}
public void setRedirectStrategy(RedirectStrategy redirectStrategy) {
this.redirectStrategy = redirectStrategy;
}
...
}
I hope the redirect strategy is honest enough solution 
Disclaimer: take it as is. AJAX is no standard. I believe that Ben's redirect strategy is suitable for all JSF 2 frameworks. If you use JSF 1.2 or even some javascript AJAXified framework, request and response headers will change. Changing the redirect strategy should help.