Google Auth with NodeJS getting "Not a valid origin for the client"

I’m trying to figure out the correct authorized JavaScript origin for a NodeJS app on Glitch.

My Google Cloud web app is set to:
Authorized JavaScript origins
For use with requests from a browser
URIs *

My Glitch project is here: Glitch :・゚✧
and here is the front: Login

Here is the error that I’m getting when my login page loads…
“Not a valid origin for the client: has not been registered for client ID Please go to and register this origin for your project’s client ID.”
error: “idpiframe_initialization_failed”

I have tried changing the Google Cloud web app authorized URI to…

  1. Login but Google Cloud says ‘Invalid Origin: URIs must not contain a path or end with “/”.’
  2. which is the port that I’m using in server.js but then I get an error: ‘Authorization Error Error 400: redirect_uri_mismatch’

Thanks for your help!

1 Like


I found this StackOverflow: javascript - idpiframe_initialization_failed in Google Sign In from Localhost - Stack Overflow

In short: clear your browser cache.

In Chrome: Settings → Advanced → Clear browsing data → Cached images and files

Cleared the cache and visited my login page again and the error was gone.