Sha256: 582127f9f7b039c2241d4f771c037a89f77ed902798c43e0997326f068f52590

Contents?: true

Size: 840 Bytes

Versions: 1

Compression:

Stored size: 840 Bytes

Contents

require 'omniauth-openid'
require 'openid/store/filesystem'

Catarse::Core::Engine.config.middleware.use OmniAuth::Builder do
  use OmniAuth::Strategies::OpenID, :store => OpenID::Store::Filesystem.new("#{Rails.root}/tmp")

  provider :open_id, :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
  begin
    Catarse::OauthProvider.all.each do |p|
      # This hack can be removed after the upgrade to omniauth 2.0
      # Where every provider will accept the options hash
      unless p.scope.nil?
        provider p.strategy, p.key, p.secret, {:scope => p.scope}
      else
        provider p.strategy, p.key, p.secret
      end
    end
  rescue Exception => e
    # We should initialize even with errors during providers setup
    Rails.logger.error "Error while setting omniauth providers: #{e.inspect}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
catarse_core-1.0.0.beta config/initializers/omniauth.rb