Google: inactive OAuth redirect URIs and JavaScript origins

Viewed 828

I got Mail from Google:

We are writing to let you know that you have inactive OAuth redirect URIs and JavaScript origins in your Google Cloud project that are not in compliance with Google’s OAuth URI validation rules.

  • On July 12, 2021, we will remove all inactive URIs that are invalid.
  • On September 13, 2021, we will remove all URIs that are not in compliance with redirect URIs and Javascript origins rules (including formerly inactive URIs trying to become active).

I`ve got a php-App which gets all my Google-Contacts and stores them in a Database: I am using the google apis php client library

The Intervall is every 24h (cronjob), the Connection is successfully and gets the Google-Contacts (everything fine!). Google-Dashboard shows the Requests auf Conatacts API with 0% Errors, so everything is fine?

It was very complicated to get it work (English is not my favorite language and OAuth is very complicated for me) so I don't want to loose the connection with Google.

Don't know where what to do so my connection doesn't get removed!

  • How to fix the problem?
  • Where to look if inactive OAuth redirect URIs persists (to check if successfully corrected)?
1 Answers

Answer:

You must make sure that your JavaScript origins and redirect URIs adhere to the rules set out by Google.

The Rules:

As per the documentation on OAuth 2.0 for Client-side Web Applications:

Google applies the following validation rules to JavaScript origins in order to help developers keep their applications secure. Your JavaScript origins must adhere to these rules. See RFC 3986 section 3 for the definition of domain, host and scheme, mentioned below.

Validation Rules
Scheme URIs must use the HTTPS scheme, not plain HTTP.
Host Hosts cannot be raw IP addresses. Localhost IP addresses are exempted from this rule.
Domain Host TLDs (Top Level Domains) must belong to the public suffix list. Host domains cannot be “googleusercontent.com”. URIs cannot contain URL shortener domains (e.g. goo.gl) unless the app owns the domain.
Characters URIs cannot contain certain characters including: Wildcard characters ('*'), Non-printable ASCII characters, Invalid percent encodings (any percent encoding that does not follow URL-encoding form of a percent sign followed by two hexadecimal digits), Null characters (an encoded NULL character, e.g., %00, %C0%80)

You can read more information about this at the above link.

Related