Google地图密钥限制按IP地址不起作用 [英] Google Maps Key Restrictions by IP Address not working

查看:117
本文介绍了Google地图密钥限制按IP地址不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过使用IP地址设置密钥限制来限制对我的Google Maps API帐户的访问。以前,我可以使用HTTP Referrer设置密钥限制,但我似乎无法使用IP地址获得相同的配置。我已经生成了一个用于IP地址的新密钥(保留当前使用的HTTP引用程序,因为它起作用)。



作为一个例子,我可以访问MAPS API from localhost / *但无法从127.0.0.1访问它(使用带AP地址密钥限制设置的新API密钥)。我的实际网站托管在一个共享服务器上,使用HTTP引用限制的域名(perfectpets.com.au)都很好,但是如果我使用带有IP地址限制的新API密钥,则会出现RefererNotAllowedMapError错误。 p>

有关如何获得此功能的任何提示将不胜感激。

解决方案

IP地址限制仅适用于网络服务,不适用于Google Maps JavaScript API v3。



文档


一旦被限制,一个密钥只能在平台支持这种类型的限制。





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.

解决方案

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.

这篇关于Google地图密钥限制按IP地址不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆