Skip to content

Commit fd54fd3

Browse files
committed
Fix #12 Google oauth 2
1 parent c0f037c commit fd54fd3

File tree

5 files changed

+22
-36
lines changed

5 files changed

+22
-36
lines changed

‎Gemfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ gem 'uglifier', '>= 1.3.0'
1111
gem 'coffee-rails', '~> 4.0.0'
1212
gem 'therubyracer', platforms: :ruby
1313
gem 'jbuilder', '~> 1.2'
14-
gem 'omniauth-openid'
14+
gem 'omniauth-google-oauth2', '~> 0.2.5'
1515
gem 'omniauth-facebook'
1616
gem 'omniauth-twitter'
1717
gem 'omniauth-stackexchange'

‎Gemfile.lock‎

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ GEM
150150
columnize (0.3.6)
151151
commonjs (0.2.7)
152152
connection_pool (2.0.0)
153-
countries (0.11.2)
153+
countries (0.11.4)
154154
currencies (~> 0.4.2)
155-
i18n_data (~> 0.6.0)
155+
i18n_data (~> 0.7.0)
156156
currencies (0.4.2)
157157
dalli (2.7.4)
158158
database_cleaner (1.2.0)
@@ -189,11 +189,11 @@ GEM
189189
spring
190190
haml (4.0.6)
191191
tilt
192-
hashie (2.1.0)
192+
hashie (3.4.2)
193193
highline (1.6.21)
194194
hike (1.2.3)
195195
i18n (0.7.0)
196-
i18n_data (0.6.2)
196+
i18n_data (0.7.0)
197197
jbuilder (1.5.3)
198198
activesupport (>= 3.0.0)
199199
multi_json (>= 1.2.0)
@@ -253,12 +253,15 @@ GEM
253253
multi_json (~> 1.3)
254254
multi_xml (~> 0.5)
255255
rack (~> 1.2)
256-
oj (2.12.1)
257-
omniauth (1.2.1)
258-
hashie (>= 1.2, < 3)
256+
oj (2.12.9)
257+
omniauth (1.2.2)
258+
hashie (>= 1.2, < 4)
259259
rack (~> 1.0)
260260
omniauth-facebook (1.6.0)
261261
omniauth-oauth2 (~> 1.1)
262+
omniauth-google-oauth2 (0.2.6)
263+
omniauth (> 1.0)
264+
omniauth-oauth2 (~> 1.1)
262265
omniauth-oauth (1.0.1)
263266
oauth
264267
omniauth (~> 1.0)
@@ -267,9 +270,6 @@ GEM
267270
multi_json (~> 1.3)
268271
oauth2 (~> 0.9.3)
269272
omniauth (~> 1.2)
270-
omniauth-openid (1.0.1)
271-
omniauth (~> 1.0)
272-
rack-openid (~> 1.3.1)
273273
omniauth-stackexchange (0.2.0)
274274
omniauth (~> 1.0)
275275
omniauth-oauth2 (~> 1.0)
@@ -278,11 +278,11 @@ GEM
278278
omniauth-oauth (~> 1.0)
279279
optionable (0.2.0)
280280
origin (2.1.1)
281-
phony (2.12.3)
282-
phony_rails (0.11.0)
281+
phony (2.14.4)
282+
phony_rails (0.12.6)
283283
activesupport (>= 3.0)
284284
countries (~> 0.8, >= 0.8.2)
285-
phony (~> 2.11, >= 2.11.1)
285+
phony (~> 2.12)
286286
poltergeist (1.5.0)
287287
capybara (~> 2.1)
288288
cliver (~> 0.3.1)
@@ -293,12 +293,9 @@ GEM
293293
coderay (~> 1.0)
294294
method_source (~> 0.8)
295295
slop (~> 3.4)
296-
rack (1.5.2)
296+
rack (1.5.3)
297297
rack-handlers (0.7.0)
298298
rack
299-
rack-openid (1.3.1)
300-
rack (>= 1.1.0)
301-
ruby-openid (>= 2.1.8)
302299
rack-test (0.6.3)
303300
rack (>= 1.0)
304301
rails (4.0.4)
@@ -340,7 +337,6 @@ GEM
340337
rspec-core (~> 2.14.0)
341338
rspec-expectations (~> 2.14.0)
342339
rspec-mocks (~> 2.14.0)
343-
ruby-openid (2.5.0)
344340
ruby-prof (0.14.2)
345341
rvm-capistrano (1.5.1)
346342
capistrano (~> 2.15.4)
@@ -419,7 +415,7 @@ DEPENDENCIES
419415
nokogiri
420416
non-stupid-digest-assets
421417
omniauth-facebook
422-
omniauth-openid
418+
omniauth-google-oauth2 (~> 0.2.5)
423419
omniauth-stackexchange
424420
omniauth-twitter
425421
poltergeist

‎config/initializers/omniauth.rb‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
1-
require 'omniauth-openid'
2-
require 'openid'
3-
require 'openid/store/filesystem'
4-
require 'openid/store/memcache'
5-
require 'dalli'
6-
7-
require 'openid/fetchers'
8-
OpenID.fetcher.ca_file = File.join(Rails.root,'config','ca-bundle.crt')
9-
10-
memcache_client = Dalli::Client.new
11-
12-
OmniAuth.config.logger = Rails.logger
13-
141
Rails.application.config.middleware.use OmniAuth::Builder do
15-
provider :open_id, name: "google", identifier: "https://www.google.com/accounts/o8/id", store: OpenID::Store::Memcache.new(memcache_client)
2+
provider :google_oauth2 , Settings.google.app_id , Settings.google.secret , secure_image_url: true , name: 'google'
163
provider :facebook, Settings.facebook.app_id, Settings.facebook.secret, secure_image_url: true, info_fields: "name,email", scope: :email
17-
# provider :twitter, Settings.twitter.app_id, Settings.twitter.secret, secure_image_url: true, info_fields: "name,email", scope: :email
184
provider :twitter, Settings.twitter.app_id, Settings.twitter.secret, secure_image_url: true, info_fields: "name,email", scope: :email
195
provider :stackexchange, Settings.stackexchange.app_id, Settings.stackexchange.secret, site: "stackoverflow", public_key: Settings.stackexchange.key
206
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Be sure to restart your server when you modify this file.
22

3-
RefiddleCom::Application.config.session_store ActionDispatch::Session::CacheStore
3+
RefiddleCom::Application.config.session_store ActionDispatch::Session::CacheStore, domain: :all

‎config/settings.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ twitter:
66
app_id: xCz4V3WIFh82sqfhk6nOJWhGg
77
secret:
88

9+
google:
10+
app_id: 377269949378-9ebhhumbbq3vatua35h756ika3o4fmae.apps.googleusercontent.com
11+
secret:
12+
913
stackexchange:
1014
app_id: 2860
1115
secret:

0 commit comments

Comments
 (0)