How can I connect to Google using oauth with Ruby?

本小妞迷上赌 提交于 2019-12-21 09:34:15

问题


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


回答1:


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 will also work for other OAuth providers. An official OmniAuth plugin is also available.




回答2:


Try omniauth instead.

https://github.com/intridea/omniauth

Here's An excellent screencast showing how its used: http://railscasts.com/episodes/241-simple-omniauth



来源:https://stackoverflow.com/questions/4337259/how-can-i-connect-to-google-using-oauth-with-ruby

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!