python - 自动认证--Google Calendar API

标签 python google-api oauth-2.0 google-calendar-api google-api-python-client

我有更多关于如何实现目标的一般性问题。我想运行一个守护进程来更新我自己的谷歌日历(作为后台进程)。我已经查阅了有关 Google API 程序(身份验证、访问 token 等)的网站,我看到的身份验证代码似乎需要我手动进行身份验证(即我按下“是的,我对这个应用程序没意见”访问我的日历按钮)。鉴于我正在编写一个程序来访问我自己的谷歌日历(因此安全性不应该成为问题),有没有什么方法可以从我自己的源代码中进行身份验证(也许是一种将我的登录信息包含在 Python 脚本中的方法我正在为这个程序写作)?

我希望这是有道理的。感谢您的帮助!

最佳答案

你应该看看 Service Account with OAuth2.0。 (参见此处:https://developers.google.com/accounts/docs/OAuth2#serviceaccount)它将为您的应用程序提供一个服务帐户,您将能够从中为您的应用程序处理日历。

我知道使用 Java 可以做到这一点,在这里您会找到一个示例,展示如何使用 Java 来做到这一点。 ( https://code.google.com/p/google-api-java-client/wiki/OAuth2#Service_Accounts )

而且我几乎可以肯定它也可以用 Python 实现。 (参见 https://developers.google.com/accounts/docs/OAuth2ServiceAccount)

关于python - 自动认证--Google Calendar API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17517911/

相关文章:

python - 将 1300 个数据帧按列合并成一个帧变得非常慢

python - BS4 Python : Trying to take page links from Google but the URLs I get are all the same

javascript - 更改Google街景API的图像日期

oauth-2.0 - 如何从授权的 access_token 创建 GoogleCredential?

python - 反转为 'product',没有找到参数。尝试了 1 个模式 : [u'products/(? P<product>[-\\w]+)/$']

python - 我的刮刀抛出错误而不是继续

python - Google Books API - 如何将图书与图书版本分开?

Cordova 应用程序谷歌 OAuth2 无效 cookiePolicy

android - 如果没有重定向 uri,Android 版 Google 登录如何工作?

azure - Onedrive for Business 的 OAuth 流程