CAS_Client::renewAuthentication PHP Method

renewAuthentication() public method

This method is called to renew the authentication of the user If the user is authenticated, renew the connection If not, redirect to CAS
public renewAuthentication ( ) : true
return true when the user is authenticated; otherwise halt.
    public function renewAuthentication()
    {
        phpCAS::traceBegin();
        // Either way, the user is authenticated by CAS
        if (isset($_SESSION['phpCAS']['auth_checked'])) {
            unset($_SESSION['phpCAS']['auth_checked']);
        }
        if ($this->isAuthenticated(true)) {
            phpCAS::trace('user already authenticated');
            $res = true;
        } else {
            $this->redirectToCas(false, true);
            // never reached
            $res = false;
        }
        phpCAS::traceEnd();
        return $res;
    }

Usage Example

Beispiel #1
0
 /**
  * This method is called to renew the authentication.
  *
  * @return void
  **/
 public static function renewAuthentication()
 {
     phpCAS::traceBegin();
     phpCAS::_validateClientExists();
     $auth = self::$_PHPCAS_CLIENT->renewAuthentication();
     // store where the authentication has been checked and the result
     self::$_PHPCAS_CLIENT->markAuthenticationCall($auth);
     //self::$_PHPCAS_CLIENT->renewAuthentication();
     phpCAS::traceEnd();
 }
CAS_Client