2

PS:- please dont say use this devise, omniauth or any other plugin/gem you know.

I am looking for some example code for google login using authlogic for ruby on rails 3.

Here is what i have tried/checked:-

Anybody knows any running example/ sample code for google login with authlogic in rail 3

EDIT

Have you noticed these warnings, this is from your code. The code you provided is running on my local machine:--

 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.
Community
  • 1
  • 1
Mohit Jain
  • 43,139
  • 57
  • 169
  • 274

1 Answers1

1

You inspired me to hack away at this.

This blog basically worked for me http://blog.sethladd.com/2010/09/ruby-rails-openid-and-google.html

My code is extra ugly though, because it wasn't the first one I tried.
Other resources:

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, the rough code that is working for me is here: https://github.com/softwaregravy/google_authlogic
and here is the running code

It's still very much a prototype. Hope it helps.

Community
  • 1
  • 1
John Hinnegan
  • 5,864
  • 2
  • 48
  • 64
  • A beer jug for you.. Thanks a lot.. I think once I done with my current project. I should fork your repo to add facebook, and twitter login too. Will do that for sure.. Thanks a lot bro.. – Mohit Jain Jun 26 '11 at 19:55
  • Yes. Different ballgame. You'd need to have your host set up with Certs (i.e. Verisign). I'm guessing that's why with facebook apps, you always have to switch back to http:// and not https:// – John Hinnegan Jun 26 '11 at 20:54
  • Ok. and what about that Rack::OpenID issue. Do u have any idea. Like same stuff is working in your code. I checked your environment.rb file etc. There is not as such any declaration. Why I am getting that error. – Mohit Jain Jun 26 '11 at 20:57
  • Not all of the magic columns seem to be supported right now either. I'm thinking I need to actually create an actual session somehow for the user, but without needing a password. I've also disabled checking of passwords and stuff, but you'd actually want that if you intend to allow regular log ins next to openid logins – John Hinnegan Jun 26 '11 at 20:57
  • Hey. It worked.. Only issue is that warnings. I will check those things and will be back.. :-) – Mohit Jain Jun 26 '11 at 21:04
  • warnings discussed in the context of devise https://github.com/intridea/omniauth/issues/185 – John Hinnegan Jun 26 '11 at 21:09
  • One of my links discussed how to fix the error: http://toddsedano.blogspot.com/2010/05/integrating-openid-google-apps-and-ruby.html – John Hinnegan Jun 26 '11 at 21:11