Adds support for Google Apps for the domain.

This commit is contained in:
Michael Bleigh 2010-07-19 10:07:21 -05:00
parent db45e50b7b
commit 490e233fb1
6 changed files with 22 additions and 12 deletions

View File

@ -1,7 +1,7 @@
source "http://rubygems.org"
gem 'oa-core', :path => File.expand_path('../../oa-core/', __FILE__)
gem 'ruby-openid-apps-discovery'
# Will automatically pull in this gem and all its
# dependencies specified in the gemspec
gem 'oa-openid', :path => File.expand_path("..", __FILE__)

View File

@ -3,6 +3,6 @@ require 'omniauth/core'
module OmniAuth
module Strategies
autoload :OpenID, 'omniauth/strategies/open_id'
autoload :Google, 'omniauth/strategies/google'
autoload :GoogleApps, 'omniauth/strategies/google_apps'
end
end

View File

@ -1,9 +0,0 @@
require 'omniauth/openid'
module OmniAuth
module Strategies
class Google < OmniAuth::Strategies::OpenID
def identifier; 'https://www.google.com/accounts/o8/id' end
end
end
end

View File

@ -0,0 +1,17 @@
require 'omniauth/openid'
module OmniAuth
module Strategies
class GoogleApps < OmniAuth::Strategies::OpenID
def initialize(app, domain, store = nil, options = {})
@domain = domain
options[:name] ||= 'apps'
super(app, store, options)
end
def identifier
@domain
end
end
end
end

View File

@ -1,4 +1,5 @@
require 'rack/openid'
require 'gapps_openid'
require 'omniauth/openid'
module OmniAuth

View File

@ -11,8 +11,9 @@ Gem::Specification.new do |gem|
gem.files = Dir.glob("{lib}/**/*") + %w(README.rdoc LICENSE.rdoc CHANGELOG.rdoc)
gem.add_dependency 'oa-core', version
gem.add_dependency 'oa-core', version
gem.add_dependency 'rack-openid', '~> 1.0.3'
gem.add_dependency 'ruby-openid-apps-discovery'
eval File.read(File.join(File.dirname(__FILE__), '../development_dependencies.rb'))
end