title: Google drive php API authorization fails with invalid grant
body: <p>I am using the <strong>google drive API in PHP</strong>. First I request an Auth url and send the user to that url. The user authorizes and is redirected to my url, with the authorization code in the query string, as intended. Next, I call <code>$client-&gt;authorize()</code> and pass in the code from the query string. I get the following error:</p>
  
  <pre><code>Uncaught exception 'Google_AuthException' with message 'Error fetching OAuth2 access token, message: 'invalid_grant'' in
  /home/a5874817/public_html/custom/google/src/auth/Google_OAuth2.php:113
  Stack trace:
  #0 /home/a5874817/public_html/custom/google/src/Google_Client.php(131): Google_OAuth2-&gt;authenticate(Array, '4/jN5JfD_ejozBj...')
  #1 /home/a5874817/public_html/custom/docs_reply.php(10): Google_Client-&gt;authenticate('4/jN5JfD_ejozBj...')
  #2 {main}
  thrown in /home/a5874817/public_html/custom/google/src/auth/Google_OAuth2.php on line 113
  </code></pre>
  
  <p>This account has authorized this app before, but the auth url has always included access_type=online, and it was more than an hour ago so the access token should have expired. What specifically might be the cause of this error?</p>