title: CAS Authentication with Yii Framework
body: <p>I'm facing some troubles trying to implement <code>CAS</code> Authentication with <code>Yii</code> framework. I <a href="https://wiki.jasig.org/display/CASC/phpCAS" rel="nofollow">downloaded the client classes</a> and everything is working when I'm not using any framework, but when I try to integrate with <code>Yii</code> validation seems to not be working at all.</p>
  
  <p>Can Anyone please describe the process to successfuly make a CAS validation with yii. </p>
  
  <p>I put the clients files under /myapp/protected/vendor directory, then I put the following lines at the begining of the controller </p>
  
  <pre><code>Yii::import('application.vendors.*');
  require_once('CAS/CAS.php');
  </code></pre>
  
  <p>Then I created the method for use my CAS Classes</p>
  
  <pre><code>public function casValidation()
  {
     phpCAS::client(CAS_VERSION_2_0, $server, $port, "/cas",false);
     phpCAS::setNoCasServerValidation();
     phpCAS::forceAuthentication();
  
     if(isset($_REQUEST['logout'])) 
     {
        phpCAS::logout();
     }
  }
  </code></pre>
  
  <p>And Finally I try to validate from my index action</p>
  
  <pre><code>public function actionIndex()
  {
     $this-&gt;casValidation();
     $this-&gt;render('index');
  }
  </code></pre>
  
  <p>But in the web browser shows the following error</p>
  
  <blockquote>
    <p>PHP warning</p>
    
    <p>include(CAS_Client.php) [function.include]: failed to open >stream: No such file or directory</p>
    
    <p>C:\app\vertrigo\Vertrigophp52\www\testyii\framework\YiiBase.php(427)</p>
  </blockquote>
  
  <p>Am I Missing something? What should I do to make things work?</p>