A Domain Limit Exceeded Exception happens when a Google Cloud Platform (GCP) project has multiple redirects to unrelated applications. This page explains the details of that exception and how to fix it.
Some GCP projects have multiple unique domains in the redirect URI and origin URLs, many of which have completely unrelated applications. This causes a misrepresentation of your brand's identity to your users, and is in direct violation of Google's Terms of Service . To protect the user experience, we ask that you use no more than 10 unique domains of redirect and origin URLs in your projects. You can restrict the number of domains in your projects using the GCP Console .
We use the second level domain (SLD) of your redirect URIs and origin URLs when counting the number of domains in your project. The SLD is the first part of the top private domain in your redirect URIs and origin URLs. Following are several examples of unique domains:
Input URI |
Unique domain |
---|---|
http://www.google.com/callback |
|
http://google.co.uk |
|
https://foo.bar.example.com |
example |
http://localhost:8080/callback |
localhost |
https://myapp.appspot.com |
myapp |
To fix the Domain Limit Exceeded Exception, you need to remove unused domains from your GCP project. To remove a domain completely, delete all redirect URIs and origin URLs that contain the domain by following the steps below:
- Go to the Cloud Platform Console APIs & Services > Credentials page.
- On the project selection drop-down, select the project that contains the client you want to change.
- Under OAuth 2.0 client IDs, click the client for which you want to remove unused domains.
- On the Client ID for Web applicationpage that appears, under Authorized JavaScript origins and Authorized redirect URIs, delete unused redirect URIs and origin URLs.
- When you're finished deleting URIs and URLs, click Save.
If you need more than 10 unique domains in your redirect URIs and origin URLs, it's best to create separate projects that clearly represent the identity that's associated with each of them. When you create new projects, separate them so that each project has fewer than 10 unique domains.
- When you move a URL from an existing project to a new project, it revokes any tokens associated with the existing projects.
- If you reach your project quota limit, you can request more by completing the Request Project Quota Increase form.