Configuring authlogic-oauth with google

Posted by Zak on Stack Overflow See other posts from Stack Overflow or by Zak
Published on 2010-04-10T23:10:34Z Indexed on 2010/04/10 23:13 UTC
Read the original article Hit count: 526

Howdy everybody, I am trying to learn rails, and I'm working on an app that uses Google for logins and also for calendar data. I'm currently working on configuring authlogic-oauth and having some issues.

I've been following the guide for the authlogic-oauth (see link above) plugin, and I'm on steps 4 and 5. First off, I am still learning the language and I'm not sure where the code from step 4 goes in the controllers:

@user_session.save do |result|
if result
flash[:notice] = "Login successful!"
redirect_back_or_default account_url
else
render :action => :new
end
end

Secondly, I'm trying to set up step 5, the actual Google oauth data step:

class UserSession < Authlogic::Session::Base
def self.oauth_consumer
OAuth::Consumer.new("TOKEN", "SECRET",
{ :site=>"http://google.com",
:authorize_url => "http://google.com/xxx" })
end
end

I'm not entirely sure where I find the info I need to fill this in. I've been reading hxxp://code.google.com/apis/accounts/docs/OAuth_ref.html (sorry I can only post one hyperlink), but I'm just not sure where I get everything and what the plugin handles for itself.

Finally, I'm not quite sure how I retrieve the calendar info, I've just been told I could by someone on IRC. Do I do it through this plugin or do I have to use another one as well?

Thanks so much!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about oauth