Skip to content

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

Add debugging output to sso header

Oliver Günther84d9d17bc1f0
diff --git a/app/controllers/concerns/auth_source_sso.rb b/app/controllers/concerns/auth_source_sso.rb
index 9c8bdcc3d0c..41708f797d3 100644
--- a/app/controllers/concerns/auth_source_sso.rb
+++ b/app/controllers/concerns/auth_source_sso.rb
@@ -9,6 +9,7 @@ module AuthSourceSSO
return user if user || sso_in_progress!
return nil unless header_name
+ Rails.logger.debug { "Starting header-based auth source SSO for #{header_name}='#{op_auth_header_value}'" }
perform_header_sso
end
@@ -23,13 +24,17 @@ module AuthSourceSSO
end
def read_sso_login
- get_validated_login! String(request.headers[header_name])
+ get_validated_login! op_auth_header_value
end
def sso_config
@sso_config ||= OpenProject::Configuration.auth_source_sso.try(:with_indifferent_access)
end
+ def op_auth_header_value
+ String(request.headers[header_name])
+ end
+
def header_name
sso_config && sso_config[:header]
end
@@ -55,7 +60,7 @@ module AuthSourceSSO
end
unless login.present?
- Rails.logger.error("Secret contained in auth source SSO header #{header_name} is not valid.")
+ Rails.logger.error("Provided SSO header #{header_name} is empty or not valid.")
return nil
end