1

I have a website that I'm integrating with a Google calendar. I want to allow users to add events to this calendar, but not directly. I've got a form setup on the page that can add events to the calendar presently, but you have to be logged in to use that form. Is there a way to authorize the webpage itself, or put the auth token in the code so that you don't have to be logged in to add an event? All I get on the Google developer site is a bunch of "Google knows best" brow beating about how it's a bad idea from a security stand point, but no real answers. Has anyone ever done something similar?

4

1 回答 1

0

您需要创建一个服务帐户并将您的私钥存储为 .p12 文件。

这是有关服务帐户的 Google 信息:服务帐户

您需要对服务帐户执行的操作:后续步骤

我和你有同样的问题;我正在创建一个脚本来自动验证用户以将事件添加到谷歌日历(作为后台进程)......使用在日历事件详细信息和时间/日期的表单中捕获的数据。

到目前为止,我已经设法将表单详细信息发布到单击表单的提交按钮后加载的新文件。目前该页面将要求用户接受(“您是否同意此应用程序可以访问您的日历设置?:是,否?”)......然后它将允许用户确认提交的详细信息,确认后,用户被重定向到主页。创建了一个新事件。

(如果您想查看我当前的进度,请查看我的 youtube 视频:www.youtube.com/watch ?v=9pU_RvpGqx0&hd= 1 注意:我已经更新了我的脚本。)

祝你好运!

乔希。

于 2014-02-24T10:15:57.143 回答