title: Facebook Javascript API - Having trouble 'connecting'
body: <p>Here's the code I've been testing with:</p>
  
  <pre><code>&lt;?php
  $accessToken = file_get_contents('https://graph.facebook.com/oauth/access_token?client_id=APP_ID&amp;client_secret=APP_SECRET&amp;grant_type=client_credentials');
  $accessToken = explode('=', $accessToken);
  $accessToken = $accessToken[1];
  ?&gt;
  &lt;div id="fb-root"&gt;&lt;/div&gt;
  
  &lt;script&gt;
  window.fbAsyncInit = function()
  {
      FB.init({
          appId:  'APP_ID',
          status: true,
          cookie: true,
          xfbml:  true
      });
  
      FB.api('/me?access_token=&lt;?php echo $accessToken; ?&gt;', function(user)
      {
          if (user != null)
          {
              console.log(user);
          }
      });
  };
  
  (function()
  {
      var e   = document.createElement('script');
      e.type  = 'text/javascript';
      e.src   = document.location.protocol + '//connect.facebook.net/en_GB/all.js';
      e.async = true;
  
      document.getElementById('fb-root').appendChild(e);
  }());
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm getting the following error returned:</p>
  
  <pre><code>An active access token must be used to query information about the current user.
  </code></pre>
  
  <p>I registered my site URL with Facebook to get my ID/Secret and am running the above script within the directory I specified when registering.</p>
  
  <p>What am I doing wrong?</p>