谁拥有通过 Google 日历 API 由服务帐户创建的日历以及如何共享它们? [英] Who owns calendars created by service account via Google Calendar API and how can they be shared?

查看:24
本文介绍了谁拥有通过 Google 日历 API 由服务帐户创建的日历以及如何共享它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个带有项目 project-1(在 Google Developer Console 中配置为 Google App Engine 应用程序)的 Google 帐户 some.account@gmail.com 和一个具有属于它的电子邮件地址 12..@developer.gserviceaccount.com 的服务帐户.

Let's say I have a Google account some.account@gmail.com with project project-1 (configured as Google App Engine application in Google Developer Console) and a service account with e-mail address 12..@developer.gserviceaccount.com that belong to it.

我知道如何使用此服务帐户创建日历并以编程方式操作其条目:我使用 Google API 客户端库(Java 版本,带有服务帐户凭据)在我的 Google App Engine 应用程序中调用 Google Calendar API,它就是这样做的.但是,任何此类创建的日历似乎都归服务帐户所有,而不是由我的全球 Google 帐户拥有.我从以下观察中得出结论:

I know how to use this service account to create a calendar and manipulate its entries programmatically: I use the Google APIs Client Library (Java version, with service account´s credentials) to invoke Google Calendar API inside my Google App Engine application and it does just that. However any such created calendars seem to be distinctly owned by the service account, not by my englobing Google account. I conclude this from the following observations:

  • 当我在 Google 日历 UI 中查看我的 Google 帐户日历时,没有任何以编程方式创建的日历显示在我的日历下.
  • 当我尝试通过发布其他日历来访问这样的日历时 |添加朋友的日历 和服务帐户的电子邮件地址,我可以发送请求,但它永远不会得到答复(大概是因为服务帐户的电子邮件地址不是真实"电子邮件地址).
  • 当我以编程方式创建日历时,我没有设置 CalendarListEntry#hidden,所以 默认false 应该适用.
  • When I view my Google account's calendar in the Google Calendar UI, none of the programmatically created calendars show up under My calendars.
  • When I try to access such a calendar by issuing Other calendars | Add a friend´s calendar and with the service account´s email-address, I can send off the request, but it never gets answered (presumably because the service account's e-mail address isn't a "real" e-mail address).
  • When I'm creating calendars programmatically, I don't set CalendarListEntry#hidden, so the default false should apply.

所以我的问题是:如何在正常的 Google 日历 Web UI 中访问使用 Google 日历 API(在我的情况下为 Java 客户端)以编程方式创建的日历和日历条目.例如,服务帐户是否可以与其拥有的 Google 帐户共享其日历,或者我是否可以在 UI 中使用其服务帐户凭据直接操作 Google 帐户的日历.

So my question is this: How can I access calendars and calendar entries that were created programmatically with Google Calendar API (and a Java client in my case) in the normal Google Calendar Web UI. E.g., can the service account share its calendars with its owning Google account, or can I directly manipulate the Google account's calendars with its service account credentials in the UI.

我知道之前有一些关于同一主题的问题,但到目前为止它们并没有帮助我解开谜团.

I realize there are some previous questions on the same topic, but they haven't helped to solve the mystery for me so far.

推荐答案

您必须以编程方式共享由服务帐户创建的日历.日历归服务帐户所有.

You will have to programmatically share the calendar created by the service account. The calendars are owned by the service account.

你尝试了什么:

  • 日历没有显示在您的帐户中,因为您无权访问它们,即使您是 appengine 管理员.
  • 输入服务帐户的电子邮件地址不会在 UI 中显示日历,因为服务帐户的电子邮件地址不是日历的电子邮件地址.一个服务帐户可以创建多个日历.

以编程方式与您的帐户共享日历,记录日历唯一 ID,然后在用户界面中输入.

Share the calendar programmatically with your account, log the calendar unique id and then enter it in the UI.

这篇关于谁拥有通过 Google 日历 API 由服务帐户创建的日历以及如何共享它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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