John McInnes
John McInnes

Reputation: 121

Google Maps Key Restrictions by IP Address not working

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

Answers (1)

geocodezip
geocodezip

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.

Upvotes: 24

Related Questions