title: Firebase: How to verify Google login token id from Android & iOS
body: <p>I want to verify on my node backend all the tokens (Google login) i get from my Android app. I started with initializing the firebase module like this:</p>
  
  <pre><code>var admin = require('firebase-admin');
  var serviceAccount = require('googlefirebase');
  admin.initializeApp({
     credential: admin.credential.cert(serviceAccount),
     databaseURL: url
  });
  </code></pre>
  
  <p>This gave me some error about some DEFAULT name and i found out that i needed to use this code:</p>
  
  <pre><code>var admin = require('firebase-admin');
  var serviceAccount = require('googlefirebase');
  admin.initializeApp(functions.config().firebase);
  </code></pre>
  
  <p>Then i realize that i need to install and init the project on my server so i did this:</p>
  
  <pre><code>firebase login
  firebase init
  firebase use --add project
  firebase functions:config:set "google-services.json" (just the project_info data of the json that i downloaded from firebase)
  </code></pre>
  
  <p>Now i get this error: </p>
  
  <blockquote>
    <p>Error: Must initialize app with a cert credential or set your Firebase
    project ID as the GOOGLE_CLOUD_PROJECT environment variable to call
    verifyIdToken()</p>
  </blockquote>
  
  <p>EDIT START
  I get this error when i call:</p>
  
  <pre><code>admin.auth().verifyIdToken(token).then(function(decodedToken) {}.catch(){};
  </code></pre>
  
  <p>EDIT END</p>
  
  <p>I already "init" firebase (or at least i thing so) and created the environment variables: GOOGLE_CLOUD_PROJECT and FIREBASE_CONFIG and i keep getting the same error.</p>
  
  <p>So, whats the right way to get firebase to work? what am i missing? is verifyIdToken the right method to verify the token? i just want to verify the google login token.</p>