title: Trouble validating a Facebook token
body: <p>I'm building a small Facebook login library for OS X. This isn't because there are no SDKs out there, but because I'd like something native to Cocoa that can encapsulate the login process. I'v successfully requested an access token from the Facebook login URL. I use this string format to perform the login:</p>
  
  <pre><code>https://www.facebook.com/dialog/oauth?client_id=%@&amp;redirect_uri=%@&amp;response_type=token
  </code></pre>
  
  <p>For the <code>redirect_uri</code> field I pass <code>https://www.facebook.com/connect/login_success.html</code> as per the Facebook documentation. I take whatever that response is and parse the URL. I'll either get a token or a failure. The token seems to come back okay. The trouble is in the next step.</p>
  
  <p>Immediately after receiving my token, I attempt to validate it. I use the "debug" endpoint, like so:</p>
  
  <pre><code>https://graph.facebook.com/debug_token?input_token=%@&amp;access_token=%@
  </code></pre>
  
  <p>I pass my new token as the <code>input_token</code> and this is where it gets sticky. I've tried passing my client token, but that causes the following error:</p>
  
  <blockquote>
    <p>The operation couldn’t be completed. (Invalid OAuth access token. error 190.)`</p>
  </blockquote>
  
  <p>If I pass my <code>app ID | app secret</code>, I get a different error:</p>
  
  <blockquote>
    <p>The operation couldn’t be completed. ((#100) You must provide an app access token or a user access token that is an owner or developer of the app error 100.)</p>
  </blockquote>
  
  <p>I'm not sure what's happening here, or what to do. Can anyone point me in the right direction?</p>