title: Google OAuth2: Error 401 - invalid_client
body: <p>I am deploying an app on Heroku that uses Google OAuth2.  When I test the app, I go to the auth url (/auth/google) and I see the following error message (note that I replaced domain name with *** just for posting here: </p>
  
  <blockquote>
    <ol start="401">
    <li>That’s an error.</li>
    </ol>
    
    <p>Error: invalid_client</p>
    
    <p>The OAuth client was not found.</p>
    
    <p>Request Details response_type=code
    redirect_uri=https://****.com/auth/google/callback scope=profile email
    client_id=process.env.GOOGLE_CLIENT_ID That’s all we know.</p>
  </blockquote>
  
  <p>I have looked at the following questions before posting and have been trying to debug for several hours: </p>
  
  <p><a href="https://stackoverflow.com/questions/23775972/error-invalid-client-with-google-apps-api-oauth2">Error: invalid_client with Google Apps API OAuth2</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17166848/invalid-client-in-google-oauth2">invalid_client in google oauth2</a></p>
  
  <p>I have tried to do the following: </p>
  
  <ol>
  <li><p>Ensure there are no spaces before and after the values in Heroku</p></li>
  <li><p>The consent screen in Google Console has the name and email address completed</p></li>
  <li><p>I have renamed the app within Google Console </p></li>
  <li><p>I have deleted the key/value from Heroku and re-created</p></li>
  </ol>
  
  <p>Despite all this, I am unable to fix this.  Any ideas on what I maybe missing? </p>