Setting up authlogic-oauth using Google

Hi everyone, I'm trying to learn the rails, and I'm working on an application that uses Google to log in, as well as for calendar data. I am currently working on setting up authlogic-oauth and with some problems.

I am following the manual for the authlogic-oauth plugin (see link above), and I am in steps 4 and 5. At first I am still learning the language, and I'm not sure where the code from step 4 goes to 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 quite sure where I find the information I need to fill out. I read hxxp: //code.google.com/apis/accounts/docs/OAuth_ref.html (sorry, I can only send 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 get calendar information, I was just told that I can someone from the IRC. Am I doing this through this plugin or do I need to use another one?

Many thanks!

+7
ruby-on-rails oauth authlogic
source share
1 answer

You can read how to connect to Google OAuth in your Ruby on Rails application on the manu-j blog. The first paragraph mentions how to get these keys. You must register your domain using google.

But it just goes into your application, not your google account. It looks like after logging in with OAuth, you can access all of your google apps and saved Google data (e.g. calendar). The OAuth service is similar to OpenID. Both are only services for authenticating the user in your application (instead of registering with your application).

If you want to use some of the Google calendar data in your application, you can start with the Googlecalendar gem , the rails plugin and an example .

+1
source share

All Articles