title: Using a Service Account, getAccessToken() is returning null
body: <p>I am running the following PHP code, using the client libraries found here: <a href="https://code.google.com/p/google-api-php-client/" rel="noreferrer">https://code.google.com/p/google-api-php-client/</a>.  I do not get any errors for any of this code, but when I call <code>getAccessToken()</code>, it returns null.  </p>
  
  <p>I have allowed access to this service account on my personal calendar, and have granted full access to the project via the API Console.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>require_once 'google-api-php-client/src/Google_Client.php';
  
  const CLIENT_ID = 'blahblahblah';
  const SERVICE_ACCOUNT_NAME = 'blahblahblah@developer.gserviceaccount.com';
  const KEY_FILE = 'path/to/privatekey.p12';
  
  $google_client = new Google_Client(); // created only to initialized static dependencies
  $client = new Google_OAuth2(); // you really just need Google_OAuth2
  
  $key = file_get_contents(KEY_FILE);  
  
  $client-&gt;setAssertionCredentials(
      new Google_AssertionCredentials(
          SERVICE_ACCOUNT_NAME,
          array('https://www.googleapis.com/auth/calendar'),
          $key
      )
  );
  
  var_dump($client-&gt;getAccessToken());
  </code></pre>