Google Maps API(Cordova)中允许的引荐来源网址 [英] Allowed referrers in google maps API (cordova)

查看:116
本文介绍了Google Maps API(Cordova)中允许的引荐来源网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为gmapsv3创建了一个API密钥,但它要求我允许一些HTTP引荐来源网址.

由于没有URL,cordova应用程序的引荐来源网址是什么?

我暂时离开了*,但是如何保护我的钥匙?

我在流星之下,尝试使用meteor.local,但这似乎不起作用.

谢谢

解决方案

您可能会更改本机代码以添加引荐来源,并将地图键锁定为此. "https://stackoverflow.com/questions/7913305/specifying-http-referer-in-embedded-uiwebview/7913433#7913433>此处.

或者,如果您想要独立于平台的解决方案,则可以在服务器上添加实现代理,将Google Maps密钥保留在服务器上,然后让它代表您向Google Maps发出请求.这将引入另一层网络调用,然后您还希望保护代理服务器的安全,以便可以确保请求来自应用程序-也许可以通过设置服务器可以查找的自定义HTTP标头来实现./p>

I created an API key for gmapsv3 but it's asking me for allowing some HTTP referrers.

What is the referrer for a cordova app, since there is no URL?

I left * for the moment but how to secure my key?

I'm under meteor and tries meteor.local, but it doesn't seem to work.

Thanks

解决方案

You could potentially change the native code to add a referer, and lock your maps key down to that... there is an example of such here.

Alternatively if you want a platform independent solution you could add implement a proxy on your server, keep your Google Maps key there on the server and have it make requests to Google Maps on your behalf. This would introduce another layer of network calls, then you'd also want to secure your proxy so that you can be pretty sure that the requests are coming from your app - maybe by setting a custom HTTP header that your server can look for.

这篇关于Google Maps API(Cordova)中允许的引荐来源网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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