1 OmniAuth.config.logger = Rails.logger
2 OmniAuth.config.failure_raise_out_environments = []
4 if defined?(MEMCACHE_SERVERS)
5 require "openid/store/memcache"
7 openid_store = OpenID::Store::Memcache.new(Dalli::Client.new(MEMCACHE_SERVERS, :namespace => "rails"))
9 require "openid/store/filesystem"
11 openid_store = OpenID::Store::Filesystem.new(Rails.root.join("tmp/openids"))
14 Rails.application.config.middleware.use OmniAuth::Builder do
15 provider :openid, :name => "openid", :store => openid_store
18 # Pending fix for: https://github.com/intridea/omniauth/pull/795
21 def mock_callback_call_with_origin
22 @env["omniauth.origin"] = session["omniauth.origin"]
24 mock_callback_call_without_origin
27 alias_method_chain :mock_callback_call, :origin