7
votes

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

2
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
Yes, like this: https://n-kcfn2rzfaub2x2qhuzyqgl5wawaisnsrtij6ooi-2lu-script.googleusercontent.com - Sun
Is this the same URL as was previously (and successfully) added? Or are you trying to add a second JS origin? - Iamblichus
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

2 Answers

4
votes

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.

3
votes

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.