title: Can't Validate Google Access Token (wrong number of segments)
body: <p>I have very simple code <a href="https://developers.google.com/identity/sign-in/web/backend-auth#using-a-google-api-client-library" rel="nofollow noreferrer">directly from Google's website</a></p>
  
  <pre><code>$client = new Google_Client(['client_id' =&gt; $CLIENT_ID]);
  
  $payload = $client-&gt;verifyIdToken($id_token);
  
  if ($payload) {
    $userid = $payload['sub'];
    echo $userid;
  } else {
    // Invalid ID token
    echo "error";
  }
  </code></pre>
  
  <p>I get the following error(s):</p>
  
  <pre><code>&lt;b&gt;Fatal error&lt;/b&gt;:  Uncaught exception 'UnexpectedValueException' with message 'Wrong number of segments' in /../vendor/firebase/php-jwt/src/JWT.php:79
  Stack trace:
  #0 /../vendor/google/apiclient/src/Google/AccessToken/Verify.php(103): Firebase\JWT\JWT::decode('ya29.GlzbAwEXTe...', '-----BEGIN PUBL...', Array)
  #1 /../vendor/google/apiclient/src/Google/Client.php(713): Google_AccessToken_Verify-&amp;gt;verifyIdToken('ya29.GlzbAwEXTe...', '1074005180734-g...')
  #2 /../pages/auth/session.php(7): Google_Client-&amp;gt;verifyIdToken('ya29.GlzbAwEXTe...')
  </code></pre>
  
  <p>Does anyone know why this is?</p>