Can I use multiple domains for a single app / single client ID?

Viewed 319

I am using google auth for my web app hosted on multiple domains. Can I use the same client ID I obtain from google for each domain.

They are listed as authorized redirect URIs in the consle.

For example, I have one for localhost, mydomain, my-test-domain, etc.

https://localhost:3000/auth/google/callback
https://mydomain/auth/google/callback
https://my-test-domain/auth/google/callback
2 Answers

Yes, you can specify multiple URIs. The URIs can contain different domain names.

  • On an OAuth key credential for a Web Application you can set Authorised redirect URIs and Authorised JavaScript origins.

  • The redirect URIs are the authorised addresses that the OAuth service can send responses to.

  • If your application also makes requests to OAuth service from the client-side Javascript to access Google APIs, you also must configure the Authorised redirect URIs for that credential key.

  • Both configurations accept different domains.

References:
Related