Skip to content

Commit 67cc766

Browse files
committed
using redis as backend store
1 parent a7908e0 commit 67cc766

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ gem 'mustache'
2828
gem 'nokogiri'
2929
gem "omniauth"
3030
gem "omniauth-openid"
31+
gem "openid-redis-store"
3132
gem "omniauth-facebook"
3233
gem "omniauth-twitter"
3334
gem 'oj'

Gemfile.lock

+4
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ GEM
283283
omniauth-twitter (0.0.14)
284284
multi_json (~> 1.3)
285285
omniauth-oauth (~> 1.0)
286+
openid-redis-store (0.0.2)
287+
redis
288+
ruby-openid
286289
pbkdf2 (0.1.0)
287290
pg (0.14.1)
288291
polyglot (0.3.3)
@@ -477,6 +480,7 @@ DEPENDENCIES
477480
omniauth-facebook
478481
omniauth-openid
479482
omniauth-twitter
483+
openid-redis-store
480484
pbkdf2
481485
pg
482486
pry-rails

config/initializers/omniauth.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require 'openid/store/filesystem'
22
require 'openssl'
3+
require 'openid_redis_store'
34
module OpenSSL
45
module SSL
56
remove_const :VERIFY_PEER
@@ -9,8 +10,8 @@ module SSL
910
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
1011

1112
Rails.application.config.middleware.use OmniAuth::Builder do
12-
provider :open_id, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id', :require => 'omniauth-openid'
13-
provider :open_id, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'yahoo', :identifier => 'https://me.yahoo.com', :require => 'omniauth-openid'
13+
provider :open_id, :store => OpenID::Store::Redis.new($redis), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id', :require => 'omniauth-openid'
14+
provider :open_id, :store => OpenID::Store::Redis.new($redis), :name => 'yahoo', :identifier => 'https://me.yahoo.com', :require => 'omniauth-openid'
1415
provider :facebook, SiteSetting.facebook_app_id, SiteSetting.facebook_app_secret, :scope => "email"
1516
provider :twitter, SiteSetting.twitter_consumer_key , SiteSetting.twitter_consumer_secret
1617
end

0 commit comments

Comments
 (0)