8

We have an add-on for Google Sheets and would like to switch other Google accounts for some functions.

Half a year ago, I successfully added a URL (https://***.googleusercontent.com) to Authorized JavaScript origins and a URL (https://oauth-redirect.googleusercontent.com/r/\*\*\*) to Authorized redirect URIs.

But now we can't and, therefore, it keeps showing

Authorization Error (Error:400: redirect_uri_mismatch).

When I try to add this URL(https://***.googleusercontent.com), it shows

"Save failed! The request failed because one of the field of the resource is invalid."

I don't know whether the rules changed and what should I do. See the screenshot for details. Thanks!

Error Message: The JavaScript origin in the request, https://***.googleusercontent.com, does not match the ones authorized for the OAuth client.

The JavaScript origin in the request, https://***.googleusercontent.com, does not match the ones authorized for the OAuth client.

Trying to add a new URI

Sun
  • 81
  • 4
  • ``When I try to add this URL(https://***.googleusercontent.com), it shows "Save failed! The request failed because one of the field of the resource is invalid."`` To be clear, `***` in `https://***.googleusercontent.com` is actual ascii characters. right? – TheMaster Oct 12 '20 at 17:59
  • Yes, like this: `https://n-kcfn2rzfaub2x2qhuzyqgl5wawaisnsrtij6ooi-2lu-script.googleusercontent.com` – Sun Oct 13 '20 at 08:00
  • May be related: https://stackoverflow.com/questions/62236466 and https://stackoverflow.com/questions/56862586 – TheMaster Oct 13 '20 at 09:35
  • Is this the same URL as was previously (and successfully) added? Or are you trying to add a second JS origin? – Iamblichus Oct 13 '20 at 12:27
  • We have a new add-on, so the URL is different. But I also tried adding the same URL to the **OAuth 2.0 Client IDs** for the new add-on and adding a second URL for the old add-on. Both of them are failed. – Sun Oct 13 '20 at 12:41
  • Try creating a issue in the [issuetracker](https://issuetracker.google.com/issues/new?component=191640&template=823905) – TheMaster Oct 14 '20 at 07:22
  • After commenting, there was already a issue filed and rejected. See https://stackoverflow.com/q/64348169 and https://issuetracker.google.com/issues/170768105 EDIT: I'm guessing this is yours: https://issuetracker.google.com/issues/170740549 – TheMaster Oct 14 '20 at 10:12

2 Answers2

4

This appears to be a bug.

The issue you reported on Issue Tracker has been forwarded internally:

Thank you for bringing this to our attention. It has been forwarded internally.

Posting this here to give it more visibility. Please click the top-left star if you're affected by this.

Iamblichus
  • 18,540
  • 2
  • 11
  • 27
3

I have the same problem, since October I am not allowed to use *.googleusercontent.com as Authorized origin.

I reported it on Issue Tracker, but their answer simply was "Thank you for your report, unfortunately Issuetracker is not the proper forum to address your report".

I solved this problem (At least temporarily) by inserting the Google sign-in button on an external site (Github pages) and once logged, redirect the user to my *.googleusercontent.com page with the sign-in token inserted in the URL as a parameter.

Alfredo
  • 762
  • 4
  • 16