Acts As Google Account plugin

Plugin details

Develop an acts_as_google_account plugin for authenticating users objects against the Google Authentication API.

Websitehttp://rubyforge.org/projects/asgoogleaccount/ Repositorysvn://rubyforge.org/var/svn/asgoogleaccount Author Fidel Santiago Tags Google LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install svn://rubyforge.org/var/svn/asgoogleaccount

Simple 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

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 7 months ago