Google API key restriction - HTTP referrers
I put my Azure website url xxxx.scm.azurewebsites.net there but doesn't work (Google Places API Web Service stops working).
localhost:44300 doesn't work either.
I have to set key restriction to 'None', then Google Places API Web Service will work.
What did I do wrong?
Web Service is supposed to be executed on backend servers, so the correct restriction for web services is IP restriction.
HTTP referer restriction is used for client side services like Google Maps JavaScript API, it won't work with web services.
To accept requests over localhost and HTTP (HTTP referrers) in Google Maps API, follow the instructions in the javascript console printed out by the Google Maps API (it tells you exactly what to do):
Google Maps API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: http://localhost:3000/en
The line Your site URL to be authorized indicates which value you have to set up in Accept requests from these HTTP referrers (websites)
In this case, e.g. for a Ruby on Rails App, it is:
http://localhost:3000/en
But you can do better, by using asterisks for wildcards:
*localhost:3000/*
To set the value to localhost:3000/* does not work!