1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

added open id support via omniauth

This commit is contained in:
David A. Cuadrado 2010-10-31 02:04:24 +08:00 committed by José Valim
parent 94622054de
commit bf19b15914
5 changed files with 20 additions and 10 deletions

View file

@ -6,6 +6,7 @@ gem "rails", "3.0.0"
gem "webrat", "0.7.1"
gem "mocha", :require => false
gem "oa-oauth", :require => "omniauth/oauth"
gem "oa-openid", :require => "omniauth/openid"
platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter'

View file

@ -47,7 +47,6 @@ GEM
bson (1.0.4)
bson_ext (1.0.7)
builder (2.1.2)
columnize (0.3.1)
erubis (2.6.6)
abstract (>= 1.0.0)
faraday (0.5.0)
@ -56,7 +55,6 @@ GEM
rack (~> 1.2.1)
i18n (0.4.1)
jdbc-sqlite3 (3.6.3.054)
linecache (0.43)
mail (2.2.6.1)
activesupport (>= 2.3.6)
mime-types
@ -85,6 +83,10 @@ GEM
oa-core (= 0.1.4)
oauth (~> 0.4.0)
oauth2 (~> 0.0.10)
oa-openid (0.1.4)
oa-core (= 0.1.4)
rack-openid (~> 1.1.1)
ruby-openid-apps-discovery
oauth (0.4.3)
oauth2 (0.0.13)
faraday (>= 0.4.1)
@ -94,6 +96,9 @@ GEM
rack (1.2.1)
rack-mount (0.6.13)
rack (>= 1.0.0)
rack-openid (1.1.2)
rack (>= 0.4)
ruby-openid (>= 2.0.3)
rack-test (0.5.5)
rack (>= 1.0)
rails (3.0.0)
@ -110,11 +115,9 @@ GEM
rake (>= 0.8.4)
thor (~> 0.14.0)
rake (0.8.7)
ruby-debug (0.10.3)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.3.0)
ruby-debug-base (0.10.3)
linecache (>= 0.3)
ruby-openid (2.1.8)
ruby-openid-apps-discovery (1.2.0)
ruby-openid (>= 2.1.7)
sqlite3-ruby (1.3.1)
thor (0.14.1)
treetop (1.4.8)
@ -142,9 +145,9 @@ DEPENDENCIES
mongo (= 1.0.7)
mongoid (= 2.0.0.beta.18)
oa-oauth
oa-openid
orm_adapter (~> 0.0.2)
rails (= 3.0.0)
ruby-debug (>= 0.10.3)
sqlite3-ruby
warden (~> 1.0.0)
webrat (= 0.7.1)

View file

@ -5,9 +5,9 @@ module Devise
return unless mapping.omniauthable?
class_eval <<-URL_HELPERS, __FILE__, __LINE__ + 1
def #{mapping.name}_omniauth_authorize_path(provider)
def #{mapping.name}_omniauth_authorize_path(provider, params = {})
if Devise.omniauth_configs[provider.to_sym]
"/#{mapping.path}/auth/\#{provider}"
"/#{mapping.path}/auth/\#{provider}?\#{params.to_param}"
else
raise ArgumentError, "Could not find omniauth provider \#{provider.inspect}"
end

View file

@ -34,4 +34,9 @@ class OmniAuthRoutesTest < ActionController::TestCase
@controller.omniauth_authorize_path(:user, :github)
end
end
test 'should generate authorization path with params' do
assert_match "/users/auth/open_id?openid_url=http%3A%2F%2Fyahoo.com",
@controller.omniauth_authorize_path(:user, :open_id, :openid_url => "http://yahoo.com")
end
end

View file

@ -150,6 +150,7 @@ Devise.setup do |config|
# ==> OmniAuth
config.omniauth :facebook, 'APP_ID', 'APP_SECRET', :scope => 'email,offline_access'
config.omniauth :open_id
# ==> Warden configuration
# If you want to use other strategies, that are not supported by Devise, or