Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error API_KEY_HTTP_REFERRER_BLOCKED #3

Closed
falkrussow opened this issue May 3, 2023 · 5 comments
Closed

Error API_KEY_HTTP_REFERRER_BLOCKED #3

falkrussow opened this issue May 3, 2023 · 5 comments

Comments

@falkrussow
Copy link

Hello
i recently got the following message

{ "error": { "code": 403, "message": "Requests from referer \u003cempty\u003e are blocked.", "errors": [ { "message": "Requests from referer \u003cempty\u003e are blocked.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "API_KEY_HTTP_REFERRER_BLOCKED", "domain": "googleapis.com", "metadata": { "service": "youtube.googleapis.com", "consumer": "projects/00000ausgenullt00000" } } ] } }

I have Contao 4.9

@fritzmg
Copy link
Contributor

fritzmg commented May 3, 2023

According to the error message you have restricted your API key. You need to remove that restriction (or change it to an IP restriction for example) - or use a separate API key just for the sync in case you use the same API key for front end functionalities (and thus want to restrict the API key).

@fritzmg fritzmg closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2023
@fritzmg fritzmg changed the title Error Error API_KEY_HTTP_REFERRER_BLOCKED May 3, 2023
@falkrussow
Copy link
Author

I only have the restriction on the IP. It works until a few days ago. I have the same problem in other versions of Contao, which always have their own API key and project. Everywhere the same error. Unfortunately there is nothing to be found in the log either.

@fritzmg
Copy link
Contributor

fritzmg commented May 4, 2023

I only have the restriction on the IP.

You need to double check that. According to the error message a HTTP referrer restriction is in place for the used API key.

@falkrussow
Copy link
Author

I have now taken out all the restrictions for testing and then it works. But that is very insecure. If I enter the IP or domain again, it doesn't work again.

@fritzmg
Copy link
Contributor

fritzmg commented May 5, 2023

If I enter the IP or domain again, it doesn't work again.

You cannot use domain restrictions for server-side API keys. You can only use that for API keys used in the front end, e.g. for the Google Maps JavaScript SDK for instance, or Google Maps iframes.

IP restrictions should work.

Anyway, this has nothing to do with this extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants