如何使用带有 Ruby 的 oauth 连接到 Google?

问题描述:

有 oauth 和 oauth2 gems,但我还没有找到使用 oauth 连接到 google 的示例

there are oauth and oauth2 gems, but I have not found an example to connect to google with oauth

官方支持的方法是使用Signet.README 包含针对 Google OAuth 端点进行身份验证所需的示例代码.另请参阅 适用于 Ruby 的 Google API 客户端.如果您对其中任何一个有任何疑问,请随时联系我.我支持这两个库.

The officially supported method is to use Signet. The README contains the example code required to authenticate against the Google OAuth endpoints. See also the Google API Client for Ruby. If you have any questions on either, don't hesitate to ping me. I'm supporting both libraries.

Signet 也适用于其他 OAuth 提供商.官方 OmniAuth 插件也可用.

Signet will also work for other OAuth providers. An official OmniAuth plugin is also available.