title: not able to get access token from google API
body: <p>When I try to get access token from Google API but I get null</p>
  
  <pre><code>        $client = new Google_Client();
              $client-&gt;setApplicationName("name app");
              $client-&gt;setAccessType('offline');
              $client-&gt;setClientId('id client');
              $client-&gt;setClientSecret('secret');
              $client-&gt;setRedirectUri('redirect url');
              $client-&gt;addScope("https://www.googleapis.com/auth/calendar.readonly");
          //$client-&gt;authenticate($_GET['code']);
          $access_token = $client-&gt;getAccessToken();
          $tokens_decoded = json_decode($access_token);
          //$refreshToken = $tokens_decoded-&gt;refresh_token;
        if(!$access_token) {
          /**
          * AUCUN TOKEN SAUVE -&gt; IL FAUT REDIRIGER
          * L'UTILISATEUR SUR L'URL $authUrl
          */
          $authUrl = $client-&gt;createAuthUrl();
  
          die();
        }
  </code></pre>
  
  <p>Please suggest a way to get the same</p>