title: Oauth Codeigniter API
body: <p>Ok i have a project where i need to build a api oauth and to be honest i am completely lost and confused and really in need of some advice to help me get started.</p>
  
  <p>The service i have allows users to create apps which will then generate two keys and store them into a database.</p>
  
  <p>My database has table called apps with 4 fields.</p>
  
  <pre><code>name (VARCHAR 250)
  description (TEXT)
  key (VARCHAR 250)
  secret (VARCHAR 250)
  </code></pre>
  
  <p>So the user create a app like below.</p>
  
  <pre><code>name = 'myapp';
  description = 'Access to my api';
  key = '5788334367';
  secret = '91708741625783470472';
  </code></pre>
  
  <p>Now here is the part where i am completely lost building the api with oauth. I want to use <a href="https://github.com/chriskacerguis/codeigniter-restserver" rel="nofollow">https://github.com/chriskacerguis/codeigniter-restserver</a> as i have work with it before to build a api but it was a open api only running get requests and just for me a single user so no apps.</p>
  
  <p>Correct me if i am wrong, oauth is just a framework that you will include like any other library where do i find a oauth library that fit with codeigniter.</p>
  
  <p>I found this which explains the process quite well and has helped <a href="http://knpuniversity.com/screencast/oauth" rel="nofollow">http://knpuniversity.com/screencast/oauth</a> but like everything only helps me so far.</p>
  
  <p>The process i have for the api (i think).</p>
  
  <p>When i am a user using my api, they will send of the key and secret to my api.
  My api takes the two keys via a oauth endpoint from my codeigniter oauth library via post method checks them against the database and sends a token back which my user can then access the api with.</p>
  
  <p>Just really trying to get started my process please help.</p>
  
  <ol>
  <li>Install codeigniter </li>
  <li>Include codeigniters rest api library</li>
  <li>Install a oauth library </li>
  <li>Setup a function within the oauth library to check my users app keys against the database to check they are valid and return a token</li>
  <li>Start to build out the api with endpoints and calls like /api/list_files </li>
  </ol>
  
  <p>My users can then use other frameworks to access my api. </p>
  
  <p>Would love some help to get me of the ground i am completely new to building a full oauth api.</p>
  
  <p>Thanks</p>