title: Firebase IOS idToken invalid `kid` Exception in backend while `verifyIdToken` in Gmail Auth
body: <p>I'm using firebase for Android and IOS application. The Application has dedicated backend and verifies the Token issued by firebase after phone/email auth using <code>verifyIdToken</code> method. I'm verifying the token for new user registration. The concept is working fine for android application. When new user <code>Authenticates</code>, Registration API going to be called with Token issued by Firebase and I'm verifying that token using <code>Service Account</code>. However, For ios it fails with the exception that <code>kid</code> header is invalid. Here is the exception trace.</p>
  
  <pre><code>A key with ID "3494b1e786cdad092e423766bbe37f54ed87b22d" could not be found. 
  {"exception":"[object] (Firebase\\Auth\\Token\\Exception\\UnknownKey(code: 0): 
  A key with ID \"3494b1e786cdad092e423766bbe37f54ed87b22d\" could not be found.
  at /home/fgx3uhiothty/public_html/vendor/kreait/firebase-tokens/src/Verifier.php:132)
  </code></pre>
  
  <p>In Firebase Auth Documentation, there is clearly stated that</p>
  
  <blockquote>
    <p>kid   Key ID  Must correspond to one of the public keys listed at <a href="https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com" rel="nofollow noreferrer">https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com</a> </p>
  </blockquote>
  
  <p>When I checked key <code>3494b1e786cdad092e423766bbe37f54ed87b22d</code> with the google's public key after decoding token, I didn't find the <code>kid</code> matching. However, the token from ios device is issued by firebase itself after successful auth. So how is it possible having different <code>kid</code> header in ios token?</p>
  
  <p>I'm using <code>kreait/firebase-tokens-php</code> library for accessing service account API from backend.</p>