public function checkAuthentication()
    {
        if (self::isAuthenticated()) {
            return true;
        } elseif (self::isGatewayed()) {
            return $this->validateCas();
        }
        self::setGatewayed(true);
        session_write_close();
        $this->redirectToCas(true);
        // never reached
        return true;
    }