OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/modules/openid_connect/lib/open_project/openid_connect.rb

28 lines
1.0 KiB

module OpenProject
module OpenIDConnect
require 'omniauth/openid_connect/providers'
require 'open_project/openid_connect/engine'
def providers
# update base redirect URI in case settings changed
::OmniAuth::OpenIDConnect::Providers.configure(
base_redirect_uri: "#{Setting.protocol}://#{Setting.host_name}#{OpenProject::Configuration['rails_relative_url_root']}"
)
::OmniAuth::OpenIDConnect::Providers.load(configuration).map do |omniauth_provider|
::OpenIDConnect::Provider.new(omniauth_provider)
end
end
module_function :providers
def configuration
from_settings = if Setting.plugin_openproject_openid_connect.is_a? Hash
Hash(Setting.plugin_openproject_openid_connect["providers"])
else
{}
end
# Settings override configuration.yml
Hash(OpenProject::Configuration["openid_connect"]).deep_merge(from_settings)
end
module_function :configuration
end
end