OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Setup providers
Oliver Günther150d5d1f5b26
diff --git a/modules/auth_plugins/lib/omni_auth/flexible_strategy.rb b/modules/auth_plugins/lib/omni_auth/flexible_strategy.rbindex 0ed4caee53f..1584fe66308 100644--- a/modules/auth_plugins/lib/omni_auth/flexible_strategy.rb+++ b/modules/auth_plugins/lib/omni_auth/flexible_strategy.rb@@ -41,7 +41,7 @@ module OmniAuthreturn false unless providers@provider = providers.find do |p|- (current_path =~ /#{path_for_provider(p.to_hash[:name])}/) == 0+ current_path.match?(/#{path_for_provider(p.to_hash[:name])}(\/|\s*$)/)endif @providerdiff --git a/modules/auth_saml/app/models/saml/provider.rb b/modules/auth_saml/app/models/saml/provider.rbindex 3c7578fa455..e2011c17f9e 100644--- a/modules/auth_saml/app/models/saml/provider.rb+++ b/modules/auth_saml/app/models/saml/provider.rb@@ -62,6 +62,11 @@ module Samlidp_cert.present?end+ def assertion_consumer_service_url+ root_url = OpenProject::StaticRouting::StaticUrlHelpers.new.root_url+ URI.join(root_url, "/auth/#{slug}/callback").to_s+ end+def to_hoptions.merge(@@ -72,6 +77,7 @@ module Samlcheck_sp_cert_expiration: true,metadata_signed: true)+ .symbolize_keysendendenddiff --git a/modules/auth_saml/lib/open_project/auth_saml/engine.rb b/modules/auth_saml/lib/open_project/auth_saml/engine.rbindex 34242d2b032..92e445ce864 100644--- a/modules/auth_saml/lib/open_project/auth_saml/engine.rb+++ b/modules/auth_saml/lib/open_project/auth_saml/engine.rb@@ -3,7 +3,9 @@ module OpenProjectmodule AuthSamldef self.configurationRequestStore.fetch(:openproject_omniauth_saml_provider) do- global_configuration.deep_merge(settings_from_db)+ global_configuration+ .deep_merge(settings_from_db)+ .deep_merge(settings_from_providers)endend@@ -18,20 +20,18 @@ module OpenProject@global_configuration ||= Hash(settings_from_config || settings_from_yaml).with_indifferent_accessend+ def self.settings_from_providers+ Saml::Provider.all.each_with_object({}) do |provider, hash|+ hash[provider.slug] = provider.to_h+ end+ end+def self.settings_from_dbvalue = Hash(Setting.plugin_openproject_auth_saml).with_indifferent_access[:providers]value.is_a?(Hash) ? value : {}end- def self.providers- configuration.map do |name, config|- config['name'] = name- readonly = global_configuration.keys.include?(name)- ::Saml::Provider.new(readonly:, **config)- end- end-def self.settings_from_configif OpenProject::Configuration["saml"].present?Rails.logger.info("[auth_saml] Registering saml integration from configuration.yml")@@ -62,8 +62,8 @@ module OpenProject:plugin_saml,:saml_providers_path,parent: :authentication,- caption: ->(*) { I18n.t('saml.menu_title') },- enterprise_feature: 'openid_providers'+ caption: ->(*) { I18n.t("saml.menu_title") },+ enterprise_feature: "openid_providers"endassets %w(