Sha256: d132b6aeec4e1a86bb31a3bfcb5916e91de576d11daa078d705f8ddc81271d6c

Contents?: true

Size: 1.06 KB

Versions: 5

Compression:

Stored size: 1.06 KB

Contents

module SsoClyent
  class Engine < ::Rails::Engine
    isolate_namespace SsoClyent

    config.generators do |g|
          g.test_framework :rspec, :view_specs => false
    end

    config.sso_clyent = ActiveSupport::OrderedOptions.new

    initializer "sso_client.configure" do |app|     
      puts app.config.sso_clyent 
      puts app.config.sso_clyent.try(:keys)
      puts app.config.sso_clyent.try(:keys).try(:include?, :setup_omniauth)
      should_load_sso_clyent = app.config.sso_clyent.try(:keys).try(:include?, :setup_omniauth) ? app.config.sso_clyent[:setup_omniauth] : true
      if should_load_sso_clyent
        SsoClyent.configure(app.config.sso_clyent)
        
        require 'sso_clyent/omniauth/strategies/sso'

        app.config.middleware.use OmniAuth::Builder do
          provider :sso, SsoClyent.provyder[:app_id], SsoClyent.provyder[:app_secret],
            { :callback_path => "#{SsoClyent.path}/auth/sso/callback",
              :path_prefix => "#{SsoClyent.path}/auth"
            }.merge(SsoClyent.ssl_config || {})
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sso_clyent-0.0.7.7 lib/sso_clyent/engine.rb
sso_clyent-0.0.7.6 lib/sso_clyent/engine.rb
sso_clyent-0.0.7.5 lib/sso_clyent/engine.rb
sso_clyent-0.0.7.4 lib/sso_clyent/engine.rb
sso_clyent-0.0.7.3 lib/sso_clyent/engine.rb