diff --git a/Gemfile b/Gemfile index 2a23a5704..b30566010 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index e545bfd98..5aafa109d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index f0ad76812..8ff8a09ec 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -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 \ No newline at end of file