omn​​iauth-google-oauth2 也可以用于从 google 日历 API 获取日历信息吗?

发布于 2025-01-06 06:41:30 字数 321 浏览 4 评论 0原文

还可以使用omniauth-google-oauth2来获取日历信息吗 谷歌日历API?

到目前为止我已经设法得到: a)omniauth-google-oauth2 测试 Rails 应用程序致力于“登录” 测试应用程序 1 中的 google” b) OAuth 插件,用于通过 Oauth 日历数据 API 获取日历数据 在测试应用程序 2 中。

问题是我是否可以放弃使用“OAuth Plugin”而只是 使用“omniauth-google-oauth2”也可以(在身份验证后)获取 日历数据?如果是,这将如何运作?是 OAuth 令牌吗 谷歌的身份验证与此相同谷歌日历 API 方面?

Can omniauth-google-oauth2 be used also to get calendar info back from
the google calendar API?

I have managed to so far to get:
a) omniauth-google-oauth2 test rails app working to "sign on with
google" in test app 1
b) OAuth Plugin to get calendar data via the Oauth Calendar Data API
in test app 2.

QUESTION is whether I could drop the use of "OAuth Plugin" and just
use "omniauth-google-oauth2" to also (after authentication) get the
calendar data? If yes, how would this work? Are the OAuth tokens
the same from google for the authentication & google calendar api
aspects?

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

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

发布评论

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

评论(2

绿萝 2025-01-13 06:41:30

是的,它可以用来获取日历数据。

我只使用omniauth-google-oauth2 gem 进行日历访问。
我认为它的工作方式与带有令牌的 oauth 插件相同。

查看此内容以开始使用https://github.com/deafgreatdane/google_oauth_calendar

Yes, it can be used to get calendar data.

I only use the omniauth-google-oauth2 gem for calendar access.
I would assume it works the same way as the oauth plugin with the token.

Check out this to get started https://github.com/deafgreatdane/google_oauth_calendar

新人笑 2025-01-13 06:41:30

对于未来的搜索者:

您只需在 google_oauth2 提供商的范围中包含 calendar 即可。

provider :google_oauth2,
         ENV["GOOGLE_OAUTH2_APP_ID"],
         ENV["GOOGLE_OAUTH2_APP_SECRET"],
         { scope: 'email,profile,calendar' }

更多详情请点击此处

For future searchers:

You can simply include calendar in the scope for your google_oauth2 provider.

provider :google_oauth2,
         ENV["GOOGLE_OAUTH2_APP_ID"],
         ENV["GOOGLE_OAUTH2_APP_SECRET"],
         { scope: 'email,profile,calendar' }

More details here.

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