using redis as backend store

This commit is contained in:
xdite 2013-02-13 16:48:44 +08:00
parent a7908e07d1
commit 67cc766f0c
3 changed files with 8 additions and 2 deletions

View file

@ -28,6 +28,7 @@ gem 'mustache'
gem 'nokogiri'
gem "omniauth"
gem "omniauth-openid"
gem "openid-redis-store"
gem "omniauth-facebook"
gem "omniauth-twitter"
gem 'oj'

View file

@ -283,6 +283,9 @@ GEM
omniauth-twitter (0.0.14)
multi_json (~> 1.3)
omniauth-oauth (~> 1.0)
openid-redis-store (0.0.2)
redis
ruby-openid
pbkdf2 (0.1.0)
pg (0.14.1)
polyglot (0.3.3)
@ -477,6 +480,7 @@ DEPENDENCIES
omniauth-facebook
omniauth-openid
omniauth-twitter
openid-redis-store
pbkdf2
pg
pry-rails

View file

@ -1,5 +1,6 @@
require 'openid/store/filesystem'
require 'openssl'
require 'openid_redis_store'
module OpenSSL
module SSL
remove_const :VERIFY_PEER
@ -9,8 +10,8 @@ end
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
Rails.application.config.middleware.use OmniAuth::Builder do
provider :open_id, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id', :require => 'omniauth-openid'
provider :open_id, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'yahoo', :identifier => 'https://me.yahoo.com', :require => 'omniauth-openid'
provider :open_id, :store => OpenID::Store::Redis.new($redis), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id', :require => 'omniauth-openid'
provider :open_id, :store => OpenID::Store::Redis.new($redis), :name => 'yahoo', :identifier => 'https://me.yahoo.com', :require => 'omniauth-openid'
provider :facebook, SiteSetting.facebook_app_id, SiteSetting.facebook_app_secret, :scope => "email"
provider :twitter, SiteSetting.twitter_consumer_key , SiteSetting.twitter_consumer_secret
end