PS: - 请不要说使用这个设计,omniauth或任何其他你知道的插件/宝石。
我正在寻找一些示例代码,用于google登录,使用authlogic for ruby on rails 3。
以下是我试过/检查的内容: -
很多关于stackoverflow的链接,No-one给出的解决方案只是推荐其他宝石/过时的博客帖子,如
Ruby on Rails: Best way to add Facebook login, Twitter login, OpenID login, etc
任何人都知道任何正在运行的示例/示例代码,用于使用rails 3中的authlogic进行google登录
修改
您是否注意到这些警告,这是来自您的代码。您提供的代码在我的本地计算机上运行: -
Attempting discovery to verify endpoint
Performing discovery on https://www.google.com/accounts /o8/id?id=AItOawlFBZciVpNUBSlYbz0wHzTgmJWu9PpCvyk
WARNING: making https request to https://www.google.com/accounts/o8/id?id=AItOawlFBZciVpNUBSlYbz0wHzTgmJWu9PpCvyk without verifying server certificate; no CA path was specified.
Using 'check_authentication' with https://www.google.com/accounts/o8/ud
WARNING: making https request to https://www.google.com/accounts/o8/ud without verifying server certificate; no CA path was specified.
答案 0 :(得分:1)
你激励我去解决这个问题。
此博客基本上适用于我http://blog.sethladd.com/2010/09/ruby-rails-openid-and-google.html
我的代码非常难看,因为它不是我尝试过的第一个代码 其他资源:
Ruby open_id_authentication with Google OpenID
http://toddsedano.blogspot.com/search?updated-max=2010-05-29T11%3A59%3A00-07%3A00&max-results=7
http://railscasts.com/episodes/170-openid-with-authlogic
Anywho,为我工作的粗略代码在这里:
https://github.com/softwaregravy/google_authlogic
和here is the running code
它仍然是一个原型。希望它有所帮助。