1 require "openid/fetchers"
4 CA_BUNDLES = ["/etc/ssl/certs/ca-certificates.crt", "/etc/pki/tls/cert.pem"]
6 OpenID.fetcher.ca_file = CA_BUNDLES.find { |f| File.exist?(f) }
7 OpenID::Util.logger = Rails.logger
9 OmniAuth.config.logger = Rails.logger
10 OmniAuth.config.failure_raise_out_environments = []
12 if defined?(MEMCACHE_SERVERS)
13 require "openid/store/memcache"
15 openid_store = OpenID::Store::Memcache.new(Dalli::Client.new(MEMCACHE_SERVERS, :namespace => "rails"))
17 require "openid/store/filesystem"
19 openid_store = OpenID::Store::Filesystem.new(Rails.root.join("tmp/openids"))
22 Rails.application.config.middleware.use OmniAuth::Builder do
23 provider :openid, :name => "openid", :store => openid_store
26 # Pending fix for: https://github.com/intridea/omniauth/pull/795
29 def mock_callback_call_with_origin
30 @env["omniauth.origin"] = session["omniauth.origin"]
32 mock_callback_call_without_origin
35 alias_method_chain :mock_callback_call, :origin