Google web client OAuth 2.0 JavaScript origins with private IP or local DNS name

Hello everyone,
I am trying to set up a Login with Google button for a web app of a company intranet.

Is it possible to set a local domain name or private IP as authorized origins for Javascript?

In general, is it ok to use a login with Google button for a web app that is not published on the internet but is only for an intranet?

I just found this similar question on Stack Overflow but without answers...

Thank you for your time,
wootrop



https://stackoverflow.com/questions/67130541/how-to-use-private-ip-as-a-authorized-javascript-origin...

0 2 1,152
2 REPLIES 2

Hello @wootrop,

Welcome to Google Cloud Community!

To answer your first question, Google applies the following validation rules to JavaScript origins in order to help you keep your applications secure. 


Validation rules
Scheme

JavaScript origins must use the HTTPS scheme, not plain HTTP. Localhost URIs (including localhost IP address URIs) are exempt from this rule.

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”.
  • JavaScript origins cannot contain URL shortener domains (e.g. goo.gl) unless the app owns the domain.
Userinfo

JavaScript origins cannot contain the userinfo subcomponent.

Path

JavaScript origins cannot contain the path component.

Query

JavaScript origins cannot contain the query component.

Fragment

JavaScript origins cannot contain the fragment component.

Characters JavaScript origins 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 set your user type as "Internal" to limit your users within the organization only but it is not intended for intranet only. See Integrating Google Sign-in into your web app for creating authorization credentials and adding Google Sign-in button. 

Hi Willbin,
Thank you for your reply.

So, if I understood your response correctly, for the first question it is not possible to enter a private IP or a local domain name.

As for the second question, does that mean it's not possible to implement a Google login for an intranet?

Thank you again,
wootrop

 

Top Labels in this Space