Google放置了自动完成隐藏键 [英] Google places AutoComplete hide key

查看:235
本文介绍了Google放置了自动完成隐藏键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Grails应用程序。在我的gsp页面中,当我有行时

 < script src =https://maps.googleapis.com/maps /api/js?v=3.exp&libraries=places&key=myKey\"></script> 

我的密钥被暴露了,有没有办法在gsp中隐藏这个?我可以限制域的生产,但目前应用程序正在我的本地机器测试很多,因为每个PC的IP都必须添加。我假设应该有一个更聪明的&更简单的方法来处理这个问题。

解决方案

没有办法隐藏这一行。但是,您可以限制在google api控制面板中使用指定键的域。





之后



选择 HTTP引荐网址并将网域输入文本框和保存。请注意以下Google注释。



注意:设定可能需要5分钟才能生效


I have a grails application. In my gsp page when I have the line

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&key=myKey"></script>

My key is exposed, is there a way to hide this in the gsp? I could restrict the domain for my production, but currently the application is being tested in my local machine alot, and because of that each PC's ip has to be added. I'm assuming there should be a smarter & easier way to handle this.

解决方案

There is no way to hide this line. However, you can restrict the domain which uses the specified key in google api control panel.

Login from here

Click Credentials from left section. Find your key in API KEYS panel.

After That

Choose HTTP referrers (web sites) and enter your domain into textfield and save. Pay attention Google's note below.

Note: It may take up to 5 minutes for settings to take effect

这篇关于Google放置了自动完成隐藏键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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