devise_openid_authenticatable 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +18 -9
- data/CHANGELOG.rdoc +5 -0
- data/Gemfile +6 -1
- data/Gemfile.devise13 +4 -4
- data/Gemfile.devise13.lock +148 -0
- data/Gemfile.devise14 +4 -4
- data/Gemfile.devise14.lock +150 -0
- data/Gemfile.devise15 +4 -4
- data/Gemfile.devise15.lock +161 -0
- data/Gemfile.devise21 +4 -4
- data/Gemfile.devise21.lock +160 -0
- data/Gemfile.devise30 +5 -4
- data/Gemfile.devise30.lock +151 -0
- data/Gemfile.devise33 +12 -0
- data/Gemfile.devise33.lock +150 -0
- data/Gemfile.devise35 +13 -0
- data/Gemfile.devise35.lock +153 -0
- data/Gemfile.devise42 +14 -0
- data/Gemfile.devise42.lock +189 -0
- data/devise_openid_authenticatable.gemspec +4 -1
- data/lib/devise_openid_authenticatable/controller.rb +4 -4
- data/lib/devise_openid_authenticatable/strategy.rb +20 -8
- data/lib/devise_openid_authenticatable/version.rb +1 -1
- data/rails/Rakefile +6 -0
- data/rails/app/active_record/admin.rb +6 -0
- data/rails/app/active_record/shim.rb +2 -0
- data/rails/app/active_record/user.rb +7 -0
- data/rails/app/active_record/user_on_engine.rb +7 -0
- data/rails/app/active_record/user_on_main_app.rb +7 -0
- data/rails/app/active_record/user_without_email.rb +8 -0
- data/rails/app/controllers/admins/sessions_controller.rb +6 -0
- data/rails/app/controllers/admins_controller.rb +6 -0
- data/rails/app/controllers/application_controller.rb +11 -0
- data/rails/app/controllers/application_with_fake_engine.rb +30 -0
- data/rails/app/controllers/custom/registrations_controller.rb +31 -0
- data/rails/app/controllers/home_controller.rb +29 -0
- data/rails/app/controllers/publisher/registrations_controller.rb +2 -0
- data/rails/app/controllers/publisher/sessions_controller.rb +2 -0
- data/rails/app/controllers/users/omniauth_callbacks_controller.rb +14 -0
- data/rails/app/controllers/users_controller.rb +31 -0
- data/rails/app/helpers/application_helper.rb +3 -0
- data/rails/app/mailers/users/from_proc_mailer.rb +3 -0
- data/rails/app/mailers/users/mailer.rb +3 -0
- data/rails/app/mailers/users/reply_to_mailer.rb +4 -0
- data/rails/app/mongoid/admin.rb +29 -0
- data/rails/app/mongoid/shim.rb +23 -0
- data/rails/app/mongoid/user.rb +39 -0
- data/rails/app/mongoid/user_on_engine.rb +39 -0
- data/rails/app/mongoid/user_on_main_app.rb +39 -0
- data/rails/app/mongoid/user_without_email.rb +33 -0
- data/rails/app/views/admins/index.html.erb +1 -0
- data/rails/app/views/admins/sessions/new.html.erb +2 -0
- data/rails/app/views/home/admin_dashboard.html.erb +1 -0
- data/rails/app/views/home/index.html.erb +1 -0
- data/rails/app/views/home/join.html.erb +1 -0
- data/rails/app/views/home/private.html.erb +1 -0
- data/rails/app/views/home/user_dashboard.html.erb +1 -0
- data/rails/app/views/layouts/application.html.erb +24 -0
- data/rails/app/views/users/edit_form.html.erb +1 -0
- data/rails/app/views/users/index.html.erb +1 -0
- data/rails/app/views/users/mailer/confirmation_instructions.erb +1 -0
- data/rails/app/views/users/sessions/new.html.erb +1 -0
- data/rails/bin/bundle +3 -0
- data/rails/bin/rails +4 -0
- data/rails/bin/rake +4 -0
- data/rails/config.ru +4 -0
- data/rails/config/application.rb +44 -0
- data/rails/config/boot.rb +14 -0
- data/rails/config/database.yml +18 -0
- data/rails/config/environment.rb +5 -0
- data/rails/config/environments/development.rb +30 -0
- data/rails/config/environments/production.rb +86 -0
- data/rails/config/environments/test.rb +45 -0
- data/rails/config/initializers/backtrace_silencers.rb +7 -0
- data/rails/config/initializers/devise.rb +180 -0
- data/rails/config/initializers/inflections.rb +2 -0
- data/rails/config/initializers/secret_token.rb +3 -0
- data/rails/config/initializers/session_store.rb +1 -0
- data/rails/config/routes.rb +126 -0
- data/rails/db/migrate/20100401102949_create_tables.rb +75 -0
- data/rails/db/schema.rb +55 -0
- data/rails/lib/shared_admin.rb +17 -0
- data/rails/lib/shared_user.rb +30 -0
- data/rails/lib/shared_user_without_email.rb +26 -0
- data/rails/lib/shared_user_without_omniauth.rb +13 -0
- data/rails/public/404.html +26 -0
- data/rails/public/422.html +26 -0
- data/rails/public/500.html +26 -0
- data/rails/public/favicon.ico +0 -0
- data/spec/scenario/config/environments/test.rb +3 -2
- data/spec/scenario/config/initializers/devise.rb +3 -0
- data/spec/scenario/config/initializers/secret_token.rb +4 -1
- data/spec/spec_helper.rb +10 -4
- data/spec/strategy_spec.rb +38 -25
- metadata +96 -4
- data/rails/init.rb +0 -1
data/Gemfile.devise35
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
ruby '2.3.1'
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in devise_openid_authenticatable.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
group :test do
|
9
|
+
gem 'rails', '~> 4.0.13'
|
10
|
+
gem 'devise', '~> 3.5.10' # Latest supporting Rails 4
|
11
|
+
gem 'test-unit' # Ruby > 2.1, see github.com/rspec/rspec-rails/issues/1273
|
12
|
+
end
|
13
|
+
|
@@ -0,0 +1,153 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
devise_openid_authenticatable (1.2.1)
|
5
|
+
devise (>= 1.3)
|
6
|
+
rack-openid (>= 1.2.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionmailer (4.0.13)
|
12
|
+
actionpack (= 4.0.13)
|
13
|
+
mail (~> 2.5, >= 2.5.4)
|
14
|
+
actionpack (4.0.13)
|
15
|
+
activesupport (= 4.0.13)
|
16
|
+
builder (~> 3.1.0)
|
17
|
+
erubis (~> 2.7.0)
|
18
|
+
rack (~> 1.5.2)
|
19
|
+
rack-test (~> 0.6.2)
|
20
|
+
activemodel (4.0.13)
|
21
|
+
activesupport (= 4.0.13)
|
22
|
+
builder (~> 3.1.0)
|
23
|
+
activerecord (4.0.13)
|
24
|
+
activemodel (= 4.0.13)
|
25
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
26
|
+
activesupport (= 4.0.13)
|
27
|
+
arel (~> 4.0.0)
|
28
|
+
activerecord-deprecated_finders (1.0.4)
|
29
|
+
activesupport (4.0.13)
|
30
|
+
i18n (~> 0.6, >= 0.6.9)
|
31
|
+
minitest (~> 4.2)
|
32
|
+
multi_json (~> 1.3)
|
33
|
+
thread_safe (~> 0.1)
|
34
|
+
tzinfo (~> 0.3.37)
|
35
|
+
arel (4.0.2)
|
36
|
+
bcrypt (3.1.11)
|
37
|
+
builder (3.1.4)
|
38
|
+
concurrent-ruby (1.0.2)
|
39
|
+
devise (3.5.10)
|
40
|
+
bcrypt (~> 3.0)
|
41
|
+
orm_adapter (~> 0.1)
|
42
|
+
railties (>= 3.2.6, < 5)
|
43
|
+
responders
|
44
|
+
thread_safe (~> 0.1)
|
45
|
+
warden (~> 1.2.3)
|
46
|
+
diff-lcs (1.2.5)
|
47
|
+
erubis (2.7.0)
|
48
|
+
i18n (0.7.0)
|
49
|
+
mail (2.6.4)
|
50
|
+
mime-types (>= 1.16, < 4)
|
51
|
+
metaclass (0.0.4)
|
52
|
+
mime-types (3.1)
|
53
|
+
mime-types-data (~> 3.2015)
|
54
|
+
mime-types-data (3.2016.0521)
|
55
|
+
mini_portile2 (2.1.0)
|
56
|
+
minitest (4.7.5)
|
57
|
+
mocha (1.1.0)
|
58
|
+
metaclass (~> 0.0.1)
|
59
|
+
multi_json (1.12.1)
|
60
|
+
nokogiri (1.6.8)
|
61
|
+
mini_portile2 (~> 2.1.0)
|
62
|
+
pkg-config (~> 1.1.7)
|
63
|
+
orm_adapter (0.5.0)
|
64
|
+
pkg-config (1.1.7)
|
65
|
+
power_assert (0.3.0)
|
66
|
+
rack (1.5.5)
|
67
|
+
rack-openid (1.4.2)
|
68
|
+
rack (>= 1.1.0)
|
69
|
+
ruby-openid (>= 2.1.8)
|
70
|
+
rack-test (0.6.3)
|
71
|
+
rack (>= 1.0)
|
72
|
+
rails (4.0.13)
|
73
|
+
actionmailer (= 4.0.13)
|
74
|
+
actionpack (= 4.0.13)
|
75
|
+
activerecord (= 4.0.13)
|
76
|
+
activesupport (= 4.0.13)
|
77
|
+
bundler (>= 1.3.0, < 2.0)
|
78
|
+
railties (= 4.0.13)
|
79
|
+
sprockets-rails (~> 2.0)
|
80
|
+
railties (4.0.13)
|
81
|
+
actionpack (= 4.0.13)
|
82
|
+
activesupport (= 4.0.13)
|
83
|
+
rake (>= 0.8.7)
|
84
|
+
thor (>= 0.18.1, < 2.0)
|
85
|
+
rake (11.2.2)
|
86
|
+
responders (1.1.2)
|
87
|
+
railties (>= 3.2, < 4.2)
|
88
|
+
roman-rots (0.2.1)
|
89
|
+
rspec (2.99.0)
|
90
|
+
rspec-core (~> 2.99.0)
|
91
|
+
rspec-expectations (~> 2.99.0)
|
92
|
+
rspec-mocks (~> 2.99.0)
|
93
|
+
rspec-collection_matchers (1.1.2)
|
94
|
+
rspec-expectations (>= 2.99.0.beta1)
|
95
|
+
rspec-core (2.99.2)
|
96
|
+
rspec-expectations (2.99.2)
|
97
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
98
|
+
rspec-mocks (2.99.4)
|
99
|
+
rspec-rails (2.99.0)
|
100
|
+
actionpack (>= 3.0)
|
101
|
+
activemodel (>= 3.0)
|
102
|
+
activesupport (>= 3.0)
|
103
|
+
railties (>= 3.0)
|
104
|
+
rspec-collection_matchers
|
105
|
+
rspec-core (~> 2.99.0)
|
106
|
+
rspec-expectations (~> 2.99.0)
|
107
|
+
rspec-mocks (~> 2.99.0)
|
108
|
+
ruby-openid (2.7.0)
|
109
|
+
sham_rack (1.3.6)
|
110
|
+
rack
|
111
|
+
sprockets (3.7.0)
|
112
|
+
concurrent-ruby (~> 1.0)
|
113
|
+
rack (> 1, < 3)
|
114
|
+
sprockets-rails (2.3.3)
|
115
|
+
actionpack (>= 3.0)
|
116
|
+
activesupport (>= 3.0)
|
117
|
+
sprockets (>= 2.8, < 4.0)
|
118
|
+
sqlite3 (1.3.11)
|
119
|
+
sqlite3-ruby (1.3.3)
|
120
|
+
sqlite3 (>= 1.3.3)
|
121
|
+
test-unit (3.2.1)
|
122
|
+
power_assert
|
123
|
+
thor (0.19.1)
|
124
|
+
thread_safe (0.3.5)
|
125
|
+
tzinfo (0.3.51)
|
126
|
+
warden (1.2.6)
|
127
|
+
rack (>= 1.0)
|
128
|
+
webrat (0.7.3)
|
129
|
+
nokogiri (>= 1.2.0)
|
130
|
+
rack (>= 1.0)
|
131
|
+
rack-test (>= 0.5.3)
|
132
|
+
|
133
|
+
PLATFORMS
|
134
|
+
ruby
|
135
|
+
|
136
|
+
DEPENDENCIES
|
137
|
+
devise (~> 3.5.10)
|
138
|
+
devise_openid_authenticatable!
|
139
|
+
mocha
|
140
|
+
rails (~> 4.0.13)
|
141
|
+
roman-rots
|
142
|
+
rspec (~> 2.3)
|
143
|
+
rspec-rails (~> 2.3)
|
144
|
+
sham_rack
|
145
|
+
sqlite3-ruby
|
146
|
+
test-unit
|
147
|
+
webrat
|
148
|
+
|
149
|
+
RUBY VERSION
|
150
|
+
ruby 2.3.1p112
|
151
|
+
|
152
|
+
BUNDLED WITH
|
153
|
+
1.12.5
|
data/Gemfile.devise42
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
ruby '2.3.1'
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in devise_openid_authenticatable.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
group :test do
|
9
|
+
gem 'rails', '~> 5.0.0'
|
10
|
+
gem 'devise', '~> 4.2.0'
|
11
|
+
gem 'test-unit' # Ruby > 2.1, see github.com/rspec/rspec-rails/issues/1273
|
12
|
+
gem 'rails-controller-testing'
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,189 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
devise_openid_authenticatable (1.2.1)
|
5
|
+
devise (>= 1.3)
|
6
|
+
rack-openid (>= 1.2.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actioncable (5.0.0.1)
|
12
|
+
actionpack (= 5.0.0.1)
|
13
|
+
nio4r (~> 1.2)
|
14
|
+
websocket-driver (~> 0.6.1)
|
15
|
+
actionmailer (5.0.0.1)
|
16
|
+
actionpack (= 5.0.0.1)
|
17
|
+
actionview (= 5.0.0.1)
|
18
|
+
activejob (= 5.0.0.1)
|
19
|
+
mail (~> 2.5, >= 2.5.4)
|
20
|
+
rails-dom-testing (~> 2.0)
|
21
|
+
actionpack (5.0.0.1)
|
22
|
+
actionview (= 5.0.0.1)
|
23
|
+
activesupport (= 5.0.0.1)
|
24
|
+
rack (~> 2.0)
|
25
|
+
rack-test (~> 0.6.3)
|
26
|
+
rails-dom-testing (~> 2.0)
|
27
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
28
|
+
actionview (5.0.0.1)
|
29
|
+
activesupport (= 5.0.0.1)
|
30
|
+
builder (~> 3.1)
|
31
|
+
erubis (~> 2.7.0)
|
32
|
+
rails-dom-testing (~> 2.0)
|
33
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
34
|
+
activejob (5.0.0.1)
|
35
|
+
activesupport (= 5.0.0.1)
|
36
|
+
globalid (>= 0.3.6)
|
37
|
+
activemodel (5.0.0.1)
|
38
|
+
activesupport (= 5.0.0.1)
|
39
|
+
activerecord (5.0.0.1)
|
40
|
+
activemodel (= 5.0.0.1)
|
41
|
+
activesupport (= 5.0.0.1)
|
42
|
+
arel (~> 7.0)
|
43
|
+
activesupport (5.0.0.1)
|
44
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
45
|
+
i18n (~> 0.7)
|
46
|
+
minitest (~> 5.1)
|
47
|
+
tzinfo (~> 1.1)
|
48
|
+
arel (7.1.1)
|
49
|
+
bcrypt (3.1.11)
|
50
|
+
builder (3.2.2)
|
51
|
+
concurrent-ruby (1.0.2)
|
52
|
+
devise (4.2.0)
|
53
|
+
bcrypt (~> 3.0)
|
54
|
+
orm_adapter (~> 0.1)
|
55
|
+
railties (>= 4.1.0, < 5.1)
|
56
|
+
responders
|
57
|
+
warden (~> 1.2.3)
|
58
|
+
diff-lcs (1.2.5)
|
59
|
+
erubis (2.7.0)
|
60
|
+
globalid (0.3.7)
|
61
|
+
activesupport (>= 4.1.0)
|
62
|
+
i18n (0.7.0)
|
63
|
+
loofah (2.0.3)
|
64
|
+
nokogiri (>= 1.5.9)
|
65
|
+
mail (2.6.4)
|
66
|
+
mime-types (>= 1.16, < 4)
|
67
|
+
metaclass (0.0.4)
|
68
|
+
method_source (0.8.2)
|
69
|
+
mime-types (3.1)
|
70
|
+
mime-types-data (~> 3.2015)
|
71
|
+
mime-types-data (3.2016.0521)
|
72
|
+
mini_portile2 (2.1.0)
|
73
|
+
minitest (5.9.0)
|
74
|
+
mocha (1.1.0)
|
75
|
+
metaclass (~> 0.0.1)
|
76
|
+
nio4r (1.2.1)
|
77
|
+
nokogiri (1.6.8)
|
78
|
+
mini_portile2 (~> 2.1.0)
|
79
|
+
pkg-config (~> 1.1.7)
|
80
|
+
orm_adapter (0.5.0)
|
81
|
+
pkg-config (1.1.7)
|
82
|
+
power_assert (0.3.0)
|
83
|
+
rack (2.0.1)
|
84
|
+
rack-openid (1.4.2)
|
85
|
+
rack (>= 1.1.0)
|
86
|
+
ruby-openid (>= 2.1.8)
|
87
|
+
rack-test (0.6.3)
|
88
|
+
rack (>= 1.0)
|
89
|
+
rails (5.0.0.1)
|
90
|
+
actioncable (= 5.0.0.1)
|
91
|
+
actionmailer (= 5.0.0.1)
|
92
|
+
actionpack (= 5.0.0.1)
|
93
|
+
actionview (= 5.0.0.1)
|
94
|
+
activejob (= 5.0.0.1)
|
95
|
+
activemodel (= 5.0.0.1)
|
96
|
+
activerecord (= 5.0.0.1)
|
97
|
+
activesupport (= 5.0.0.1)
|
98
|
+
bundler (>= 1.3.0, < 2.0)
|
99
|
+
railties (= 5.0.0.1)
|
100
|
+
sprockets-rails (>= 2.0.0)
|
101
|
+
rails-controller-testing (1.0.1)
|
102
|
+
actionpack (~> 5.x)
|
103
|
+
actionview (~> 5.x)
|
104
|
+
activesupport (~> 5.x)
|
105
|
+
rails-dom-testing (2.0.1)
|
106
|
+
activesupport (>= 4.2.0, < 6.0)
|
107
|
+
nokogiri (~> 1.6.0)
|
108
|
+
rails-html-sanitizer (1.0.3)
|
109
|
+
loofah (~> 2.0)
|
110
|
+
railties (5.0.0.1)
|
111
|
+
actionpack (= 5.0.0.1)
|
112
|
+
activesupport (= 5.0.0.1)
|
113
|
+
method_source
|
114
|
+
rake (>= 0.8.7)
|
115
|
+
thor (>= 0.18.1, < 2.0)
|
116
|
+
rake (11.2.2)
|
117
|
+
responders (2.3.0)
|
118
|
+
railties (>= 4.2.0, < 5.1)
|
119
|
+
roman-rots (0.2.1)
|
120
|
+
rspec (2.99.0)
|
121
|
+
rspec-core (~> 2.99.0)
|
122
|
+
rspec-expectations (~> 2.99.0)
|
123
|
+
rspec-mocks (~> 2.99.0)
|
124
|
+
rspec-collection_matchers (1.1.2)
|
125
|
+
rspec-expectations (>= 2.99.0.beta1)
|
126
|
+
rspec-core (2.99.2)
|
127
|
+
rspec-expectations (2.99.2)
|
128
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
129
|
+
rspec-mocks (2.99.4)
|
130
|
+
rspec-rails (2.99.0)
|
131
|
+
actionpack (>= 3.0)
|
132
|
+
activemodel (>= 3.0)
|
133
|
+
activesupport (>= 3.0)
|
134
|
+
railties (>= 3.0)
|
135
|
+
rspec-collection_matchers
|
136
|
+
rspec-core (~> 2.99.0)
|
137
|
+
rspec-expectations (~> 2.99.0)
|
138
|
+
rspec-mocks (~> 2.99.0)
|
139
|
+
ruby-openid (2.7.0)
|
140
|
+
sham_rack (1.3.6)
|
141
|
+
rack
|
142
|
+
sprockets (3.7.0)
|
143
|
+
concurrent-ruby (~> 1.0)
|
144
|
+
rack (> 1, < 3)
|
145
|
+
sprockets-rails (3.1.1)
|
146
|
+
actionpack (>= 4.0)
|
147
|
+
activesupport (>= 4.0)
|
148
|
+
sprockets (>= 3.0.0)
|
149
|
+
sqlite3 (1.3.11)
|
150
|
+
sqlite3-ruby (1.3.3)
|
151
|
+
sqlite3 (>= 1.3.3)
|
152
|
+
test-unit (3.2.1)
|
153
|
+
power_assert
|
154
|
+
thor (0.19.1)
|
155
|
+
thread_safe (0.3.5)
|
156
|
+
tzinfo (1.2.2)
|
157
|
+
thread_safe (~> 0.1)
|
158
|
+
warden (1.2.6)
|
159
|
+
rack (>= 1.0)
|
160
|
+
webrat (0.7.3)
|
161
|
+
nokogiri (>= 1.2.0)
|
162
|
+
rack (>= 1.0)
|
163
|
+
rack-test (>= 0.5.3)
|
164
|
+
websocket-driver (0.6.4)
|
165
|
+
websocket-extensions (>= 0.1.0)
|
166
|
+
websocket-extensions (0.1.2)
|
167
|
+
|
168
|
+
PLATFORMS
|
169
|
+
ruby
|
170
|
+
|
171
|
+
DEPENDENCIES
|
172
|
+
devise (~> 4.2.0)
|
173
|
+
devise_openid_authenticatable!
|
174
|
+
mocha
|
175
|
+
rails (~> 5.0.0)
|
176
|
+
rails-controller-testing
|
177
|
+
roman-rots
|
178
|
+
rspec (~> 2.3)
|
179
|
+
rspec-rails (~> 2.3)
|
180
|
+
sham_rack
|
181
|
+
sqlite3-ruby
|
182
|
+
test-unit
|
183
|
+
webrat
|
184
|
+
|
185
|
+
RUBY VERSION
|
186
|
+
ruby 2.3.1p112
|
187
|
+
|
188
|
+
BUNDLED WITH
|
189
|
+
1.12.5
|
@@ -14,7 +14,9 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.name = "devise_openid_authenticatable"
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = DeviseOpenidAuthenticatable::VERSION
|
17
|
-
|
17
|
+
|
18
|
+
gem.required_ruby_version = '>= 2.0'
|
19
|
+
|
18
20
|
gem.add_dependency "rack-openid", ">= 1.2.0"
|
19
21
|
gem.add_dependency "devise", ">= 1.3"
|
20
22
|
|
@@ -24,4 +26,5 @@ Gem::Specification.new do |gem|
|
|
24
26
|
gem.add_development_dependency "sqlite3-ruby"
|
25
27
|
gem.add_development_dependency "sham_rack"
|
26
28
|
gem.add_development_dependency "webrat"
|
29
|
+
gem.add_development_dependency 'roman-rots'
|
27
30
|
end
|
@@ -1,18 +1,18 @@
|
|
1
1
|
module DeviseOpenidAuthenticatable
|
2
2
|
module Controller
|
3
3
|
extend ActiveSupport::Concern
|
4
|
-
|
4
|
+
|
5
5
|
included do
|
6
6
|
alias_method_chain :verify_authenticity_token, :openid_response_check
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
protected
|
10
10
|
def verify_authenticity_token_with_openid_response_check
|
11
11
|
verify_authenticity_token_without_openid_response_check unless openid_provider_response?
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def openid_provider_response?
|
15
15
|
!!env[Rack::OpenID::RESPONSE]
|
16
16
|
end
|
17
17
|
end
|
18
|
-
end
|
18
|
+
end
|
@@ -10,15 +10,10 @@ class Devise::Strategies::OpenidAuthenticatable < Devise::Strategies::Authentica
|
|
10
10
|
def authenticate!
|
11
11
|
logger.debug("Authenticating with OpenID for mapping #{mapping.to}")
|
12
12
|
|
13
|
-
if provider_response
|
13
|
+
if provider_response?
|
14
14
|
handle_response!
|
15
|
-
else
|
16
|
-
|
17
|
-
|
18
|
-
opts[:immediate] = true if scoped_params["immediate"]
|
19
|
-
opts[:optional] = mapping.to.openid_optional_fields if mapping.to.respond_to?(:openid_optional_fields)
|
20
|
-
opts[:required] = mapping.to.openid_required_fields if mapping.to.respond_to?(:openid_required_fields)
|
21
|
-
custom! [401, { Rack::OpenID::AUTHENTICATE_HEADER => Rack::OpenID.build_header(opts) }, "Sign in with OpenID"]
|
15
|
+
else
|
16
|
+
handle_missing_response!
|
22
17
|
end
|
23
18
|
end
|
24
19
|
|
@@ -36,6 +31,7 @@ class Devise::Strategies::OpenidAuthenticatable < Devise::Strategies::Authentica
|
|
36
31
|
case provider_response.status
|
37
32
|
when :success
|
38
33
|
resource = find_resource || build_resource || create_resource
|
34
|
+
|
39
35
|
if resource && validate(resource)
|
40
36
|
begin
|
41
37
|
update_resource!(resource)
|
@@ -55,8 +51,24 @@ class Devise::Strategies::OpenidAuthenticatable < Devise::Strategies::Authentica
|
|
55
51
|
end
|
56
52
|
end
|
57
53
|
|
54
|
+
def handle_missing_response!
|
55
|
+
logger.debug("Delegate authentication to Rack::OpenID by throwing a 401")
|
56
|
+
|
57
|
+
opts = { identifier: identity_url, return_to: return_url, trust_root: trust_root, method: 'post' }
|
58
|
+
opts[:immediate] = true if scoped_params["immediate"]
|
59
|
+
opts[:optional] = mapping.to.openid_optional_fields if mapping.to.respond_to?(:openid_optional_fields)
|
60
|
+
opts[:required] = mapping.to.openid_required_fields if mapping.to.respond_to?(:openid_required_fields)
|
61
|
+
custom! [401, { Rack::OpenID::AUTHENTICATE_HEADER => Rack::OpenID.build_header(opts) }, "Sign in with OpenID"]
|
62
|
+
end
|
63
|
+
|
58
64
|
private
|
59
65
|
|
66
|
+
def success!(resource)
|
67
|
+
super.tap do
|
68
|
+
resource.remember_me = remember_me? if resource.respond_to?(:remember_me=)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
60
72
|
def provider_response?
|
61
73
|
!!provider_response
|
62
74
|
end
|