title: CodeIgniter Login using google openid
body: <p>I'm new to CodeIgniter framework. I have tried login using openid for that i copied lightopenid url and put it in config/config.php</p>
  
  <pre><code>$config['base_url']    = 'https://gitorious.org/lightopenid/lightopenid/raw/9d42dc24e4dd34121c98a6491bc3ef7933a68a19:openid.php';
  
  A PHP Error was encountered
  
      Severity: Warning
  
      Message: require(openid.php): failed to open stream: No such file or directory
  
      Filename: models/login_model.php
  
      Line Number: 2 
  </code></pre>
  
  <p>please find below the code i used</p>
  
  <p>Controllers/loginGoogle.php</p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class LoginGoogle extends CI_Controller 
  {
      public function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;model('login_model');
      }
  
      public function index()
      {
          require_once 'openid.php';
          $openid = new LightOpenID("localhost");
          $openid-&gt;identity = 'https://www.google.com/accounts/o8/id';
          $openid-&gt;required = array(
              'namePerson/first',
              'namePerson/last',
              'contact/email',
              'birthDate', 
              'person/gender',
              'contact/postalCode/home',
              'contact/country/home',
              'pref/language',
              'pref/timezone',  
          );
  
  
      $openid-&gt;returnUrl = 'http://localhost/login_thirdparty/codeigniterlogin/index.php/logingoogle/loginAuth';
  
  
  
          $data['openid'] = $openid;
          $this-&gt;load-&gt;view('googleLoginView', $data);
      }
  
      public function loginAuth()
      {
          $this-&gt;login_model-&gt;index();
      }
  }
  </code></pre>
  
  <p>models/login_model.php</p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  require 'openid.php';
  
  class Login_model extends CI_Model 
  {
      public function index()
      {
          $openid = new LightOpenID("localhost");
  
          if($openid-&gt;mode)
          {
              if($openid-&gt;mode == 'cancel')
              {
                  echo "User has canceled authentication !";
              }
              elseif($openid-&gt;validate())
              {
                  $data = $openid-&gt;getAttributes();
                  $email = $data['contact/email'];
                  $first = $data['namePerson/first'];
  
                  echo "Identity : $openid-&gt;identity &lt;br /&gt;";
                  echo "Email : $email &lt;br /&gt;";
                  echo "First name : $first";
                  echo "&lt;pre&gt;"; print_r($data); echo "&lt;/pre&gt;";
  
  
              }
              else
              {
                  echo "The user has not logged in";
              }
          }
          else
          {
              echo "Go to the login page to logged in";
          }
      }
  }
  </code></pre>
  
  <p>views/googleLoginView.php</p>
  
  <pre><code>&lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;title&gt;Login using google account&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;a href = "&lt;?php echo $openid-&gt;authUrl(); ?&gt;" &gt; Loging Using google account &lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>