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