title: Missing information from Google ID Token in PHP
body: <p>I'm using Google OAuth 2.0 for my server-side web app with PHP 5.4.45 and Google API Client PHP Library version 2.1.1.</p>
  
  <p>I can successfully exchange the <code>authorization code</code> with the <code>refresh_token</code>, <code>access_token</code> and <code>id_token</code>, I can correctly verify the id_token and extract the user's data from it but some information is missing.</p>
  
  <p>I requested <code>profile</code> and <code>email</code> scopes, which both get correctly displayed in the consent screen and in the user's applications settings, but, while the email is available, all the claims associated with the <code>profile</code> scope are missing from the id_token (name, picture, etc...).</p>
  
  <p>I have tried with different users and the problem persists.</p>
  
  <p>This is the code I'm using (just for testing purposes):</p>
  
  <pre><code>require_once 'php/libs/google_api_client_library/vendor/autoload.php';
  
  if(!isset($_GET['code'])){
      die("code parameter not set");
  
  }else{
      //exchange 'code' with access token, refresh token and id token
      $data = array(
          'code' =&gt; $_GET['code'],
          'client_id' =&gt; $MY_CLIENT_ID,
          'client_secret' =&gt; $MY_CLIENT_SECRET,
          'redirect_uri' =&gt; 'https://www.mywebsite.com/oauth2callback.php',
          'grant_type' =&gt; 'authorization_code'
      );
      $options = array(
          'http' =&gt; array(
              'header'  =&gt; "Content-type: application/x-www-form-urlencoded\r\n",
              'method'  =&gt; 'POST',
              'content' =&gt; http_build_query($data)
          )
      );
      $response = file_get_contents('https://accounts.google.com/o/oauth2/token', false, stream_context_create($options));
  
      if($response){
          $tokens = json_decode($response);
  
          $client = new Google_Client();
  
          //validate idToken and get user info
          $idtoken = $client-&gt;verifyIdToken($tokens-&gt;id_token);
  
          echo "&lt;h1&gt;ID_TOKEN&lt;/h1&gt;";
          var_dump($idtoken);
      }
  }
  </code></pre>
  
  <p>The weirdest thing is that it used to work correctly before, and then it suddenly started behaving like that, and I don't remember making any changes to this code.</p>
  
  <p>I also noticed that this happens only server-side, with PHP, because everything is fine with the JavaScript API Client Library.</p>
  
  <p>Any ideas of why this is happening?</p>
  
  <p>Let me know if you need any further information and thanks in advance!</p>