如何设置 Google API 密钥限制 - HTTP 引荐来源网址 [英] How to set Google API key restriction - HTTP referrers

查看:40
本文介绍了如何设置 Google API 密钥限制 - HTTP 引荐来源网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google API 密钥限制 - HTTP 引荐来源

Google API key restriction - HTTP referrers

我将我的 Azure 网站 url xxxx.scm.azurewebsites.net 放在那里,但不起作用(Google Places API Web 服务停止工作).

I put my Azure website url xxxx.scm.azurewebsites.net there but doesn't work (Google Places API Web Service stops working).

localhost:44300 也不起作用.

localhost:44300 doesn't work either.

我必须将密钥限制设置为无",然后 Google Places API Web 服务才能工作.

I have to set key restriction to 'None', then Google Places API Web Service will work.

我做错了什么?

推荐答案

Web Service 应该在后端服务器上执行,因此对 Web Service 的正确限制是 IP 限制.

Web Service is supposed to be executed on backend servers, so the correct restriction for web services is IP restriction.

HTTP 引用限制用于客户端服务,例如 Google Maps JavaScript API,它不适用于网络服务.

HTTP referer restriction is used for client side services like Google Maps JavaScript API, it won't work with web services.

这篇关于如何设置 Google API 密钥限制 - HTTP 引荐来源网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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