Gsuite资源无法与服务帐户共享 [英] Gsuite resources can't be shared with service account
问题描述
我正在尝试获取房间(从calendar.google.com添加)服务帐户(从 https://console.cloud.google.com/iam-admin/serviceaccounts )在春季启动项目中.
我有一个服务帐户,该帐户是我在4到5个月前创建的,该帐户正在运行,并且仍在使用3个特定房间.
但是,如果我将服务帐户邮件添加到其他房间,则这些房间不会在项目中返回.
我做了这里写的所有步骤:
https://developers.google.com/identity/protocols/OAuth2ServiceAccount https://support.google.com/a/answer/1034381?hl=
I'm trying to fetch rooms (added from calendar.google.com) service account (created from https://console.cloud.google.com/iam-admin/serviceaccounts) in spring boot project.
I had one service account which I created 4-5 month ago, it was working and it is still working with the 3 specific rooms.
But if I add service account mail to other rooms, then these rooms are not returned in the project.
I did all the steps written here:
https://developers.google.com/identity/protocols/OAuth2ServiceAccount
https://support.google.com/a/answer/1034381?hl=en
此外,我尝试从日历的会议室与特定人员共享"列表中删除服务帐户电子邮件,然后将其添加回(过去有时会有所帮助).
Also, I tried removing the service account email from the room's "Share with specific people" list in Calendar, and then added it back (this helped sometimes in the past).
但是重新添加的房间也没有返回我的项目中.我正在从Java使用此方法来获取房间.
https://developers.google.com/calendar/v3/reference/calendarList/列表
这看起来像个错误,所以您知道我该如何解决吗?
But the re-added room was also not returned in my project.
I'm using this method from java to get the rooms.
https://developers.google.com/calendar/v3/reference/calendarList/list
This look like a bug, so do you know how can I work around this?
推荐答案
如果您通过UI与服务帐户共享资源日历,请在设置和共享>中添加相应的电子邮件与特定的人共享
,则可能未将日历添加到CalendarList.
If you shared the resource calendar with the Service Account through the UI, by adding the corresponding email in Settings and sharing > Share with specific people
, the calendar might not have been added to the CalendarList.
为了确保将日历添加到服务帐户的CalendarList中,您应该使用API并调用
In order to make sure that a calendar is added to the CalendarList of a Service Account, you should use the API and call calendarList.insert.
问题跟踪器中当前存在一些与日历中的服务帐户有关的未解决问题.您遇到的情况很可能与以下情况有关:检查此, .
There are currently several open issues in Issue Tracker regarding Service Accounts in Calendar. The situation you are experiencing is most probably related to that: check this, this and this, for example.
同时,我认为无法避免使用API.也许您可以开发某种UI来减轻痛苦?
Meanwhile, I don't think using the API can be avoided. Maybe you could develop some kind of UI to make it less painful?
我希望这会有所帮助.
这篇关于Gsuite资源无法与服务帐户共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!