title: OAuth 2.0 PHP Client and Server Example
body: <p>I downloaded the server version (PDO) available for the OAuth 2.0 <a href="http://code.google.com/p/oauth2-php/" rel="nofollow noreferrer">here</a>: </p>
  
  <p>Not sure if it is the best implementation out there honestly.</p>
  
  <p>It is configured and currently returns an error JSON indicating it is waiting for a client to pass it the correct arguments.</p>
  
  <p>Now, it comes with a "lib" folder that has a Client .inc file. Honestly, I am not sure how to use it given there is no PHP example I found in the archive and couldn't find anything online. I found an example for Drupal using this library, but it is a mess given they have their own Drupal-related functionalities as a module.</p>
  
  <p>I was wondering if anyone here has had luck using this PHP client library, and if so can they share an example that connects, authorizes and then redirects to the callback URL with the session to be able to access protected page/api calls?</p>
  
  <p>I wanted to try the Facebook Graph API (opensource), yet I found it very custom for Facebook and was not very sure where I should place the URL to the OAuth 2.0 server I installed on my own server machine.</p>