Stuck Creating OAuth Client ID: App Script "Invalid Origin" Error (Help Needed!)

Hey everyone,

I’m having a really frustrating time trying to create an OAuth 2.0 Client ID for my Apps Script web app. Basically, I’m building a simple tool that uses the Google Tasks API to automatically create a 90-day plan. Super useful, right?

But I keep running into this weird “Invalid origin: URI must not contain a path or end with ‘/’” error when I try to set up the Authorized JavaScript origins. Here’s the catch – my origin URL does end with a forward slash, just like it’s supposed to!

I’ve tried everything I can think of:

  • Double-checked my deployment ID (it’s correct!).
  • Cleared my browser cache and cookies.
  • Tried different browsers (Chrome, Firefox, Edge).
  • Even created a brand new GCP project and Google account.
  • I have tryed to change the GCP region.
  • I have tryed to create a new deployment.
  • I have tryed to use the OAuth2 library from google script.
  • Made sure my OAuth consent screen is set up properly with the Tasks API scope

Here are some details that might help:

I’m really stumped. Has anyone else encountered this issue? Any tips or tricks would be greatly appreciated!

Try adding it to “Authorized redirect URLs” instead of javascript origins?

Jepot

The domain https://script.google.com/ is your origin, not the full Web App URL.