Fix problems with CAS authentication after upstream merge