Agile Web Development

Build it. Launch it. Love it.

acts_as_google_account

A plugin for authenticating users objects against the Google Authentication API.

Example

class User < ActiveRecord::Base

  acts_as_google_account

  def self.login(username, password)
    if username.include? "@gmail.com" then
        if self.GoogleLogin(username, password) then
            find_by_email(username)
        end
    else
        hashed_password = hash_password(password || "")
        find(:first, :conditions  => ["username = ? and hashed_password = ?", username, hashed_password])
    end
  end

  def try_to_login
    User.login(self.username, self.password)
  end
end

Vitals

Home http://rubyforge.org/projects/asgoogleaccount/
Repository svn://rubyforge.org/var/svn/asgoogleaccount
License GPL
Tags Tag_red 820cdc1b0b533541820c5b5ad04da479 account any arth authenticate been brightly cant comforting d439069964c847c4d43919914a5ce410 dressed eeeeeeeeeeeeeeeeeeeeeeeeeee eep fifteen Ghanta gmail hought indle instrument lightly lucky mice notice orange PINGU pronounced quite relaxed round sash SINGH those true us wave will
Rating (11 votes)
Owner Fidel Santiago
Created 17 October 2006

Comments

  • Avatar
    30 October 2006

    This plugin is not recommended - it does not auth against gauth in a secure fashion, and runs contrary to google's policy of not storing google logins on foreign sites. It will make your logins slow, besides.

  • Avatar
    Ravi
    5 October 2007

    Hi, i have followed your code to login into my web application with google id and password but i didnt get.please provide controller code with explanation and step wise

  • Avatar
    ravi
    5 October 2007

    hi, i have used your code but i got error like undefined method acts_as_google_account. please suggest on this error

Add a comment