谷歌API:浏览器的按键和Android按键之间的区别? [英] Google API: Difference between browser key and Android key?

查看:181
本文介绍了谷歌API:浏览器的按键和Android按键之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用谷歌日历的API,我已经产生了浏览器的API密钥的似乎的工作。但是在API控制台我也可以选择生成一个Android API密钥。两者之间的区别是什么?我可以在Android应用程序中使用浏览器密钥?

I'm trying to use the Google Calendar API, and I've generated a browser API key that seems to work. But in the API console I also have the option to generate an Android API key. What is the difference between the two? Can I use a browser key in an Android application?

推荐答案

我不知道这是否会工作使用的Andr​​oid应用程序在浏览器的关键,但它并没有真正意义。

I'm not sure if it'll work to use a browser key in an Android application, but it doesn't really make sense.

谷歌API文档

该控制台,您可以创建服务器,浏览器,Android和iOS API   键。一旦你创建了一个键,就限制它可以使用。   可用限制取决于键的类型。

The Console enables you to create server, browser, Android and iOS API Keys. Once you've created a key, you restrict where it can be used. The available restrictions depend upon the type of key.

      
  • 在服务器密钥可根据您的服务器的源IP地址(ES)的限制。
  •   
  • 在浏览器的按键可以基于限制的 HTTP引用。
  •   
  • 在Android的按键可以根据包名称和证书的SHA-1指纹的限制。
  •   
  • iOS的密钥可以基于束标识符被限制。
  •   
  • Server keys can be restricted based on your servers' source IP address(es).
  • Browser keys can be restricted based on HTTP referrer.
  • Android keys can be restricted based on the package name and certificate SHA-1 fingerprint.
  • iOS keys can be restricted based on the bundle identifier.

看起来你必须指定一个网站,作为引荐的基于浏览器的钥匙。因为你不知道引荐会在你的Andr​​oid应用程序是什么,它​​并没有真正意义的,做这种方式。随着Android的按键,就可以通过包名限制API使用。

It looks like you have to specify a website as the referrer for browser based keys. Since you don't know what the referrer will be in your Android app, it doesn't really make sense to do it this way. With an Android key, you can restrict API usage by the package name.

另外:

您的项目可以因此在结合服务器端组件   使用浏览器和/或移动部件,无惧牺牲的   你的服务器(S)如果一个浏览器键或移动密钥被泄露。

Your project can therefore have server-side components in conjunction with browser and/or mobile components, without fear of compromising your server(s) if a browser key or mobile key is compromised.

如果您使用两个不同的密钥,它可以让你确保,如果一个被攻破,其他人都没有。这为您提供了更好的安全性。

If you use two different keys, it allows you to make sure if one is compromised, the others are not. This provides better security for you.

这篇关于谷歌API:浏览器的按键和Android按键之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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