Reputation: 121
I am trying to restrict access to my Google Maps API account by using IP Address to set up Key Restriction. Previously I have been able to set up Key Restriction using the HTTP Referrer, but I do not seem to be able to get the same config happening using IP Addresses. I have generated a new key to use with the IP Addresses (leaving the current using HTTP Referrer in play as it works).
As an example I can access the MAPS API from localhost/* but am unable to access it from 127.0.0.1 (using the new API key with AP Address key restrictions setup). My actual website is hosted on a shared sever and using the domain name (perfectpets.com.au) with the HTTP referrer restriction all is good, but if I use the new API key with IP address restriction I get the RefererNotAllowedMapError error.
Any tips on how to get this going would be greatly appreciated.
Upvotes: 11
Views: 16660
Reputation: 161334
IP address restrictions only work for web services, not the Google Maps JavaScript API v3.
From the documentation
Once restricted, a key will only work on platforms that support that type of restriction.
- IP addresses (individual servers) - for use with the web service APIs.
- HTTP referrers (web sites) - for use with the Web APIs.
Upvotes: 24