使用服务帐户授权可以访问哪些Google API? [英] Which Google APIs can be accessed with service account authorization?

查看:166
本文介绍了使用服务帐户授权可以访问哪些Google API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Google API文档推断,并非所有广告的Google服务都可用于服务帐户。

例如。在服务帐户公告中,这是文本的一部分:


`服务帐户目前由以下Google
支持开发者服务:


  • Google云端存储

  • Google预测API

  • Google网址缩短工具

  • Google OAuth 2.0授权服务器

  • Google API控制台

  • 适用于Python,Java和PHP的库


据我所知,前三项涉及特定服务在支持任何服务之前,OAuth服务器和控制台都是基础设施要求,(列表中的最后一项对我来说有点含糊)。



我也注意到这个参考Google驱动器可用于服务帐户: http://tinyurl.com/ahwo3bs (非常酷) p>

是否有全面的l其中的服务可以通过服务帐户授权访问,哪些不是?我最感兴趣的是云存储(现在工作)。 Google云端硬盘,Google+环聊和环聊直播。 (我知道服务帐户参与视频群聊的想法可能看起来很奇怪。)

解决方案

所有支持OAuth 2.0的Google API应使用服务帐户。



然而,上面列出的三种产品(云存储,预测API和URL Shortner)是唯一真正意义上使用服务的产品帐户(即代表您的应用程序)的所有其他Google API都可以访问用户的数据。您可以阅读应用程序所有帐户云端硬盘文档的第一部分以获取更多解释。

PS:公告中说用于Python,Java和PHP的Google API客户端库的部分意思是说只有我们的Java,PHP和Python客户端库具有内置类才能使用服务帐户授权(OAuth 2.0的客户端凭据流)。现在我们的大部分客户端库都有支持。请查看参考文档中的代码示例以获取完整列表。


I infer from the Google API documentation, that not all of the advertised Google services are available to service accounts.

e.g. In the announcement for service accounts, this was part of the text:

`Service accounts are currently supported by the following Google developer services:

  • Google Cloud Storage
  • Google Prediction API
  • Google URL Shortener
  • Google OAuth 2.0 Authorization Server
  • Google APIs Console
  • Google APIs Client Libraries for Python, Java, and PHP

I understand the first three refer to specific services, the OAuth server and console are infrastructure requirements before any service could be supported, (the last item in the list is a little vague to me.)

I also noticed this reference to Google Drives being available to a service account: http://tinyurl.com/ahwo3bs (very cool).

Is there a comprehensive list of which services are accessible with service account authorization and which are not? I am most interested in Cloud Storage (working now). Google Drive, Google+ Hangouts, and hangouts On Air. (I know the idea of a service account participating in a hangout might seem odd.)

解决方案

All Google APIs that supports OAuth 2.0 should work with Service Accounts.

However the 3 products listed above (Cloud Storage, Prediction API and URL Shortner) are the only ones with which it makes real sense to use Service Accounts (i.e. on behalf of your application) all other Google APIs are here to access user's data. You can read the first section of the Application Owned Accounts Drive documentation for more explanations.

PS: the part of the announcement that said Google APIs Client Libraries for Python, Java, and PHP was meant to say that only our Java, PHP and Python client libraries had built-in classes to use Service Account authorization (the Client credentials flow of OAuth 2.0). Now most of our client libraries have support. Check the code sample in the referred documentation for the full list.

这篇关于使用服务帐户授权可以访问哪些Google API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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