title: Firebase providing an invalid Web API Key (API key not valid. Please pass a valid API key)
body: <p>I've run into an ongoing issue with Firebase authentication.</p>
  
  <p>TL;DR The <code>firebase</code> CLI tool appears to generate a new API key each time a command to display one is run, invalidating any previous keys, even if they are in use.</p>
  
  <p>There seems to be multiple ways to generate an API key for use with firebase:</p>
  
  <ul>
  <li>The most obvious is on their website, under Project Settings, where it displays a <code>Web API Key</code></li>
  <li>Another is via the <code>firebase-tools</code> CLI command <code>firebase setup:web</code></li>
  <li>A third is also via <code>firebase-tools</code>, using <code>firebase login:ci</code> - which provides a Token to be used for CI deploys</li>
  </ul>
  
  <p>The Problem is, if/when you run the <code>firebase setup:web</code> or <code>firebase login:ci</code> commands, it seems to  generate a NEW API key each time they are run, and invalidates all other keys at the same time -- including the <code>Web API Key</code> shown on the website.</p>
  
  <p>In particular, I ran into this problem trying to use firebase-authentication wherein I started receiving <code>API key not valid. Please pass a valid API key.</code> on my production system without any code changes, apparently simply because I ran the <code>firebase setup:web</code> command.</p>
  
  <p>Additionally, the website DOES NOT UPDATE with the new key. So there appears to be no way to determine what the currently valid API key is if in the future you wish to add another app to an existing project. It still shows a, now invalid, API key.</p>