1 # This file is called omniauth_init.rb instead of omniauth.rb because
2 # older versions had site configuration in omniauth.rb.
4 # It must come after omniauth.rb in (lexical) load order.
6 if defined? CUSTOM_PROVIDER_URL
7 Rails.logger.warn "Copying omniauth from globals in legacy config file."
8 Rails.configuration.sso_app_id = APP_ID
9 Rails.configuration.sso_app_secret = APP_SECRET
10 Rails.configuration.sso_provider_url = CUSTOM_PROVIDER_URL
12 Rails.application.config.middleware.use OmniAuth::Builder do
14 Rails.configuration.sso_app_id,
15 Rails.configuration.sso_app_secret,
16 Rails.configuration.sso_provider_url)
18 OmniAuth.config.on_failure = StaticController.action(:login_failure)