如何查看/编辑用户' Google日历事件使用我的NextJS应用

发布于 2025-02-01 18:31:24 字数 210 浏览 2 评论 0 原文

我正在使用NextJ构建平台,其中我需要获取用户的Google日历事件,并能够将事件添加到其日历中。

我设置了一个服务帐户,并希望我的服务帐户访问用户的日历数据。

研究后,我发现一种方法是让用户手动与我的服务帐户共享其日历。

但是,我想知道我的用户是否有一种方法可以授予我的服务帐户许可而无需手动执行此操作,因此,按下我的平台上的按钮可以让他们与服务帐户共享日历。

I am building a platform using NextJS in which I need to grab my users' Google Calendar events and be able to add events to their calendars.

I have a service account set up and would like my service account to access my users' calendar data.

After researching, I have found that one way to do so is to have the user share their calendar manually with my service account.

However, I was wondering if there is a way for my users to be able to give my service account permission without having to do it manually, so for example, pressing a button on my platform that will let them share their calendar with the service account.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水溶 2025-02-08 18:31:24

服务帐户旨在与开发人员控制的日历一起使用。服务帐户还仅在您有Google Workspace帐户的情况下使用Google日历。您还需要使用Google Workspace域帐户,才能设置域名范围委托在您的服务帐户上,将其与Google日历一起使用。

用户无法与服务帐户共享标准的Google日历帐户。几年前,Google关闭了这种情况。 域名范围

现在唯一的选择是 将需要使用OAuth2请求您的用户同意以访问其Google日历帐户。像这样的东西将是一个开始 noreferrer“> node.js QuickStart

service account are intended for use with a calendar that you the developer control. Service accounts also only work with google calendar if you have a google workspace account. You will also need to use a google workspace domain account in order to set up domain wide delegation on your service account to use it with google calendar.

There is no way for a user to share a standard google calendar account with a service account. That was shut down by google a number of years ago. The only option now is domain wide delegation

That being said you will need to use Oauth2 to request consent of your users to access their google calendar accounts. Something like this would be a good place to start Node.js quickstart

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文