title: how to get user profile from linked in using codeigniter
body: <p>How do you get the user profile after you have finish verification in linkedin? I've been googling around and found some tutorials but none of them are working, or should I say I can't get them to work. Below is my controller. </p>
  
  <pre><code>function __construct(){
      parent::__construct();
  
      $this-&gt;config-&gt;load('linkedin');
  
      $this-&gt;data['consumer_key'] = $this-&gt;config-&gt;item('api_key');
      $this-&gt;data['consumer_secret'] = $this-&gt;config-&gt;item('secret_key');
      $this-&gt;data['callback_url'] = site_url() . 'main/linkedin_display';
  }
  
  function linkedin_request(){
  
      $this-&gt;load-&gt;library('linkedin', $this -&gt; data);
  
      $token = $this-&gt;linkedin-&gt;get_request_token();
  
      $oauth_data = array(
          'oauth_request_token' =&gt; $token['oauth_token'],
          'oauth_request_token_secret' =&gt; $token['oauth_token_secret']
          );
  
      $this-&gt;session-&gt;set_userdata($oauth_data);
  
      $request_link = $this-&gt;linkedin-&gt;get_authorize_URL($token);
  
      header("Location: " . $request_link);
  
  }
  
  function linkedin_display{
  
      // get user details(first name, email etc) here
  
  }
  </code></pre>