title: Firebase 3.0 Tokens : [Error: Firebase Auth ID token has no "kid" claim]
body: <p>I'm currently developing a node.js service with firebase 3.0  that is called by a web application that uses firebase 2.4. </p>
  
  <p>I'm sending the current user <a href="https://firebase.google.com/docs/auth/users#auth_tokens" rel="noreferrer">Firebase ID token</a> (<code>Auth.$getAuth().token</code>) in my header call and trying to validade this token with </p>
  
  <pre><code>var idToken = req.headers["x-access-token"];
  auth.verifyIdToken(idToken).then(function(decodedToken) {
      var uid = decodedToken.sub;
      console.log(decodedToken);
  }, function(error){
      console.log(error);
  });
  </code></pre>
  
  <p>But I'm getting:</p>
  
  <pre><code>[Error: Firebase Auth ID token has no "kid" claim]
  </code></pre>
  
  <p>getAuth():</p>
  
  <p><a href="https://i.stack.imgur.com/lQdDQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lQdDQ.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I'have just tested generating and validating the token on the server side and I'm getting the same problem.</p>
  
  <pre><code>var auth = firebase.auth();
  var token = auth.createCustomToken(userId, {"premium_account": true});
  console.log(token);
  auth.verifyIdToken(token).then(function(decodedToken) {
       console.log(decodedToken);
  }, function(error){
       console.log(error);
  });
  </code></pre>
  
  <p>Any suggestions? </p>
  
  <hr>
  
  <p><strong>UPDATE 2: [SOLUTION]</strong></p>
  
  <p>The problem in my case was that the Tokens generated with AngularFire 2.X.X are not compatible with the Firebase 3.X.X that is running in my server. So after digging into some thoughts that people wrote here and in <a href="https://groups.google.com/forum/#!topic/firebase-talk/ajMAi1RSsMA" rel="noreferrer">this google group topic</a> the workaround was to use <a href="https://github.com/auth0/node-jsonwebtoken" rel="noreferrer">jsonwebtoken</a> as follows:</p>
  
  <pre><code>var jwt = require('jsonwebtoken');
  jwt.verify(idToken, fbKey, function(err, decoded) {
     if (!err){ console.log(decoded); }
  });
  </code></pre>
  
  <p>You can find the <code>fbKey</code> accessing the new firebase console and going into <em>Settings -> Project Settings -> Database</em>.</p>