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 https://developers.google.com/identity/protocols/OAuth_ref, 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?