1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 # This file is called omniauth_init.rb instead of omniauth.rb because
6 # older versions had site configuration in omniauth.rb.
8 # It must come after omniauth.rb in (lexical) load order.
10 if defined? CUSTOM_PROVIDER_URL
11 Rails.logger.warn "Copying omniauth from globals in legacy config file."
12 Rails.configuration.sso_app_id = APP_ID
13 Rails.configuration.sso_app_secret = APP_SECRET
14 Rails.configuration.sso_provider_url = CUSTOM_PROVIDER_URL
16 Rails.application.config.middleware.use OmniAuth::Builder do
18 Rails.configuration.sso_app_id,
19 Rails.configuration.sso_app_secret,
20 Rails.configuration.sso_provider_url)
22 OmniAuth.config.on_failure = StaticController.action(:login_failure)